snmp set method does not return a value as get does
"Dreas, Kyle" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <FA51991171CA534FB23F0F28F50414D30254F51C@COENGEXCMB01.cable.comcast.com> |
Here is an example of an SNMP set that is don to reboot a specified
device.
my $cmreset_oid = ".1.3.6.1.2.1.69.1.1.3";
my $set = new SNMP::Varbind([$cmreset_oid,0,1,"INTEGER"]);
my $sess=new SNMP::Session(DestHost=>$cmip,
Community=>$cmstring,
Version=>2,
Timeout=>1000000,
Retries=>2);
my $reset=$sess->set($set);
This example performs a get on the Time of Day from a specified device.
my $tod_oid=".1.3.6.1.2.1.69.1.1.2.0";
my $get = new SNMP::Varbind[($tod_oid)];
my $sess = new SNMP::Session(DestHost=>$cmip,
Community=>$cmstring,
Version=>2,
Timeout=>1000000,
UseSprintValue=>1,
Retries=>2);
my $cmtod=$sess->get($get);
If I print out the value of $reset it is NULL. I am used to running
this via:
snmpset -v2c -r1 -c <community> <ipaddress> <reset oid> i 1
When processed by the device the statement above returns the status of
the snmpset to STDIO. when using the traditional snmpset syntax within
a perl script I am then able to capture that value and process to
determine if the reset was successful or if some error occurred. How do
I retrieve the response from SNMP Set using the method above?
Kyle
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users