I am trying to access multiple clients with my script using Net::Telent. I want to search a bunch of files and look for a specific string. My problem is Net::Telent is returning the error  timed-out waiting for command prompt at findHost.pl line 25 That is the line where I try to login. When I use telnet manually I can get into the machines, I also am pretty sure I have the regexp for the Prompt variable correct. If anyone can provide a little wisdom into my problem I would be grateful. here is the code in question...
#!/usr/local/bin/perl -w use strict; use Net::Telnet (); #get the contents of the array from mike. my (@files, $t, @hosts, $result,$cpu); $hosts[0]="aster"; $hosts[1]="candytuft"; my $username="user"; my $password="pass"; foreach $cpu (@hosts) { #use the net telnet module here. $t = new Net::Telnet (Timeout => '30', Prompt => '/[%#>] $/', host=>$cpu); print " $cpu \n"; $t->login($username, $password); $t->cmd("cd /usr/openv"); print $t->cmd("usr/bin/ls"); @files = $t->cmd("find . -type f -print | xargs grep \"domain. +com\" /dev/null"); print "-------------\n"; print "Results for $cpu\n"; print "-------------\n"; my $loc; foreach $loc (@files) { print "-- $loc\n"; } my $tmp = $t->dump_log(); print "This is the dump_log \n$tmp \n"; print "\n\n"; }
Thanks agian Josh

In reply to problems with Net::Telnet (i think) by krujos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.