How do we check if we have a downtime scheduled for a host via CGI in Nagios Core 4.x??
probably even get the downtime id for it as well...
check if downtime is scheduled for a host via CGI
Re: check if downtime is scheduled for a host via CGI
The JSON Query Generator is super handy for this sort of thing (where x.x.x.x is your Core install):
http://x.x.x.x/nagios/jsonquery.html
A brief intro to the JSON Query Generator: https://labs.nagios.com/2014/06/19/expl ... -7-part-1/
If you wanted to check if host y.y.y.y has scheduled downtime, you could try the following query (where x.x.x.x is your Core install):
http://x.x.x.x/nagios/cgi-bin/statusjso ... =starttime
downtimelist will be empty if there is no downtime scheduled, otherwise it will contain the downtime id for each scheduled downtime for host y.y.y.y.
Also if you wanted a graphical response, drop the json from the script you are running:
http://x.x.x.x/nagios/cgi-bin/status.cg ... =starttime
http://x.x.x.x/nagios/jsonquery.html
A brief intro to the JSON Query Generator: https://labs.nagios.com/2014/06/19/expl ... -7-part-1/
If you wanted to check if host y.y.y.y has scheduled downtime, you could try the following query (where x.x.x.x is your Core install):
http://x.x.x.x/nagios/cgi-bin/statusjso ... =starttime
downtimelist will be empty if there is no downtime scheduled, otherwise it will contain the downtime id for each scheduled downtime for host y.y.y.y.
Also if you wanted a graphical response, drop the json from the script you are running:
http://x.x.x.x/nagios/cgi-bin/status.cg ... =starttime
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: check if downtime is scheduled for a host via CGI
Hi
It solved the use-case i was implementing. Thanks a lot for your response. Cheers
Vivek
It solved the use-case i was implementing. Thanks a lot for your response. Cheers
Vivek