my goal is to have have nagios shoot out an email as well as automagically ackowledge a service when it enters a soft or hard down state.
I am trying to set up a scripted event handler that will be associated with service templates that have been associated to my hostgroups.
I have created this script:
Code: Select all
#!/bin/sh
# This is a sample shell script showing how you can submit the ACKNOWLEDGE_SVC_PROBLEM command
# to Nagios. Adjust variables to fit your environment as necessary.
host=$1
service=$2
now=`date +%s`
commandfile= '/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] ACKNOWLEDGE_SVC_PROBLEM;host1;service2;1;1;1;bhankers;this issue has been automatically acknowedged by NagiosXi\n" $now > $commandfile What am I missing?