Event_handler and check_nrpe

Hendric Minassian hminassian at CHOC.ORG
Thu Apr 10 00:50:42 CEST 2008


I am trying to use an event_handler to reatrt a process on a remote server. I use NRPE for this purpose.
The process works fine when I run the full check_nrpe command from the command line of the Nagios server:
 
#./check_nrpe -H nnn.nn.nnn.nn -c restart_alert_agent_new -a CRITICAL SOFT 2
However, the restart script on the remote server does not kick in when the alert is encountered by Nagios itself. Below is the command defined in misccommands.cfg:
 
define command{
      command_name    restart_alert_agent_new
      command_line    /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c restart_alert_agent_new -a $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$
      }
 
As mentioned, the restart script in the remote server works fine when invoked through the command line on Nagios server (above).
Below is the definition of the service in services.cfg:
 
# Service definition
define service{
        use                             generic-service ; Name of service template to use
 
        host_name                       CHOCLX-INTTEST
        service_description             check_total_procs
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              4
        normal_check_interval           5
        retry_check_interval            2
        event_handler_enabled           1
        event_handler                   restart_alert_agent_new
        contact_groups                  sun-admins,lawson-admins,egate-admins
        notification_interval           240
        notification_period             24x7
        notification_options            u,c
        notifications_enabled           1
        check_command                   check_nrpe!check_total_procs
        }
 
Thank you for your help.
Hendric Minassian
 

"EMF <choc.org>" made the following annotations.
------------------------------------------------------------------------------
04/09/08, 15:51:44 

This email message and any files transmitted are sent with confidentiality in mind 
and contain privileged or copyright information. You must not present
this message to another party without gaining permission from the 
sender.  If you are not the intended recipient you must not copy, 
distribute or use this email or the information contained in it 
for any purpose other than to notify Children's Hospital of 
Orange County.  Any views expressed in this message are those of 
the sender, except where the sender specifically states them to 
be the views of Children's Hospital of Orange County. If you have
received this message in error, please notify the sender immediately, 
and delete this email from your system. We do not guarantee that 
this material is free from viruses or any other defects although 
due care has been taken to minimize the risk.

==============================================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080409/cc4a95ec/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
-------------- 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