event handlers on remote host

Capacci Thomas mrcapacci at free.fr
Wed Sep 22 15:49:49 CEST 2004


senthil a écrit :
> And one more help is it possible for some1 to help me
> with the process to setup non-interactive login in SSH ??
> 
> regards,
> Senthil
> 
> Demetri Mouratis wrote:
> 
>>On Wed, 22 Sep 2004, senthil wrote:
>>
>>  
>>
>>>Hi,
>>> I am currently working on using Nagios to monitor a remote host.
>>>Made use of the NRPE plugins to montior the different services on a
>>>remote host.
>>>I tried event handlers and it works fine in the localhost.But if I want
>>>to employ event handlers on a remote machine say to start a HTTP server
>>>when the service moves on to hard state ? what can i do??
>>>    
>>>
>>
>>Setup SSH to allow for non-interactive login to the remote machine and
>>restart the http daemon.
>>
>>You'll probably want to configure a way for the nagios user to restart
>>httpd.  Sudoers would help there.  Otherwise, you'll end up having to SSH
>>as root to restart it.
>>
>>Hope that helps.
>>---------------------------------------------------------------------
>>Demetri Mouratis
>>dmourati at linfactory.com
>>
>>
>>  
>>
> 
if you plain to use nagios with ssh, first install openssh and make 
connections with hosts to get their keys then connect on the server 
supporting nagios as nagios user
#su nagios
generate a couple of keys
#ssh-keygen -t rsa
find the key id_rsa.pub and rename it in authorized_keys and put this 
key on the host you want to monitorize in a nagios' folder (ie 
/home/nagios/.ssh permissions have to be set to 700) and casually you 
can chown to nagios the directories.
then for the event-handler you'll connect through sudo like this
/usr/bin/ssh nagios at hostname 'sudo  /etc/init.d/http restart'
of course this have to be in a script that will start according to some 
parameters.


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
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