Page 1 of 1

Alarm via API returns wrong value

Posted: Fri Jul 10, 2020 8:57 pm
by tranzmatt
I'm working with pyzm, but I think this applies to ZM itself.

When I send the arm() command, which posts:

Code: Select all

[DEBUG 1] make_request called with url=http://192.168.1.247/zm/api/monitors/alarm/id:3/command:on.json payload={} type=get query={}
Where mid=3. I get a return json of something like

Code: Select all

ARM: {'status': 'Alarmed event id: 2'}
But in the web-ui, ID #3 seems to have been created instead.

Can anyone explain the discrepancy? Shouldn't "3" be returned in the json string? I've tested multiple times.

Re: Alarm via API returns wrong value

Posted: Fri Jul 10, 2020 9:42 pm
by asker
This seems to be a zmu bug. If you run sudo -u www-data zmu -m<mid> -a -U admin -P <password> you'll see it returns a wrong eid. May want to log it in ZM GH repo - but I think this is a known issue. Needs to be solved, either way.

Re: Alarm via API returns wrong value

Posted: Mon Jul 13, 2020 8:31 pm
by tranzmatt
Ok, I've submitted a ticket to the github repo.