Nagios Freeze after Eventhandler execution

Harald Böhmecke harald.boehmecke at bertelsmann.de
Wed Jul 21 15:07:42 CEST 2010


Hi,

Still experiencing the same issue. Does anybody know why Nagios Freezes after executing the eventhandler?

Thanks,

Harald



> Hi All,
> 
> Need help with an Eventhandler!
> 
> After Nagios (successfully) executes the eventhandler, no further
> checks are done on any host. Nagios is like in a stopped or stalled
> state. 
> 
> Here is my config. I actually took it from the manual:
> 
> define service {
>         host_name                       blah
>         service_description             NSCA
>         use                             local_1m
>         check_command                   check_tcp!5667
>         event_handler                   handler_restart_nsca
>         event_handler_enabled           1
>         register                        1
> 
>         }
> define command {
>        command_name                             handler_restart_nsca
> 
> command_line                             /usr/share/nagios3/plugins/eventhandlers/restart-nsca  $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$
> 
> }
> 
> 
> /usr/share/nagios3/plugins/eventhandlers/restart-nsca
> 
> #!/bin/sh
> #
> # Event handler script for restarting the web server on the local
> machine
> #
> # Note: This script will only restart the web server if the service is
> #       retried 3 times (in a "soft" state) or if the web service
> somehow
> #       manages to fall into a "hard" error state.
> #
> 
> 
> # What state is the NSCA service in?
> case "$1" in
> OK)
> # The service just came back up, so don't do anything...
> ;;
> WARNING)
> # We don't really care about warning states, since the service is
> probably still running...
> ;;
> UNKNOWN)
> # We don't know what might be causing an unknown error, so don't do
> anything...
> ;;
> CRITICAL)
> # Aha!  The HTTP service appears to have a problem - perhaps we should
> restart the server...
> 
> # Is this a "soft" or a "hard" state?
> case "$2" in
> 
> # We're in a "soft" state, meaning that Nagios is in the middle of
> retrying the
> # check before it turns into a "hard" state and contacts get
> notified...
> SOFT)
> 
> # What check attempt are we on?  We don't want to restart the web
> server on the first
> # check, because it may just be a fluke!
> case "$3" in
> 
> # Wait until the check has been tried 3 times before restarting the
> web server.
> # If the check fails on the 4th time (after we restart the web
> server), the state
> # type will turn to "hard" and contacts will be notified of the
> problem.
> # Hopefully this will restart the web server successfully, so the 4th
> check will
> # result in a "soft" recovery.  If that happens no one gets notified
> because we
> # fixed the problem!
> 3)
> echo -n "Restarting NSCA service (3rd soft critical state)..."
> # Call the init script to restart the NSCA server
> /etc/init.d/nsca restart
> ;;
> esac
> ;;
> 
> # The HTTP service somehow managed to turn into a hard error without
> getting fixed.
> # It should have been restarted by the code above, but for some reason
> it didn't.
> # Let's give it one last try, shall we?  
> # Note: Contacts have already been notified of a problem with the
> service at this
> # point (unless you disabled notifications for this service)
> HARD)
> echo -n "Restarting HTTP service..."
> # Call the init script to restart the NSCA server
> /etc/init.d/nsca restart
> ;;
> esac
> ;;
> esac
> exit 0
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20100721/b2d80b00/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
-------------- next part --------------
_______________________________________________
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