Perl EVENT HANDLER SSH Remote Command Exection

John P. Rouillard rouilj+nagiosdev at cs.umb.edu
Wed Nov 26 22:19:43 CET 2008


In message <5a69da6f0811261246s23e458a6m4d953180daf2c7dd at mail.gmail.com>,
Jason writes:
>Ok, I've re-tooled, using more simplified logic for the purpose of testing
>the SSH connection. The script now has no logic, it just attempts to ssh to
>the remote host and run /usr/bin/uname -a.
>I've also explicitly defined my SSH key.
>
>As before, the script works perfectly when run manually as nagios user via
>the command line, but fails at the SSH call when executed via event handler
>from the nagios daemon.

Are you running it via env(1) to nuke any environment variables that
may carry over into the nagios environment when you run it manually?

>I'm beginning to wonder if Nagios & Net::SSH::Perl simply do not play nice
>with each other.

Well maybe. What does Net::SSH::Perl have to say about running without
a tty?

Maybe schedule an at(1) job to run the script as nagios with
debugging/tracing turned on (perl -d scriptname with AutoTrace set in
PERLDB_OPTS, man perldebug) and see if that works/fails?

--
				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/




More information about the Developers mailing list