NagiosXI API servicestatus gather only Critical Status

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
imadc
Posts: 58
Joined: Wed Jun 14, 2017 12:10 pm

NagiosXI API servicestatus gather only Critical Status

Post by imadc »

Hello Team

We would like to gather all the critical status services from about 3700 service that we are currently monitoring over 400 hosts

Can you advise what filters we can add to the REST API call to the nagiosxi server so that we don't get all the running 3700 servicestatus.

http://X.X.X.X/nagiosxi/api/v1/objects/ ... x&pretty=1"

Thanks,
Insurity
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NagiosXI API servicestatus gather only Critical Status

Post by lmiltchev »

You could add "&current_state=2" at the end of the URL, e.g.

Code: Select all

http://x.x.x.x/nagiosxi/api/v1/objects/servicestatus?apikey=xxxx&pretty=1&current_state=2
This should display only the services that are in Critical state.
Be sure to check out our Knowledgebase for helpful articles and solutions!
imadc
Posts: 58
Joined: Wed Jun 14, 2017 12:10 pm

Re: NagiosXI API servicestatus gather only Critical Status

Post by imadc »

Thanks this exactly what we were looking for

Case will be closed

Insurity
Locked