Question about Auto generating Ack script
Posted: Wed Mar 06, 2019 3:17 pm
If I modify this script by adding service and host macros will it work?
Original:
modded:
Im just trying to have nagios acknowledge a service when it goes down. Im going to create an event handler that will run this script when the service goes down.
Original:
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.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] ACKNOWLEDGE_SVC_PROBLEM;host1;service1;2;1;1;Some One;Some Acknowledgement Comment\n" $now > $commandfile 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.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] ACKNOWLEDGE_SVC_PROBLEM;%host%;%service%;2;1;1;NagiosXI;Acknowledgement has been auto generated by NagiosXI\n" $now > $commandfile