Downtime within Nagios xi

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
scorit
Posts: 17
Joined: Wed Sep 25, 2019 3:06 am

Downtime within Nagios xi

Post by scorit »

Hi,

We use to send dowtime to set Nagios blackout period with nagios.cmd.

Now we upgraded with Nagios xi, I see we need to get through API calls to set system downtime.
curl -XPOST "https://dcvprdmon/nagiosxi/api/v1/syste ... pikey=xxxx

I am wondering if there is still the legacy method working ?


Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Downtime within Nagios xi

Post by scottwilkerson »

Yes you can still use commands through nagios.cmd
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scorit
Posts: 17
Joined: Wed Sep 25, 2019 3:06 am

Re: Downtime within Nagios xi

Post by scorit »

Thanks. I tried this legacy script but it seems no downtime is commited on Nagios :
Any idea why it's not working ?

# This is a sample shell script showing how you can submit the CHANGE_HOST_CHECK_COMMAND command
# to Nagios. Adjust variables to fit your environment as necessary.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'

/usr/bin/printf "DISABLE_SVC_NOTIFICATIONS;host;Check daemon batch\n" $now > $commandfile
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Downtime within Nagios xi

Post by scottwilkerson »

This looks correct to just disable notifications for the service if the host is host and the service_description is Check daemon batch
https://assets.nagios.com/downloads/nag ... mand_id=12

But this command doesn't schedule a downtime, that would look like the following
https://assets.nagios.com/downloads/nag ... and_id=122
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart