<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV dir=ltr align=left><SPAN class=680180014-10042008></SPAN>I<SPAN
class=680180014-10042008> hate to state the obvious, but nrpe usually doesn't
have privileges to start processes. I have a check that I run on remote hosts
that requires root privilege and had to use sudo. I was very restrictive in my
sudoers file to make sure that there were no holes, but it works with no
problems.</SPAN><BR></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<B>From:</B> nagios-users-bounces@lists.sourceforge.net
[mailto:nagios-users-bounces@lists.sourceforge.net] <B>On Behalf Of
</B>Hendric Minassian<BR><B>Sent:</B> Wednesday, April 09, 2008 6:51
PM<BR><B>To:</B> nagios-users@lists.sourceforge.net<BR><B>Subject:</B>
[Nagios-users] Event_handler and check_nrpe<BR><BR></DIV>
<DIV></DIV>
<DIV>I am trying to use an event_handler to reatrt a process on a remote
server. I use NRPE for this purpose.</DIV>
<DIV>The process works fine when I run the full check_nrpe command from the
command line of the Nagios server:</DIV>
<DIV> </DIV>
<DIV>#./check_nrpe -H nnn.nn.nnn.nn -c restart_alert_agent_new -a CRITICAL
SOFT 2<BR></DIV>
<DIV>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:</DIV>
<DIV> </DIV>
<DIV>define command{<BR>
command_name
restart_alert_agent_new<BR>
command_line /usr/local/nagios/libexec/check_nrpe -H
$HOSTADDRESS$ -c restart_alert_agent_new -a $SERVICESTATE$ $SERVICESTATETYPE$
$SERVICEATTEMPT$<BR> }</DIV>
<DIV> </DIV>
<DIV>As mentioned, the restart script in the remote server works fine when
invoked through the command line on Nagios server (above).</DIV>
<DIV>Below is the definition of the service in services.cfg:</DIV>
<DIV> </DIV>
<DIV># Service definition<BR>define
service{<BR>
use
generic-service ; Name of service template to use</DIV>
<DIV> </DIV>
<DIV>
host_name
CHOCLX-INTTEST<BR>
service_description
check_total_procs<BR>
is_volatile
0<BR>
check_period
24x7<BR>
max_check_attempts
4<BR>
normal_check_interval
5<BR>
retry_check_interval
2<BR>
event_handler_enabled
1<BR>
event_handler
restart_alert_agent_new<BR>
contact_groups
sun-admins,lawson-admins,egate-admins<BR>
notification_interval
240<BR>
notification_period
24x7<BR>
notification_options
u,c<BR>
notifications_enabled
1<BR>
check_command
check_nrpe!check_total_procs<BR>
}<BR></DIV>
<DIV> </DIV>
<DIV>Thank you for your help.</DIV>
<DIV>Hendric Minassian</DIV>
<DIV> </DIV>
<P><PRE wrap>"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.
==============================================================================
</PRE>
<P></P></BLOCKQUOTE>
<DIV><P><HR>
This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.
</P></DIV>
</BODY></HTML>