event handler debug
Assaf Flatto
nagios at flatto.net
Tue Nov 27 20:16:50 CET 2012
On 27/11/12 17:32, fatcharly at gmx.de wrote:
> Hi,
>
> I`m using a nagios 3.0.3 on a CentOS 5.8 and I´m a little stuck with a eventhandeler problem- I can`t see it running and I can´t find a problem in the logfiles. Here a short overview:
>
> define service{
> use generic-service
> host_name hostname
> service_description host_hh_prod1_1
> check_command check_nrpe!hh_prod1_1
> event_handler hh_prod11_down
> notifications_enabled 1
> }
>
>
> in commands.cfg is defined:
>
> define command{
> command_name hh_prod11_down
> command_line /usr/local/nagios/libexec/eventhandlers/hh_prod1_1_down.sh $HOSTSTATE$ $HOSTSTATETYPE$ $HOSTATTEMPT$
> }
>
>
> /usr/local/nagios/libexec/eventhandlers/hh_prod1_1_down.sh :
>
> #/bin/bash
> # $1=State $2=Zustandstyp hard oder soft $3= Versuch
> case $1 in
> OK)
> #/usr/local/nagios/libexec/check_nrpe -H 192.168.18.30 -c route_back_1
> echo `date`"route hh_prod1_1 ok">>/var/log/ipsecrouting_beth.log
> ;;
> CRITICAL)
> if [ $2 == "HARD" ] || [[ $2="SOFT"&& $3 -gt 0 ]]; then
> /usr/local/nagios/libexec/check_nrpe -H 192.168.16.4 -c check_hhprod11
> echo `date`"route hh_prod1_1 down">>/var/log/ipsecrouting_beth.log
> fi
> ;;
> UNKNOWN)
> echo `date`"route hh_prod1_1 down unkonwn error kein event">>/var/log/ipsecrouting_beth.log
> ;;
> esac
> exit 0
>
> When I call the hh_prod1_1_down.sh manuell with the appropriate numbers, I get entries in the ipsecrouting_beth.log-file and the command is executed, but when I let it run by nagios nothing is happening.
>
>
> Any suggestions or hints to debug (I already switched the debug to -1 but nothing can be found about the event handler) are welcome.
>
> Kind regards
>
> fatcharly
>
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
can you see anything on the nrpe side ?
when you are testing , are you running it as the nagios user or as root?
Where are you passing the parameters to the eventhandler in your command
definition ?
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
DESIGN Expert tips on starting your parallel project right.
http://goparallel.sourceforge.net
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list