good thought on perms - i double checked and i'm running as nagios so all good there ...<br><br>marcel i think you are right, my match condition is just wrong for some reason ... <br><br>when i change the while loop to:
<br><br>while (<SSH>){<br>next if /^Trying/;<br>next if /^Connected/;<br>if ($_ =~ /Escape/) {<br>    print "success $_";<br>    exit($ERRORS{'OK'});<br>}<br>else {<br>    print "Connect died at: $_";
<br>    exit($ERRORS{'CRITICAL'});<br>}<br><br>this works and nagios reports OK. <br><br>but if i let it get to that last line, which is the 220 line, it won't match. i'm guessing this is something to do with how the while loop handles the last line of input and places it into $_ 
<br><br>but i don't get why nagios doens't see it and command line works ...<br><br>i'll keep trying and if anyone spots it please let me know!<br><br>august<br><br><br><br><div><span class="gmail_quote">On 9/5/07, 
<b class="gmail_sendername">Marcel Mitsuto Fucatu Sugano</b> <<a href="mailto:msugano@uolinc.com">msugano@uolinc.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Comments inline:<br><br>On Wed, 2007-09-05 at 08:48 +1000, August Simonelli wrote:<br>><br>><br>> but when all those conditions ARE met nagios always makes it right<br>> past<br>><br>>         if ($_ =~ /^220/) {
<br>>             print "$_ this works";<br>>             exit($ERRORS{'OK'});<br>><br>> and gives me<br>><br>> print "fell thru";<br>> exit($ERRORS{'WARNING'});<br>
><br>> printing out $_ in the while loop has the expected 220 line ...<br>><br><br>Probably, telnet responds something different that the regexp match<br>expects, like "\r220: (...)", so if 220 is the OK condition, try
<br>removing the leading "^", and you're done.<br><br>HTH<br><br><br>AVISO: A informação contida neste e-mail, bem como em qualquer de seus anexos, é CONFIDENCIAL e destinada ao uso exclusivo do(s) destinatário(s) acima referido(s), podendo conter informações sigilosas e/ou legalmente protegidas. Caso você não seja o destinatário desta mensagem, informamos que qualquer divulgação, distribuição ou cópia deste e-mail e/ou de qualquer de seus anexos é absolutamente proibida. Solicitamos que o remetente seja comunicado imediatamente, respondendo esta mensagem, e que o original desta mensagem e de seus anexos, bem como toda e qualquer cópia e/ou impressão realizada a partir destes, sejam permanentemente apagados e/ou destruídos. Informações adicionais sobre nossa empresa podem ser obtidas no site 
<a href="http://sobre.uol.com.br/">http://sobre.uol.com.br/</a>.<br><br>NOTICE: The information contained in this e-mail and any attachments thereto is CONFIDENTIAL and is intended only for use by the recipient named herein and may contain legally privileged and/or secret information. If you are not the e-mail´s intended recipient, you are hereby notified that any dissemination, distribution or copy of this e-mail, and/or any attachments thereto, is strictly prohibited. Please immediately notify the sender replying to the above mentioned e-mail address, and permanently delete and/or destroy the original and any copy of this e-mail and/or its attachments, as well as any printout thereof. Additional information about our company may be obtained through the site 
<a href="http://www.uol.com.br/ir/">http://www.uol.com.br/ir/</a>.<br></blockquote></div><br>