i am attemting to create an event handler for my windows services but cant get it working.
what i have done is :
installed ns client on the windows side configured the base install (ip port etc).
created a script called restart_service.bat
Code: Select all
@echo off
net stop %1
net start %1
@exit 0
on the linux side i created a script and placed it in the libex folder :
Code: Select all
#!/bin/sh
case "$1" in
OK)
;;
WARNING)
;;
UNKNOWN)
;;
CRITICAL)
/usr/local/nagios/libexec/check_nrpe -H "$2" -p 5666 -c restart_service -a "$3"
;;
esac
exit 0
Code: Select all
#restart sevice
define command{
command_name restart_service
command_line $USER1$/restart_service $SERVICESTATE$ $HOSTADDRESS$
}