Debian Codegraph @

contrib/eventhandlers/disable_active_service_checks

raw
1 #!/bin/sh
2
3 # Write a command to the Nagios command file to cause
4 # it to disable active service checks. This can be
5 # referred to as 'standby' mode in a redundant monitoring
6 # environment.
7
8 # Notes:
9 # 1) This script is not intended to be used as an
10 # event handler by itself. Instead, it is used by other
11 # event handler scripts (like the redundancy examples).
12 # 2) In order for Nagios to process any commands that
13 # are written to the command file, you must enable
14 # the check_external_commands option in the main
15 # configuration file.
16
17 printfcmd="/usr/bin/printf"
18
19 CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
20
21 # get the current date/time in seconds since UNIX epoch
22 datetime=`date +%s`
23
24 # pipe the command to the command file
25 `$printfcmd "[%i] STOP_EXECUTING_SVC_CHECKS\n" $datetime >> $CommandFile`
26