plugins with rsh

Lacayo, Luis F lflacayo at cps.k12.il.us
Wed Jan 3 21:26:26 CET 2007


Try adding a second $ at the end of the command.

 

rsh $HOSTADDRESS$ 'mycommand; echo $$?'
 

 

Luis Lacayo

Sr. UNIX Admin

Chicago Public Schools

Office of Technology Services

125 S. Clark Street - Suite 300

Chicago, IL 60603

Direct:773-553-3835

Office: 773-553-1300

FAX:773-553-1363

lflacayo at cps.k12.il.us

________________________________

From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of dave
stern - e-mail.pluribus.unum
Sent: Wednesday, January 03, 2007 2:17 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] plugins with rsh

 

We have a legacy setup with tru64 hosts that are currently configured
for rsh, not ssh. I've installed the latest and greatest nagios on a
relatively 
recent fedora host and have used plugins with ssh in the past. The
problem is that rsh doesn't return status codes properly. Rather, it
returns 
only the status code of rsh itself, not the command. A search implies
you just need to echo $? with rsh.  

rsh linux to linux, I get this:

linux1> rsh linux1 'date ; echo $?'
Wed Jan  3 15:15:07 EST 2007 

and trying to generate an error:
linux1> rsh linux1 'bogus ; echo $?'
bogus; Command not found.
1

So that looks ok but first problem is when I put into nagios commands
define ....
   rsh $HOSTADDRESS$ 'mycommand; echo $?'
The web page show "(No output!)

Is it possible it swallows the quotes?

Further, rsh behaves differently on tru64:

linux1> rsh tru64-host 'date;echo $?' 
Variable syntax.

Any ideas for these problems? 

Thanks

and 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070103/7ad77150/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
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