interpreting event-handler

Bryan Liles lilesb at ijet.com
Mon Nov 4 17:04:40 CET 2002


Did you define a command for restart_program, such as:

define command{
	command_name	restart_program
	command_line	/opt/nagios/libexec/eventhandlers/restart_program  $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$
	}



On Mon, 4 Nov 2002 22:11:26 +0800
Jasmine Chua <jasmine.chua at securecirt.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Sorry its me again. I dont think i can put the event-handler script on my 
> monitoring server because it is supposed to run the script on my remote 
> server. It is returning a code 127 saying that it cant find the script on my 
> monitoring server, but it is not suppose to be there as the program to kill 
> off exists on the remote server. Heres a snippet of my 'Load' service 
> definition:
> 
> # Service definition
> define service{
>         use                             ocsp-service                           	
> host_name                      host-abc
>         service_description             Load
>         is_volatile                     0
>         check_period                    24x7
>         max_check_attempts              3
>         event_handler                   restart_program
>         normal_check_interval           5
>         retry_check_interval            1
>         contact_groups                  admin
>         notification_interval           0
>         notification_period             24x7
>         notification_options            w,u,c,r
>         check_command                   check_nrpe!check-load-runaway
>         }
>  
> If i will to put a "check_nrpe!restart_program" to point to the remote server 
> /libexec/event-handlers directory.. it will return a config error on my 
> monitoring server that the "check_nrpe!restart_program" is not defined 
> anywhere! But, I am only suppose to define the 'check_nrpe' command.. the 
> rest of my nrpe services are working. So, I cant do that either. 
> 
> Is there another way of getting the monitoring server to point to the remote 
> server and run my script on the remote server?
>  
> 
> On Monday 04 November 2002 21:47, Jasmine Chua wrote:
> > Thanks folks.. but i think i have figured out what is wrong. It is calling
> > a script that does not exist in the directory.
> >
> > On Monday 04 November 2002 21:34, Jasmine Chua wrote:
> > > -- Hi all,
> > >
> > > I wanted to restart a program when a remote server 's load average falls
> > > critical. My script works all right by itself. However, when I try to get
> > > nagios to do it automatically through event-handlers.. I got this message
> > > in the logs..
> > >
> > > SERVICE ALERT: host-abc;Load;OK;HARD;3;load average: 0.00, 0.00, 0.00
> > > SERVICE EVENT HANDLER: host-abc;Load;OK;HARD;3;restart_program
> > > Warning: Attempting to execute the command
> > > "/usr/local/nagios/libexec/eventhandlers/restart_program OK HARD 3"
> > > resulted in a return code of 127.  Make sure the script or binary you are
> > > trying to execute actually exists...
> > >
> > > I have checked the location of my script and made sure it is in there
> > > with the right permissions. I dont think nagios is executing my script.
> > > anyone has an idea whats going on?
> > >
> > > Jasmine Chua
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
> 
> iD8DBQE9xoAUNgvTa7Hj2AURAu7tAJ9Y5UOj9Gvww2zGg6Zrw1cQIGpqdQCbBqxP
> BoWXnKPCGQCIoTN5F0MVOTk=
> =+RYA
> -----END PGP SIGNATURE-----
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: ApacheCon, November 18-21 in
> Las Vegas (supported by COMDEX), the only Apache event to be
> fully supported by the ASF. http://www.apachecon.com
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users


-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com




More information about the Users mailing list