Statehistory command via api
Posted: Thu Oct 10, 2019 11:24 am
Hi,
I am trying to build up some statistics for alarms via API.
What I am trying to achieve is this:
1. Number of HARD alarms PER host group (i.e irrespective of severity, unknown+critical_warning) but separate per host group
EX: Hostgrp1 - X alarms
Hostgrp2 - X alarms
2. The number of HARD alarms with NO host group (again irrespective of severity).
I know that you can call via api with:
but I can't understand how I can set the parameters for limiting to a host group and limit to state. I guess if you don't input a timeframe it defaults to 24hrs which is good for me.
Basically I am looking after the below parameters in the api:
Can you kindly help?
Rgds
I am trying to build up some statistics for alarms via API.
What I am trying to achieve is this:
1. Number of HARD alarms PER host group (i.e irrespective of severity, unknown+critical_warning) but separate per host group
EX: Hostgrp1 - X alarms
Hostgrp2 - X alarms
2. The number of HARD alarms with NO host group (again irrespective of severity).
I know that you can call via api with:
Code: Select all
curl -XGET "http://<ipaddress>/nagiosxi/api/v1/objects/statehistory?apikey=<apikey>&last_hard_state=1"Basically I am looking after the below parameters in the api:
Can you kindly help?
Rgds