Disable Host svc checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
matson-itops
Posts: 109
Joined: Wed Nov 18, 2015 11:19 pm

Disable Host svc checks

Post 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.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Disable Host svc checks

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
matson-itops
Posts: 109
Joined: Wed Nov 18, 2015 11:19 pm

Re: Disable Host svc checks

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Disable Host svc checks

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked