In order to simplify automated monitoring (as in system monitoring) of camera recordings, e.g. using Icinga, it's useful to have an HTTP endpoint returning a machine-readable format. As of this writing motion only supports human-readable responses. The exact format depends on webcontrol_interface. I propose adding two new endpoints:
/cameras.json: Return a JSON object containing a list of cameras, just like / does in HTML format
/{camid}/status.json: Return a JSON object describing the current status of a given camera, e.g. whether the RTSP stream is connected. The information comes from struct context and struct rtsp_context for the most part.
Both responses can be expanded later if needed.
I've started experimenting with the code, but before I spend more time on it: is this a feature which would be accepted?
In order to simplify automated monitoring (as in system monitoring) of camera recordings, e.g. using Icinga, it's useful to have an HTTP endpoint returning a machine-readable format. As of this writing motion only supports human-readable responses. The exact format depends on
webcontrol_interface. I propose adding two new endpoints:/cameras.json: Return a JSON object containing a list of cameras, just like/does in HTML format/{camid}/status.json: Return a JSON object describing the current status of a given camera, e.g. whether the RTSP stream is connected. The information comes fromstruct contextandstruct rtsp_contextfor the most part.Both responses can be expanded later if needed.
I've started experimenting with the code, but before I spend more time on it: is this a feature which would be accepted?