Event Handler to Create missing files
Posted: Wed Sep 24, 2014 6:12 am
Team,
From Nagios server using check_nrpe we are checking the script testing.sh on remote server tmp folder. If the file is not there using event handler it has to call the second script (testing2.sh) to create the files on tmp folder. I have attached the two script ( testing.sh and testing2.sh ) and event handler configuration.
We have added the entry on remote server in etc/nrpe.cfg
command[check_testing]=/tmp/testing.sh
command[check_testing2]=/tmp/testing2.sh
Issue : Nagios is not calling the event handler even though we enabled in main configuration and for particular service. In event log also we not seeing any logs related to event_file_creation.sh
The script is working fine manually /usr/local/nagios/libexec/event_file_creation.sh
Output of event_file_creation.sh
#!/bin/bash
# Event Handler for creating missing files
case "$1" in
OK)
;;
WARNING)
/usr/local/nagios/libexec/check_nrpe -H "$2" -p 5666 -c check_testing2 -n
;;
UNKNOWN)
;;
CRITICAL)
echo "Files has not been created"
;;
esac
exit 0
Could you please suggest some solution.
From Nagios server using check_nrpe we are checking the script testing.sh on remote server tmp folder. If the file is not there using event handler it has to call the second script (testing2.sh) to create the files on tmp folder. I have attached the two script ( testing.sh and testing2.sh ) and event handler configuration.
We have added the entry on remote server in etc/nrpe.cfg
command[check_testing]=/tmp/testing.sh
command[check_testing2]=/tmp/testing2.sh
Issue : Nagios is not calling the event handler even though we enabled in main configuration and for particular service. In event log also we not seeing any logs related to event_file_creation.sh
The script is working fine manually /usr/local/nagios/libexec/event_file_creation.sh
Output of event_file_creation.sh
#!/bin/bash
# Event Handler for creating missing files
case "$1" in
OK)
;;
WARNING)
/usr/local/nagios/libexec/check_nrpe -H "$2" -p 5666 -c check_testing2 -n
;;
UNKNOWN)
;;
CRITICAL)
echo "Files has not been created"
;;
esac
exit 0
Could you please suggest some solution.