Monitoring question

Marc Powell marc at ena.com
Wed Jan 17 20:25:24 CET 2007



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Formoso, Travis
> Sent: Wednesday, January 17, 2007 12:59 PM
> To: andy.shellam-lists
> Cc: nagios-users
> Subject: Re: [Nagios-users] Monitoring question
> 
> > You will need to add "sudo" at the beginning of your command in
Nagios -
> > e.g. "sudo /usr/local/nagios/libexec/eventhandler......"
> > I ran ./check-httpd as root and when I typed that in - nothing
happened.

That's because the check-httpd script expects a number of command line
arguments that are passed to it and specific values before taking
action. If it doesn't see those, it just exits cleanly. You can read the
script to see what those are.

define command{
	command_name	restart-httpd
	command_line
/usr/local/nagios/libexec/eventhandlers/restart-httpd  $SERVICESTATE$
$SERVICESTATETYPE$ $SERVICEATTEMPT$
	}

Nagios will substitute appropriate information for the $MACROS$ when
calling your script. The end result would be something like --

/usr/local/nagios/libexec/eventhandlers/restart-httpd CRITICAL SOFT 1
Or
/usr/local/nagios/libexec/eventhandlers/restart-httpd CRITICAL HARD 3
 
> Also if I am running as root user - do I need to still use sudo?

Not if you're wanting to see if your event handler, when run with root
permissions, will restart httpd. If you want to test if nagios can run
it then you need to become the nagios user (after setting up sudo and
your event handler as previously noted) then call the event handler
directly.

--
Marc

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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