Paul - Karavelov's answer did not work. I wish I knew why. As I said, this shouldn't be that difficult. I can see that all of my commands are being input by viewing the input and output logs. Their contents are as such:

INPUT
User Access Verification

Username: Cisco
Password:
DistrictOffice#copy tftp start
Address or name of remote host []? 172.16.0.100
Source filename []? ACES.cfg
Destination filename startup-config? startup-config
Accessing tftp://172.16.0.100/ACES.cfg...
Loading ACES.cfg from 172.16.0.100 (via
GigabitEthernet0/1): !!
OK - 6231 bytes
OK
6231 bytes copied in 9.320 secs (669 bytes/sec)
DistrictOffice#

OUTPUT
Cisco
Cisco
copy tftp start
172.16.0.100
ACES.cfg
startup-config
reload

The fact that my final 'reload' command shows up in my output log and not my input log tells me that the 9 or 10s time for the tftp file to download is where this is breaking. I entered a Prompt variable, but I shouldn't have to since Net::Telnet::Cisco already recognizes most prompts. I also have always_waitfor_prompt, but I'm not sure I've specified it correctly. In other words, is the syntax $session->always_waitfor_prompt all that is necessary?

Current code:
my $session = Net::Telnet::Cisco->new( Host => $switch, Prompt => '/.*#/', Input_log => "input.log", Output_log => "output.log", Timeout => 30); $session->always_waitfor_prompt; # Wait for the username prompt and enter username @out = $session->waitfor('/Username:.*$/'); print "@out\n"; @out = $session->print($user); print "@out\n"; # Wait for the password prompt and enter the password @out = $session->waitfor('/Password:.*$/'); print "@out\n"; @out = $session->print($password); print "@out\n"; @out = $session->cmd("copy tftp start\n$tftp_server\n$config_file\n$de +st_file\n"); print "@out\n"; @out = $session->cmd("reload\n\n"); print "@out\n"; @out = $session->close;
Regards, Scott

In reply to Re^2: Net Telnet Cisco by spickles
in thread Net Telnet Cisco by spickles

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.