Page 1 of 1
Disable Host svc checks
Posted: Fri Oct 06, 2017 2:40 pm
by matson-itops
Is there a way to script disable/enable service checks in nagios xi 5.4.2?
want to leave host monitoring up, just disable service checks
Would like to disable checks for ALL services on a given host, just prior to deploy
then enable afterwards.
Re: Disable Host svc checks
Posted: Fri Oct 06, 2017 2:51 pm
by cdienger
Depending on the naming convention used, you could go to Configure > Core Config Manager > Services, filter for the hostname, select all services returned, and select Deactivate from the drop down.
Re: Disable Host svc checks
Posted: Fri Oct 06, 2017 3:13 pm
by matson-itops
Need to do that through cli /script
is that possible? Will the below work?
#!/bin/sh
# This is a sample shell script showing how you can submit the DISABLE_HOST_SVC_CHECKS command
# to Nagios. Adjust variables to fit your environment as necessary.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] DISABLE_HOST_SVC_CHECKS;host1\n" $now > $commandfile
Re: Disable Host svc checks
Posted: Fri Oct 06, 2017 4:13 pm
by scottwilkerson
This is exactly how you would do it replacing host1 with the hostname that you want to disable all of the services on