Files
motion/doc
hansmi c568a40666 Add HTTP endpoints with camera status information (#1058)
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>
2020-12-24 22:20:17 -07:00
..
2020-01-13 21:26:23 -07:00
2019-09-21 21:15:08 -06:00
2020-10-25 21:05:17 -06:00
2019-09-21 21:15:08 -06:00
2019-09-21 21:15:08 -06:00
2019-09-21 21:15:08 -06:00
2020-12-06 22:48:51 -07:00
2020-12-06 22:48:51 -07:00
2019-09-21 21:15:08 -06:00
2019-09-21 21:15:08 -06:00
2019-09-21 21:15:08 -06:00
2019-09-21 21:15:08 -06:00