Tom Lasswell

Cisco Info PropertySources

Recommended Posts

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

Edited by Tom Lasswell
  • Upvote 2

Share this post


Link to post
Share on other sites
On 6/28/2017 at 0:30 PM, Tom Lasswell said:

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 I've split your contribution into this separate topic. 

Share this post


Link to post
Share on other sites

Tom, 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.

Share this post


Link to post
Share on other sites

@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.

Share this post


Link to post
Share on other sites

I haven't kept up on this thread for sure. :) 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. 

Share this post


Link to post
Share on other sites

@Tom Lasswell I noticed it wasn't pulling anything for switch stacks so I modified it a bit to get around that.  Of course, this will only show the data for the stack master, but it can definitely still be useful.  I know there's a separate datasource that pulls the data for all the units in each stack, but oh well - better to have it twice than not at all!

 

import com.santaba.agent.groovyapi.snmp.Snmp;

// set hostname variable.
def hostname = hostProps.get("system.hostname")

// Wrap code in try/catch in case execution experiences an error.
try
{
    // OID which contains the serial number of Cisco devices.
    def entPhysicalSerialNum = "1.3.6.1.2.1.47.1.1.1.1.11.1"
    
    // Initiate SNMP GET command.
    def output = Snmp.get(hostname, entPhysicalSerialNum);
  	
  // Null response could mean switch stack.
    if (output == null)
        try
        {
            def entPhysicalSerialNum2 = "1.3.6.1.2.1.47.1.1.1.1.11.1001"
            def output2 = Snmp.get(hostname, entPhysicalSerialNum)
            println "auto.Cisco_Serial_Number=" + output2
        }
        catch (Exception e)
        {
            // print out the exception.
            println e;
            return 1;
        }
    // Print out the serial number.
    println "auto.Cisco_Serial_Number=" + output
}

// Catch the exception.
catch (Exception e)
{
    // print out the exception.
    println e;
    return 1;
}

// exit code 0
return 0;

 

Share this post


Link to post
Share on other sites

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 :) 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. 

image.png.095ef180704ea797775c7c3835714f06.png

Share this post


Link to post
Share on other sites

Hi 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

Share this post


Link to post
Share on other sites
10 hours ago, Kris said:

Hi 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

 

Hey @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/

Edited by Andrey Kitsen
- added get started link

Share this post


Link to post
Share on other sites
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 :) 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. 

image.png.095ef180704ea797775c7c3835714f06.png

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?

Share this post


Link to post
Share on other sites
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! 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now