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
Tom_Lasswell
Posted 9 years ago·Last reply 1 year ago
14 comments
Shack
·5 years agoWe 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;
Tom_Lasswell
OP7 years agoHi 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!
lukem
·7 years agoHi 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?
Kris
·8 years agoThanks Andrey, I will be sure to check it out.
Andrey_Kitsen
·8 years agoHey @Kris welcome to the forum.
You will find Locator ID's being shared which can be used inside the LogicMonitor portal to find and import the modules. If you need any help figuring out how that all works, you can always reach out to the LM Support team and they can guide you if necessary.
Here's a page that can help get you started : https://www.logicmonitor.com/support/settings/logicmodules/lm-exchange/
Kris
·8 years agoHi All, I am new to the forum and LM and require some guidance on how to extract the multiple serials for a switch stack as per this thread. The screenshot above is exactly what I am looking for. Do you guys freely share the Groovy script code on this forum or was it posted on a different thread?
Regards,
Kris
Tom_Lasswell
OP8 years agoI 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.
phakesley
·1 year agoHi I am trying to acheive the same for customer stack switches. Is you property source available and if so could I have a copy to test on our dev platform.
Andrey_Kitsen
·8 years ago@Tom Lasswell great work on these btw.
@Brandon I've just created an internal ticket to get something similar to this into LM's official core repository.
Tom_Lasswell
OP8 years agoI haven't kept up on this thread for sure. :)/emoticons/smile@2x.png 2x" title=":)" width="20"> I do have some modifications to these but mostly there's some cleanup i need to do on some dupe properties that are created for testing purposes (to make sure numbers matched up). I'll see if i can get updated ones finished up this week as I also need to get this done for some of our CMDB efforts we're working on.
Brandon Woods
·8 years ago@Tom Lasswell - This is magnificent! I don't know why I never pulled this before, but I'm glad I did. Maybe someone at LM could be convinced to pull this into the official repository? Or even bake it into the core product! Definitely useful for us.
Todd_Theoret
·8 years agoTom, I just started taking advantage of PropertySources. I haven't solved the switch stack (models, sn#'s and firmware) yet. I came across this post. Any chance you got the Cisco-IOS working yet?
Thanks as always Tom.
Andrey_Kitsen
·8 years ago@Tom Lasswell I've split your contribution into this separate topic.