Get overall status for Desktop

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
simonmpfh
Posts: 2
Joined: Sun Jan 01, 2017 10:34 am

Get overall status for Desktop

Post by simonmpfh »

Hi All, Just upgraded from Nagios2 to Nagios4 so I can try the jsonquery but I can't get the answer I am looking for.

I would like to grab (using curl I hope) a simple yes no answer to the question

"Are there any unacknowledged host or service problems"?

This will control the colour of the Nagios button on our engineering homepage and of course if there are any problems the engineers can click the red button and investigate

If all is well they will see a green button and only click when they need to.

Sorry if I am missing something obvious!

TIA

Simon
simonmpfh
Posts: 2
Joined: Sun Jan 01, 2017 10:34 am

Re: Get overall status for Desktop

Post by simonmpfh »

Meh! I tried APIs and JsonQuery but it was all too complicated :-(

In the end I did

grep -B39 problem_has_been_acknowledged=0 /usr/local/nagios/var/status.dat|grep -B14 current_state=1|grep host_name

Once per minute from cron and it works a treat :-)
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Get overall status for Desktop

Post by dwhitfield »

It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
Locked