Remote restart by ssh
Marc Powell
marc at ena.com
Tue Sep 8 16:08:22 CEST 2009
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
More information about the Users
mailing list