Using API

Forum for questions and support relating to the 1.28.x releases only.
Locked
mr.eskildsen
Posts: 1
Joined: Wed Jan 13, 2016 10:54 pm

Using API

Post by mr.eskildsen »

Hi,

I am trying to integrate to ZoneMinder using the API. I am on

Code: Select all

version: 1.28.109
apiversion: 1.28.109.1
I am using a Raspberry Pi as IP camera.

I have been looking around to find some documentation on how to use things.....

If can query a monitor to get all events and also find last event, but now I want to check status of both server and camera.
I have started with the Camera and found this:

Code: Select all

http://<my-zoneminder-ip>/zm/api/monitors/daemonStatus/id:1/daemon:zmc.json
This gives me the status of the zmc daemon for monitor 1, just fine. The problem is that when the camera is offline it still reports that the daemon is running (but it restarts all the time). I guess that is the nature of the daemon, but isn't there some possibility to query the monitor to get data to verfy monitor status (Online / Offline as a minimum).
Is it possible??

Where can I find a overview over all possibilities in the API? I found some samples at the ZoneMinder site, but I found more detailed queries in some github repos.

Best regards
Martin
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Using API

Post by asker »

The daemon check API also returns a status text, that has substring text like "not running", "pending", "Unable to connect" - you can use those values to check further.

With respect to documentation,
http://zoneminder.readthedocs.org/en/stable/api.html

I think I've covered most scenarios there (with the exception of a few). Let me know if you discover anything that needs to go in there.
mr.eskildsen wrote:Hi,

If can query a monitor to get all events and also find last event, but now I want to check status of both server and camera.
I have started with the Camera and found this:

Code: Select all

http://<my-zoneminder-ip>/zm/api/monitors/daemonStatus/id:1/daemon:zmc.json
This gives me the status of the zmc daemon for monitor 1, just fine. The problem is that when the camera is offline it still reports that the daemon is running (but it restarts all the time). I guess that is the nature of the daemon, but isn't there some possibility to query the monitor to get data to verfy monitor status (Online / Offline as a minimum).
Is it possible??

Where can I find a overview over all possibilities in the API? I found some samples at the ZoneMinder site, but I found more detailed queries in some github repos.

Best regards
Martin
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Locked