Event_handler and check_nrpe
Fulton, David
dfulton at nuvox.com
Thu Apr 10 16:02:49 CEST 2008
I 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.
________________________________
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Hendric
Minassian
Sent: Wednesday, April 09, 2008 6:51 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Event_handler and check_nrpe
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.
========================================================================
======
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080410/9e732c33/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