[Nagiosplug-devel] check_by_ssh return code

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Thu Feb 12 12:34:14 CET 2004


On Thu, Feb 12, 2004 at 08:38:06AM -0800, debby_ar at yahoo.com wrote:
> I have been getting inconsistent results running the
> 1.3.1 version of check_by_ssh.  When I run the plugin
> manually, it consistently works, but when it is run by
> nagios, the exit code is frequently wrong.  Digging
> deeper, I find that the spclose call sometimes returns
> the expected value, but frequently is returning 255
> instead.  (Not always, but often.)
>

'secure pclose' reporting that the child process (running the ssh
client) did not exit cleanly is not good.

I have found check_by_ssh to be  sensitive to how the system handles
open file descriptors on fork (FreeBSD changed this in one of the 4.x
RELEASES and check_by_ssh would do something similar to what you
report: WARNING exit code byt output OK. This was ultimately fixed by a
patch to Nag.)

 
> In all cases, the actual output of the plugin on
> stdout is correct.
>
 
> I have tried various things without any success, and
> the only solution I can find is to change check_by_ssh
> to ignore the return value from spclose and parse the
> output instead.  This will work for my case, but
> assumes that check_by_ssh knows something about the
> format of the output.
> 
> Is there an alternative solution?
>

It would be worth trying the latest 1.4aplha1 plugin release from
SourceForge in case the problem has been fixed.

Good luck.

Yours sincerely.
 

-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.




More information about the Devel mailing list