Forum Discussion

Tom_Lasswell's avatar
8 years ago

Cisco Info PropertySources

This one goes into some additional detail but hasn't been completely cleaned up for debugging purposes.

The ones that have switch stacks pull all the stack serials and model numbers. Work in progress was the versioning. We have about 1500+ network devices across many many different models and versions so this has taken a little bit of work to get to work across all. 

MWXMXZ - Cisco-IOS

FKA79M - Cisco IOS XE

9LF63N - NXOS

G366DD - Cisco ASA

  • On 30/01/2018 at 6:21 PM, Tom Lasswell said:

    I did something very similar @Brandon, trying to get the detail around each stack to be utilized in our CMBD. Need to get this out at some point :)/emoticons/smile@2x.png 2x" title=":)" width="20"> I used two methods to display it, one is for each for the number of switches individually and then one comma seperated with the switch deliminator at the beginning. 

    Hi Tom, 

    I am new to LM and would like to do exactly that. Did you share a locator code for this or are you happy to share the code?

  • On 1/14/2019 at 6:11 AM, lukem@itgl.com said:

    Hi Tom, 

    I am new to LM and would like to do exactly that. Did you share a locator code for this or are you happy to share the code?

     

    Hi there, I've moved on to another company and don't have access to this anymore, but it was some additional information in the groovy script that just each time it iterated through the serial numbers it added additional properties. A crash course in groovy is going to be very helpful for you being new to LM! 

  • 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;