in reply to Where is the bug in this Net::SNMP code?
First, the good news. You've got lots of error checking there and die statements to protect you from bad coding. Well done, I can only encourage this!
The bad news: you do a getnext on sysName. Thus I presume you will get sysName.0 because all scalar SNMP objects (ie objects that are NOT columnar), by definition, have a trailing .0 in the object identifier.
However, assuming sysName is a columnar object, you still have problems because you're assuming that the sysName column is in the same table as the prtCoverStatus. And they clearly are NOT in the same table because their OIDs (object identifiers) are different lengths let alone in different parts of the address space.
I could be wrong, however. Maybe the sysName object is in a table with an index of type OCTET STRING. So you're trying to capture the name of a device from the table the sysName object is in and then look in the table the prtCoverStatus object is in that is presumably indexed by device name as an OCTET STRING too???
Can you see that you need to assist us by describing a) what is your objective and b) how, specifically, is this failing?
Lastly - the last line of your script closes your SNMP object after it first discovers an answer. Is this what you mean to do? Or do you mean to close the SNMP object AFTER polling ALL devices?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Where is the bug in this Net::SNMP code?
by tolyan77 (Novice) on Oct 10, 2006 at 08:42 UTC | |
|
Re^2: Where is the bug in this Net::SNMP code?
by tolyan77 (Novice) on Oct 10, 2006 at 10:13 UTC | |
by monarch (Priest) on Oct 10, 2006 at 11:52 UTC | |
by tolyan77 (Novice) on Oct 10, 2006 at 12:09 UTC | |
by tolyan77 (Novice) on Nov 04, 2006 at 12:19 UTC |