hi all i new to perl and snmp so this prob only a simple thing but itrying to set 4 different values in the mib but all that is ever set is the sysname value could somebody please help as this is starting to drive me even m ore nuts than i already am.!
use strict; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use Socket; use Net::SNMP; #Net::snmp 5.1 my $snmp_version = '2c'; my $snmp_port = 161; my $host = ***.***.***.*; #passed from form my $community = *****; #passed from form my ( $snmp_session, $snmp_error ) = Net::session( -hostname => $snmp_host, -community => $snmp_community, -version => $snmp_version, -port => $snmp_port, -debug => 0 ); my $newname = param('Device Name'); my $newdescription = param('Description'); my $newlocation = param('location'); my $newcontact = param('Contact'); my $sysname = '1.3.6.1.2.1.1.5.0'; my $sysDescr= '1.3.6.1.2.1.1.1.0'; my $sysContact= '1.3.6.1.2.1.1.4.0'; my $sysLocation = '1.3.6.1.2.1.1.6.0'; my $result = $snmp_session->set_request(-varbindlist => [$sysN +ame, OCTET_STRING, $newname, $sysDescr, + OCTET_STRING, $newdescription, $sysLocati +on, OCTET_STRING, $newlocation, $sysContac +t, OCTET_STRING, $newcontact]); $result or warn "error: @{[$snmp_session->error]}\n";
where the snmp_session is correctly set up(as i had queried the data already)and all the params are correctly passed from the form.

In reply to multiple set_requests snmp/perl by tommycahir

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.