HowTo check_by_ssh ?

Demetri Mouratis dmourati at cm.math.uiuc.edu
Thu Nov 14 17:20:58 CET 2002


On Thu, 14 Nov 2002, Florian Schie?l wrote:

> Hi all !
>
> I'm trying to check local_load und local_user on a remote machine using
> check_by_ssh.
>
> But all my tries didn't succeed. I looked for Docs but can't find some
> :-(
>
> Can someone give me a step-by-step HowTo to implement these feature?
>
> Nagios is running on one machine, on the other are only the plugins
> installed.
>
>
> Would be very nice ;-)
>
> Thx
>
> Florian

The first thing you need to do is install all the plugins you want to
check on your remote hosts.  I normally copy /usr/local/nagios/libexec to
/home/nagios/bin.

Next, you need to setup passwordless authentication.  You generate a
keypair with ssh-keyget -t dsa on your nagios box as the nagios user.  You
can either use a null passphrase or use a real passphrase and use a
utility like keychain to have a persistent ssh-agent session running for
nagios.

After you generate your key, copy the id_dsa.pub file from
/home/nagios/.ssh/ over to /home/nagios/.ssh/authorized_keys2 on your
remote hosts.  You should now be able to give the following command and
login from the nagios box to your remote host without a password:

nagios at nagios$ ssh -l nagios remotehost

Now all you need to do is setup check_by_ssh commands in your
services.cfg and checkcommands.cfg.

Here's a line from my services.cfg:
check_command                   check_remote_load!5,5,5!10,10,10

and the corresponding line in checkcommands.cfg:
command_line    $USER1$/check_by_ssh -H $HOSTADDRESS$ -l nagios -i $USER5$
-C "$USER6$/check_load -w $ARG1$ -c $ARG2$"

I've defined $USER5$ as /home/nagioas/.ssh/id_dsa and $USER6$ as
/home/nagios/bin in resource.cfg.

Hope that helps.

---------------------------------------------------------------------
Demetri Mouratis
dmourati at linfactory.com



-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html




More information about the Users mailing list