Page 1 of 1

Get overall status for Desktop

Posted: Sun Jan 01, 2017 10:39 am
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

Re: Get overall status for Desktop

Posted: Tue Jan 03, 2017 10:49 am
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 :-)

Re: Get overall status for Desktop

Posted: Tue Jan 03, 2017 11:17 am
by dwhitfield
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!