Problems with restarting service
Jason Martin
jhmartin at toger.us
Tue Feb 3 00:54:09 CET 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
A nagios event handler can do anything you want; with nrpe you'd have to
write a nrpe 'check' that actually bounces the service.
- -Jason Martin
On Mon, 2 Feb
2004, Neil wrote:
> This is very interesting. I thought, Nagios only do monitoring. Is it true
> that nagios can restart a service using event handlers? What about services
> on remote like Windows using NRPE?
>
> Thanks.
>
>
> Chris Mason writes:
>
> > I have a server on which I am running nagios and a service similar to httpd.
> >
> > I want to restart the service should it stop responding.
> >
> > As a test, I have used httpd.
> >
> > Nagios is configured as follows:
> > /etc/nagios/services.cfg
> >
> > ...
> > check_command check_http
> > event_handler restart-httpd
> > ...
> >
> > /etc/nagios/checkcommands.cfg
> > ...
> > # 'check_http' command definition
> > define command{
> > command_name check_http
> > command_line $USER1$/check_http -H $HOSTADDRESS$
> > }
> > ...
> >
> > /usr/lib/nagios/plugins/eventhandlers/restart_httpd
> > ...
> > # Call the init script to restart the HTTPD server
> > sudo /etc/init.d/httpd restart
> > ...
> >
> > I have sudo'ed the nagios user "nagios" as follows
> > # Cmnd alias specification
> > Cmnd_Alias HTTP = /etc/rc.d/init.d/httpd restart
> >
> > NAGUSERS localhost=NOPASSWD: HTTP
> >
> > If I su to nagios, I can execute the restart.
> >
> > Nagios tries to execute it, but the message is:
> > Feb 2 13:22:38 slimp3server sudo(pam_unix)[15754]: authentication failure;
> > logname= uid=0 euid=0 tty= ruser= rhost= user=nagios
> >
> > And the command is not executed.
> >
> > Any ideas?
> >
> >
> >
> >
> >
> >
> >
> > Chris Mason
> > masonc at masonc.com
> > Box 340, The Valley, Anguilla, British West Indies
> > Yahoo IM: netconcepts_anguilla at yahoo.com
> > 264 497-5670 Fax: 264 497-8463
> > www.netconcepts.ai
> >
> >
> >
> > -------------------------------------------------------
> > The SF.Net email is sponsored by EclipseCon 2004
> > Premiere Conference on Open Tools Development and Integration
> > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> > http://www.eclipsecon.org/osdn
> > _______________________________________________
> > 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
>
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> 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
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.3 (GNU/Linux)
Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/
iD8DBQFAHuMql2ODWuqVSBMRAtMGAKCFMpHCVqGHwEAdlyjMXZj+0fT6MwCeNxVn
lF0dr0GjpZAcJkJsRt5ixNQ=
=x/LS
-----END PGP SIGNATURE-----
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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