Page 1 of 1

Trigger all checks?

Posted: Tue Aug 16, 2016 7:50 am
by jriker1
Is there a way to force triggering of all checks in the system rather than going thru the gui one by one? I am considering upgrading my nagios to 4.2.0 from 4.1.1 and figured an easy check to see if all is good other than it's running is to force all the checks to trigger. Thoughts?

Thanks.

JR

Re: Trigger all checks?

Posted: Tue Aug 16, 2016 11:34 am
by bwallace
Implementing one of the scripts linked below should enable you to accomplish a forced check of either all hosts or services:

SCHEDULE_FORCED_HOST_SVC_CHECKS
https://old.nagios.org/developerinfo/ex ... and_id=130

Code: Select all

#!/bin/sh
# This is a sample shell script showing how you can submit the SCHEDULE_FORCED_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] SCHEDULE_FORCED_HOST_SVC_CHECKS;host1;1110741500\n" $now > $commandfile
_______________________________________________________________

SCHEDULE_FORCED_SVC_CHECK
https://old.nagios.org/developerinfo/ex ... and_id=129

Code: Select all

#!/bin/sh
# This is a sample shell script showing how you can submit the SCHEDULE_FORCED_SVC_CHECK 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] SCHEDULE_FORCED_SVC_CHECK;host1;service1;1110741500\n" $now > $commandfile