Hello-

I have 300 + cisco 4948 IOS switches that require new code tftp'd to them. I have been trying to use net::appliance::session for this. I am able to login to the device and send 'copy tftp bootflash:" and get the next prompt. But it never fills in 10.148.48.52. I read several posts regarding custom cmd using String and Match but I can't figure it out. Here is what I'm using:

my $session_obj = Net::Appliance::Session->new( Host => "swi-87", Platform => 'IOS' Transport => 'SSH', ); $session_obj->connect( Name => $userinfo[0], Password => $userinfo[1], SHKC => 0 ); $session_obj->input_log(*STDOUT); $session_obj->begin_privileged($userinfo[1]); $session_obj->cmd("copy tftp bootflash:"); $session_obj->cmd('10.148.48.52'); $session_obj->cmd("cat4500-ipbasek9-mz.122-31.SGA9.bin"); $session_obj->close;

Can anyone provide an example? Here are the prompts the switch provides:

swi-87#copy tftp bootflash: Address or name of remote host []? 10.10.10.10 Source filename []? cat4500-ipbasek9-mz.122-31.SGA9.bin Destination filename [cat4500-ipbasek9-mz.122-31.SGA9.bin]?

I am able to capture the running config, set config-register.....using the module. I just can't get past the above prompts. I appreciate any assistance. Thanks


In reply to net:appliance::session copy tftp bootflash: by boatperl

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.