Skip to content

Get Monitor_Status from Monitor APIΒ #53

@cam-avida

Description

@cam-avida

From https://zoneminder.readthedocs.io/en/stable/api.html#return-a-list-of-all-monitors

It is worthwhile to note that starting ZM 1.32.3 and beyond, this API also returns a Monitor_Status object per monitor. It looks like this:

"Monitor_Status": {
"MonitorId": "2",
"Status": "Connected",
"CaptureFPS": "1.67",
"AnalysisFPS": "1.67",
"CaptureBandwidth": "52095"
}

The current Monitor object's status() method only returns the status from the daemon:

def status(self):
"""Returns status of monitor, as reported by zmdc
TBD: crappy return, need to normalize
Returns:
json: API response
"""
url = self.api.api_url+'/monitors/daemonStatus/id:{}/daemon:zmc.json'.format(self.id())
return self.api._make_request(url=url)

It'd be great to get the Monitor_Status object if possible (version >= 1.32.3), and if not, then return the daemon (or both?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions