SSH Performance Problem AKA "unknown" state

Schindewolf, Stefan, Infraserv-Hoechst/DE Stefan.Schindewolf at Infraserv.com
Mon Apr 28 09:27:02 CEST 2003


Hello.

Some people on the list (including me) had problems using ssh or
check_by_ssh instead of NRPE.
The disadvantage of NRPE is, that you would have to compile it and role it
out to every client. Additionaly, until release 2.0 it could not use
encryption.

As we have already established public key authentification over the whole
site, it is far more easy to just execute the checks over ssh.
The problem that occured, was that about 20 -25 checks of our 200 went into
status "unknown", although they should display "OK" or "Warning", etc.. .
The first thing we tried was writing a perl script, "wrapping" the ssh
checks. We assumed, that the problem was with nagios itself. We also tried
tuning nagios parameters (reaper frequency, e.g.).

All these steps did not lead to success and we accepted the fact, that ssh
is a hell of a bad check executor.
Until my colleague wrote this shell script.

****************************************************************************
*****************************************
#!/bin/bash
/usr/local/nagios/libexec/check_by_ssh -t 3000 -H 10.200.3.25 -C "plz insert
check here" > /tmp/out$1
cat /tmp/out$1
stati=`grep warning /tmp/out$1|wc -l`
if [ $stati -eq 1 ]
	then  exit 1
fi
stati=`grep critical /tmp/out$1|wc -l`
if [ $stati -eq 1 ]
	then  exit 2
fi
exit 0
****************************************************************************
*****************************************
What it does is, grepping the text message from the service check (e.g.
"Warning: No TNS Listener on Host XXX") and creating the correct exit code.
The return code from ssh is totally ignored. Obviously, this won´t work if
your check program returns a message without an error string in it (e.g. "No
TNS Listener on Host XXX".

The problem seems to be with openssh, which, when executed by nagios,
returns strange states and otherwise (in a shell as user nagios) returns a
"correct" state.
Since we implemented this script, we received none of the strange "unknown"
states. The few checks we have not migrated yet, sometimes return "unknown".
They will also be migrated soon.
We tested this solution over several days, so this should be a quit reliable
one.

We hope that it will help you work around your problems.

	With best regards

	Stefan Schindewolf

	Infraserv GmbH & Co Höchst KG
	Service Center Informationstechnologie
	D710, D-65926 Frankfurt
	Telefon: (069)305 - 43870
	Fax: (069)305 - 23549
	Mail: stefan.schindewolf at infraserv.com


> Mit freundlichen Grüßen
> 
> Stefan Schindewolf
> 
> Infraserv GmbH & Co Höchst KG
> Service Center Informationstechnologie
> D710, D-65926 Frankfurt
> Telefon: (069)305 - 43870
> Fax: (069)305 - 23549
> Mail: stefan.schindewolf at infraserv.com
> 
> 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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