Closed netdisco-automation closed 7 years ago
patch
Original comment by: bbaetz
Original comment by: maxslug-placeholder
Logged In: YES user_id=19674
I modified L2 and L3 to check for this OID in serial().
Thanks!
Original comment by: maxslug-placeholder
Original comment by: bbaetz
Logged In: YES user_id=495627
# precedence # serial2,chassis parse,serial1 return if (defined $chassis and $chassis =~ /serial#?:\s*([a-z0-9]+)/i); return $serial2 if (defined $serial2 and $serial2 !~ /^\s*$/); return $serial1 if (defined $serial1 and $serial1 !~ /^\s*$/);
The comment doesn't match the actual ordering (Layer2.pm and Layer3.pm) Also, I have some cisco devices which report a serial number of 0 via the chassis display and a blank string in the entity MIB, due to an IOS bug. Since 0 probably isn't valid, and is displayed as 'Unknown' in the UI anyway, should those bits also check that the number isn't blank/0?
Original comment by: bbaetz
Logged In: YES user_id=19674
Oops, Yeah, I changed my mind as I was testing the code and swapped the order from my initial comments. Thanks for catching that.
Is having the Serial Number an important bit of data for you/others? I was letting whatever got spit back at me be recorded because I figued that the data falled under the catagory of "nicety" and not critical.
The OID you sent me is a field that by default is the serial number, but can be overwritten with a human entry. The MIB describes it as :
"Unique ID string. Defaults to chassis serial number if available, otherwise empty. Can also be set with 'snmp-server chassis-id'."
On a lot of my devices I'm getting back weird human-entries that are being stored into the "serial" field, but I wasn't really worrying about it, since I figured most people don't even use the field.
Do you think I should be more careful about it? -m
Original comment by: maxslug-placeholder
Logged In: YES user_id=495627
Its not really important, I think. Its just nice, and if its polling for it anyway, it may as well get that right.
I'm happy for the OLD-CHASSIS-MIB to be last on the list, because of that.
Original comment by: bbaetz
Original comment by: maxslug-placeholder
See the attached patch. The switches I have access to are using an older IOS version, so only support the OLD-CISCO-CHASSIS MIB.
I assume that newer systems have the ENTITY-MIB, but can't check that. Something similar to the Layer3.pm serial access may be needed.
The layer3 devices I have mostly support getting the serial number from the ENTITY-MIB.
Reported by: bbaetz
Original Ticket: snmp-info/patches/2