I have coded an event handler that basically should reboot a server on a hard critical event.
The code looks something like this:
… code to handle states.
code to power off server
#wait 30 seconds
code to power on server[/code]
Now when I execute the script from a terminal, everything works. If I use it as an eventhandler, then only the lines up to the sleep command gets executed. After the sleep it seems like the script is terminated.
The command to call the event handler looks like this:
# 'Reboot dkxlsrv1' command definition
command_line /usr/local/nagios/libexec/eventhandlers/reboot-sw1 $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ &
Any ideas or input will be greatly appreciated.