<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="Street"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="address"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Try adding a second $ at the end of the
command.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>rsh $HOSTADDRESS$ 'mycommand; echo $$?'<br>
</span></font><font size=2 color=navy face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:navy'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>Luis Lacayo<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>Sr. UNIX Admin<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 color=blue face="Times New Roman"><span
style='font-size:12.0pt;color:blue'>C</span></font><font color=navy><span
style='color:navy'>hicago </span></font><font color=blue><span
style='color:blue'>P</span></font><font color=navy><span style='color:navy'>ublic
</span></font><font color=blue><span style='color:blue'>S</span></font><font
color=navy><span style='color:navy'>chools<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>Office of Technology Services<o:p></o:p></span></font></p>

<p class=MsoNormal><u3:STREET u4:st="on"><u3:ADDRESS u4:st="on"><u1:Street u2:st="on"><u1:address style="BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x" tabIndex="0" u2:st="on"><st1:Street
w:st="on"><st1:address w:st="on"><font size=3 color=navy face="Times New Roman"><span
  style='font-size:12.0pt;color:navy'>125 S. Clark Street</span></font></st1:address></st1:Street></u1:address></u1:Street></u3:ADDRESS></u3:STREET><font
color=navy><span style='color:navy'> – <st1:address w:st="on"><st1:Street
 w:st="on"><u3:ADDRESS u4:st="on"><u3:STREET u4:st="on"><u1:address u2:st="on"><u1:address style="BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x" tabIndex="0" u2:st="on"><u1:Street u2:st="on">Suite</st1:Street></u1:Street></u1:address></u1:address></u3:STREET></u3:ADDRESS>
 300</st1:address><o:p></o:p></span></font></p>

<p class=MsoNormal><u3:PLACE u4:st="on"><u3:CITY u4:st="on"><u1:place u2:st="on"><u1:City u2:st="on"><st1:place
w:st="on"><st1:City w:st="on"><font size=3 color=navy face="Times New Roman"><span
  style='font-size:12.0pt;color:navy'>Chicago</span></font></st1:City></st1:place></u1:City></u1:place></u3:CITY><font
color=navy><span style='color:navy'>, <u3:STATE u4:st="on"><u1:State u2:st="on">IL</u1:State></u1:State></u3:STATE>
<u3:POSTALCODE u4:st="on"><u1:PostalCode u2:st="on">60603<o:p></o:p></span></font></u1:PostalCode></u1:PostalCode></u3:POSTALCODE></p>

<p class=MsoNormal></u3:PLACE><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>Direct:773-553-3835<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>Office: 773-553-1300<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>FAX:773-553-1363<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>lflacayo@cps.k12.il.us</span></font><o:p></o:p></p>

</div>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
nagios-users-bounces@lists.sourceforge.net
[mailto:nagios-users-bounces@lists.sourceforge.net] <b><span style='font-weight:
bold'>On Behalf Of </span></b>dave stern - e-mail.pluribus.unum<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, January 03, 2007
2:17 PM<br>
<b><span style='font-weight:bold'>To:</span></b>
nagios-users@lists.sourceforge.net<br>
<b><span style='font-weight:bold'>Subject:</span></b> [Nagios-users] plugins
with rsh</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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
<br>
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 <br>
only the status code of rsh itself, not the command. A search implies you just
need to echo $? with rsh.  <br>
<br>
rsh linux to linux, I get this:<br>
<br>
linux1> rsh linux1 'date ; echo $?'<br>
Wed Jan  3 15:15:07 EST 2007 <br>
<br>
and trying to generate an error:<br>
linux1> rsh linux1 'bogus ; echo $?'<br>
bogus; Command not found.<br>
1<br>
<br>
So that looks ok but first problem is when I put into nagios commands<br>
define ....<br>
   rsh $HOSTADDRESS$ 'mycommand; echo $?'<br>
The web page show "(No output!)<br>
<br>
Is it possible it swallows the quotes?<br>
<br>
Further, rsh behaves differently on tru64:<br>
<br>
linux1> rsh tru64-host 'date;echo $?' <br>
Variable syntax.<br>
<br>
Any ideas for these problems? <br>
<br>
Thanks<br>
<br>
and <o:p></o:p></span></font></p>

</div>

</body>

</html>