tommycahir has asked for the wisdom of the Perl Monks concerning the following question:
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.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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multiple set_requests snmp/perl
by Limbic~Region (Chancellor) on Mar 03, 2004 at 17:39 UTC | |
by tommycahir (Acolyte) on Mar 03, 2004 at 17:56 UTC | |
by Limbic~Region (Chancellor) on Mar 03, 2004 at 18:07 UTC | |
by tommycahir (Acolyte) on Mar 03, 2004 at 18:46 UTC | |
by tommycahir (Acolyte) on Mar 03, 2004 at 18:20 UTC | |
by Limbic~Region (Chancellor) on Mar 03, 2004 at 18:23 UTC | |
| |
|
Re: multiple set_requests snmp/perl
by NetWallah (Canon) on Mar 03, 2004 at 19:38 UTC | |
by tommycahir (Acolyte) on Mar 08, 2004 at 14:41 UTC |