Using SSH to run remote command checks
Robert Smith
lists at wansecurity.com
Fri Feb 16 18:22:30 CET 2007
Make sure that your SSHD allows the number of processes to be spawned
that you need.
I have:
MaxStartups 100
in my /etc/ssh/sshd_config which allows me to use my ssh gateway to
check up to 100 service concurrently with Nagios.
(you may need an updated version of openssh. get it from
ftp.openbsd.org/pub/OpenSSH/portable/)
I prefer to stay away from NRPE on unix systems.
Cheers,
-Robert Smith
Nagios Mail wrote:
> I wanted to update this problem as it appears to have never been
> resolved. The current version of check_by_ssh still returns an
> "UKNOWN" status in nagios. I have ran the command manually from the
> command line and echoed $?, and while it does return 0, nagios is
> putting in an UNKNOWN status. Not only that but the status appears to
> be flapping.
>
> The Critical and Warning status appear to work every time, but when an
> OK status is returned from one of the check programs (check_load,
> check_disk, check_process), check_by_ssh returns an UNKNOWN almost 80%
> of the time.
>
> I've followed up with three different people on this list who have
> reported the problem, and all of them just decided to move to NRPE.
>
> Has anyone gotten this plugin to work? I am assuming this is a code
> problem with check_by_ssh
>
>
>
> On 12/22/05, *Demetri Mouratis* <dmourati at cm.math.uiuc.edu
> <mailto:dmourati at cm.math.uiuc.edu>> wrote:
>
> On Thu, 22 Dec 2005, Mark.Law at thomson.com
> <mailto:Mark.Law at thomson.com> wrote:
>
> > I tested the following command from the command line ~
> >
> > /usr/bin/ssh -l nagios host1 chkAdminServer.pl
> >
> > and it returns OK with an exit code of 0. Great.
> >
> > When I put it into the following service definition, I get a Status
> > UNKNOWN with STATUS INFORMATION (No Output)
> >
> > define service{
> > name check_adminserver
> > service_description AdminServer
> > use hg.prod.check_5min
> > host host1,host2
> > contact_groups systemgrp
> > check_command
> > check_command_ssh!/path/to/perl/script/bin/chkAdminServer.pl!
> > }
> >
> > The check command definition is really simple also ~
> >
> > define command{
> > command_name check_command_ssh
> > command_line /usr/bin/ssh -l nagios $HOSTADDRESS$ $ARG1$
> > }
> If you are trying to ssh to another server and kick off the
> command there
> use check_by_ssh as follows:
>
> # check-remote-load
> define command{
> command_name check-remote-load
> command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C
> "$USER1$/check_load -w $ARG1$ -c $ARG2$"
> }
>
> In your example, put the chkAdminServer.pl scripts in the nagios
> plugins
> directory on the target, e.g. /usr/lib/nagios/plugins then set the
> $USER1$
> variable to the same. Then, su - nagios of your nagios box and
> ssh target
> /usr/lib/nagios/plugins/chkAdminServer.pl.
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through
> log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD
> SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> <http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click>
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> <mailto: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
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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