Monitoring question

Marc Powell marc at ena.com
Wed Jan 17 18:25:35 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 9:59 AM
> To: nagios-users
> Subject: Re: [Nagios-users] Monitoring question
> 
> 
> > OK I will try to give it the check_http check and see if it works
when I
> > > bring down the httpd.
> 

[chop]
> Here is the output of the log file:
> 
> [1169048695] SERVICE ALERT: localhost;HTTP;CRITICAL;SOFT;1;Connection
> refused
> [1169048695] SERVICE EVENT HANDLER:
> localhost;HTTP;CRITICAL;SOFT;1;restart-httpd
> [1169048755] SERVICE ALERT: localhost;HTTP;CRITICAL;SOFT;2;Connection
> refused
> [1169048755] SERVICE EVENT HANDLER:
> localhost;HTTP;CRITICAL;SOFT;2;restart-httpd
> [1169048815] SERVICE ALERT: localhost;HTTP;CRITICAL;HARD;3;Connection
> refused
> [1169048815] SERVICE NOTIFICATION:
> tformoso;localhost;HTTP;CRITICAL;notify-by-email;Connection refused
> [1169048815] SERVICE EVENT HANDLER:
> localhost;HTTP;CRITICAL;HARD;3;restart-httpd
> 
> I shut down the httpd - however the service did not restart auto - so
the
> handler is not working. Any thing I can try or did wrong?

The event handler _is_ being called ("SERVICE EVENT HANDLER"). If you're
using the example handler as is, it won't work. I'll bet you a free beer
that the nagios user does not have permission to restart httpd via the
init script. In cases such as this I use visudo to grant nagios
passwordless sudo access to the script and call it from the event
handler via 'sudo /etc/rc.d/init.d/httpd restart'.

--
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