mirror of
https://github.com/Motion-Project/motion.git
synced 2026-04-19 21:46:58 -04:00
This change introduces new HTTP endpoints in the stream web server returning
status information regarding a particular or all cameras as a JSON object.
These are useful in implementing system monitoring, e.g. via Nagios or Icinga.
"{IP}:{port0}/cameras.json": JSON object with IDs and names of all cameras,
e.g.:
$ curl -s http://127.0.0.1:8081/cameras.json | jq -rMC .
{
"cameras": [
{
"id": 1,
"name": "Lobby"
},
{
"id": 3,
"name": "Lobby"
}
]
}
"{IP}:{port0}/{camid}/status.json": JSON object with information about a single
camera, e.g.:
$ curl -s http://127.0.0.1:8081/3/status.json | jq -rMC .
{
"id": 3,
"name": "Lobby",
"image_width": 640,
"image_height": 480,
"fps": 15,
"missing_frame_counter": 1561,
"running": 1,
"lost_connection": 1,
"currenttime": 1573400729,
"currenttime_iso8601": "2019-11-10T15:45:29+0000",
"lasttime": 0,
"lasttime_iso8601": null,
"lasttime_elapsed": null,
"eventtime": 0,
"eventtime_iso8601": null,
"eventtime_elapsed": null,
"connectionlosttime": 1573400614,
"connectionlosttime_iso8601": "2019-11-10T15:43:34+0000",
"connectionlosttime_elapsed": 115
}
Additional endpoints:
- "{IP}:{port0}/status.json": JSON object with information about all cameras
- "{IP}:{portX}/status.json": JSON object with information about the camera
running on port {portX}
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Co-authored-by: Mr-Dave <motionmrdave@gmail.com>