archieve.json Query not returning correct output

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
shivangi
Posts: 32
Joined: Mon Mar 25, 2019 2:01 am

archieve.json Query not returning correct output

Post 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 ?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: archieve.json Query not returning correct output

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
shivangi
Posts: 32
Joined: Mon Mar 25, 2019 2:01 am

Re: archieve.json Query not returning correct output

Post 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.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: archieve.json Query not returning correct output

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked