Page 1 of 1

archieve.json Query not returning correct output

Posted: Wed Dec 11, 2019 3:27 am
by shivangi
Hi Team,

I am Running the archieve.json API to get the alert list for a specific hostgroup but its offering me all the alerts for that time period specified .

I want only alertlist for the hosts of that particular hostgroup .

API i am using :

http://<mynagios server ip>/nagios/cgi-bin/archivejson.cgi?query=alertlist&hostgroup=AMS&servicestates=critical&starttime=1575942375&endtime= 1576028775

I am running the query wrong ?

Re: archieve.json Query not returning correct output

Posted: Wed Dec 11, 2019 5:42 pm
by cdienger
Are you using https://labs.nagios.com/2014/06/19/expl ... #more-1897 to create the query? If the hostgroup doesn't exist then it will return all groups like you are seeing.

Re: archieve.json Query not returning correct output

Posted: Thu Dec 19, 2019 6:31 am
by shivangi
Hi Cdienger,

Yes I am using the same link to create the query and the hostgroup exists as well.I want to get the alerts dump for a particular hosts in the hostgroup for past one month .Is there any other way to do so in Nagios ?

Thanks.

Re: archieve.json Query not returning correct output

Posted: Fri Dec 20, 2019 5:03 pm
by cdienger
What version of XI is this? Please provide a screenshot from the API so that we can see the options that are selected and the results that it returns.