Commit 4f140f75 authored by Mac Newbold's avatar Mac Newbold

Make snmpit fail loudly when it can't get the vlan edit buffer. Usually this...

Make snmpit fail loudly when it can't get the vlan edit buffer. Usually this fails for one of three reasons: a) The community strings are wrong on the switch, b) some previous snmpit run left the buffer taken when it unexpectedly was killed, or c) someone else really is using the buffer.
parent cb33ff4c
......@@ -58,7 +58,7 @@ sub new {
return $obj;
}
my %cmdOIDs =
my %cmdOIDs =
(
"enable" => [".1.3.6.1.2.1.2.2.1.7","up"],
"disable"=> [".1.3.6.1.2.1.2.2.1.7","down"],
......@@ -144,6 +144,9 @@ sub vlanLock {
$RetVal = $sess->set([[$EditOp,1,"copy","INTEGER"]]);
print "Buffer Request Set gave ",(defined($RetVal)?$RetVal:"undef."),
"\n" if $verbose;
if (!defined($RetVal) || ! $RetVal) {
die("VLAN edit buffer request failed.\n");
}
$RetVal =
$sess->set([[$BufferOwner,1,substr(`/usr/bin/uname -n`,0,-1),"OCTETSTR"]]);
$RetVal = $sess->get([[$BufferOwner,1]]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment