#!/bin/sh

# Write a command to the NetSaint command file to cause
# notifications for all services and hosts beyond a given
# host to be re-enabled.

# Notes: 
# 1) This script is not intended to be used as an 
#    event handler by itself.  Instead, it is used by other
#    event handler scripts (like the redundancy examples)
#    to put NetSaint into active mode.  Read the HTML
#    documentation for more information on event handlers.
# 2) In order for NetSaint to process any commands that
#    are written to the command file, you must enable
#    the check_external_commands option in the main
#    configuration file.

echocmd="/bin/echo"

CommandFile="/usr/local/netsaint/var/rw/netsaint.cmd"

# get the current date/time in seconds since UNIX epoch
datetime=`date +%s`

# create the command line to add to the command file
cmdline="[$datetime] ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST;$1"

# append the command to the end of the command file
`$echocmd $cmdline >> $CommandFile`




