I am trying to use net::snmp to send a request to a cisco router to have the device tftp is current running config to a remote tftpserver.
I am familiar with the command set for snmpset, and specifically for this use. It is as follows:

snmpset <router> <RW Community String> .1.3.6.1.4.1.9.2.1.55.<tftp +server ip> string <filename>

However, the net::snmp syntax is throwing me a bit. I am not quite certain where to stuff all of the apparent info that snmpset seems to require.

$where = "10.6.21.100 string $tftpfile"; @param = qw($oid SET_REQUEST $where); ($session, $error) = Net::SNMP->session( -hostname => $router -community => $community ); my $response = $session->set_request(@param);

My questions is concerning the @param list. The net::snmp doc shows:

$response = $session->set_request(@oid_type_value);

the oid, i have, but the ASN.1 value for the type field, I am not too clear on, nor the value that I will be sending. I want to say that the "value" field corresponds to the:

<tftp server ip> string <filename>

portion of the snmpset command, however I am not sure how to stuff all of that into a single list value. Plus, near the end of the net::snmp doc, it lists the acceptable "types". I see SET_REQUEST among the EXPORTABLE list, but I am not sure if this is what I want to use or whether or not its ready to use without additional configuration. Your help is appreciated.

humbly -c


In reply to copy run tftp on cisco router using net::snmp by c

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.