We have an issue with our Cisco ASR's. The entPhysicalEntry returns the main chassis SN along with all of the other installed modules SN's. The problem is that it's setting the SN of a module other than the main chassis. This then syncs back to our CMDB with the wrong SN.
Have any of you guys encountered this? The excerpt below is from a custom prop source we have but is also included in the main Device_BasicInfo prop source.
// entPhysicalEntry
def seenOidTypes = [];
def entWalk = Snmp.walk(hostname, ".1.3.6.1.2.1.47.1.1.1.1");
entWalk.split('\n').sort().each{
line ->
def ipNodeMatcher = line =~ /^\.1\.3\.6\.1\.2\.1\.47\.1\.1\.1\.1\.(?<oidType>\d+)\.(?<entPhysicalEntry>[\d\.]+) = (?<value>.+)$/;
if(!ipNodeMatcher.matches())
{
return;
}
// We have a match
def oidType = ipNodeMatcher.group('oidType');
def entPhysicalEntry = ipNodeMatcher.group('entPhysicalEntry');
def value = ipNodeMatcher.group('value');
// Only do this once per oidType
if(seenOidTypes.contains(oidType))
{
// Already seen
return;
}
// New one - add to seenOidTypes
seenOidTypes.push(oidType);
switch(oidType)
{
case "1":
println "entPhysicalIndex=${value}";
break;
case "2":
println "entPhysicalDescr=${value}";
break;
case "3":
println "entPhysicalVendorType=${value}";
break;
case "4":
println "entPhysicalContainedIn=${value}";
break;
case "5":
println "entPhysicalClass=${value}";
break;
case "6":
println "entPhysicalParentRelPos=${value}";
break;
case "7":
println "entPhysicalName=${value}";
break;
case "8":
println "entPhysicalHardwareRev=${value}";
break;
case "9":
println "entPhysicalFirmwareRev=${value}";
break;
case "10":
println "entPhysicalSoftwareRev=${value}";
break;
case "11":
println "cmdb.serialnumber=${value}";
break;
case "12":
println "entPhysicalMfgName=${value}";
if(manufacturer == "")
{
manufacturer = value;
}
break;
case "13":
//println "entPhysicalModelName=${value}";
println "cmdb.model=${value}";
break;
case "14":
println "entPhysicalAlias=${value}";
break;
case "15":
println "entPhysicalAssetID=${value}";
break;
case "16":
println "entPhysicalIsFRU=${value}";
break;
case "17":
println "entPhysicalMfgDate=${value}";
break;
case "18":
println "entPhysicalUris=${value}";
break;
default:
// Ignore
break;