Remote restart by ssh

Alex Huth a.huth at tmr.net
Wed Sep 9 08:51:53 CEST 2009


We are doing already a lot of checks by ssh, but this will be the first one
with a event_handler. So it can't be a problem of the ssh keys. Also the
specified admin user can execute the script local on the host.

* Marc Powell schrieb:
> 
> On Sep 8, 2009, at 8:24 AM, Alex Huth wrote:
> 
> > Hi!
> >
> > I have a service on a remote machine which dies frequently. I want  
> > to restart
> > him by ssh. I followed the steps in the guide, but when i stop him  
> > nothing
> > happens.
> > That's what i have done so far:
> >
> > commands.cfg
> >
> > define command{
> > 	command_name	restart_saprouter
> > command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -t 175 -l admin -i
> > /adm/etc/nagios/id_nagios -C
> > 'usr/local/libexec/eventhandlers/restart_saprouter.sh $SERVICESTATE$
> > $SERVICESTATETYPE$ $SERVICEATTEMPT$'	
> > 	}
> 
> Did you set up authorized_keys for passwordless access? As the nagios  
> user, did you 'ssh -l admin <host_address>' and accept the key and  
> verify passwordless access? '<host_address>' must match the  
> host_address specified in the host{} definition.
> 
> > the eventhandler script on the remote machine:
> 
> >                        /etc/init.d/saprouter.sh restart
> 
> Does the 'admin' user have permission to run this script successfully?
> 
> --
> Marc
> 
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with 
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> 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
> 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
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