CiscoAnyConnect Active Sessions
Datasource to monitor active SSL Cisco AnyConnect sessions on a Cisco ASA
LM Exchange Locator: RWLRW2
sawyer_lef
27 comments
Datasource to monitor active SSL Cisco AnyConnect sessions on a Cisco ASA
LM Exchange Locator: RWLRW2
The_Other_Josh
There is already a global stats datasource from LogicMonitor repo called 'CiscoASA' displayed as 'Global PIX/ASA Stats' (Published with lmLocator: 3XDXDM). It has numSessions (aggregate over all types) but does not including webvpn and SVC directly. I submitted feedback request, but you can add those datapoints to the existing datasource using the OIDs that you identified.
LM User
I'm finally taking a look at this and I think there is some confusion about multi-instance, discovery, and polling. I don't think this datasource should be multi-instance, which means there should be no active-discovery configuration at all.
To answer the question "should this be multi-instance?", ask yourself this: "Are there multiple objects on this one device for which I want to gather the same metric?" For example, "Are there multiple interfaces on this device for which I want to gather inbound discards?" In this case, I can see that we're trying to gather the count of active sessions. That's the metric. But what would the objects be? It doesn't seem to me that there are because this is likely a single metric pertaining to the device itself. I'm now going to go on a tangent and explain how to do active discovery for multiple instances. If you're not interested (because this DS probably isn't multi-instance), skip to the bottom.
If there were multiple objects on this device that each had their own count of active sessions, then we would select the "multi-instance" option in the datasource. After selecting this, we'd need to figure out a way to create those instances, either manually or through active discovery. If using active discovery, we need to find a MIB table containing a listing of these objects. There are two main ways that active discovery can create the instances based on data in the MIB table: 1) value and 2) wildcard. Understand this before we proceed, in order for LM to create instances, it needs a minimum of two pieces of data: 1) a unique identifier for the object (called WILDVALUE) in LM and 2) a display name for the object (called WILDALIAS) in LM.
VALUE BASED DISCOVERY TYPE
That MIB table would have an index column and hopefully a column that provides some sort of display name for the objects. If it does have a column that you want to use for the display name of each object, you can use "Value" based discovery. For example, the ifEntry MIB table located at 1.3.6.1.2.1.2.2.1 has a column called ifDescr (1.3.6.1.2.1.2.2.1.2). If I wanted to gather statistics for each interface on a device, I would check the "multi-instance" box and enable "active discovery". I would select "value" as the discovery type and provide "1.3.6.1.2.1.2.2.1.2" (a single column/leaf in the MIB table). LM would do an snmpwalk of that OID and use the results to create the instances in LM. Let's see what the walk results look like so we can see what "value" does:
As you can see, since we did an SNMP Walk (not a get/getbulk), we got two pieces of information back for each interface on the device. The first is the index of the object, a good candidate for use as the unique identifier or WILDVALUE. The second piece of data is the ifDescr we asked for and is a good candidate for use as the display name or WILDALIAS of the instance in LM. Since we've chosen "VALUE" as the discovery type, LM will use the index (left column) as the WILDVALUE and the ifDescr (right column) as the WILDALIAS.
WILDCARD BASED DISCOVERY TYPE
If the table you're looking to gather stats from doesn't have a good column from which we can pull a display name, we still have to have a display name. For example, let's look at the hrProcessorEntry table at 1.3.6.1.2.1.25.3.3.1. There are two metrics to pull, but no OIDs that contain any valid names. Let's look at the SNMP Walk of that table:
As you can see, there are two metrics hrProcessorFrwID (1) and hrProcessorLoad (2). You might think that since hrProcessorFrwID ends in "ID" it might be a good idea to use that as the display name. However, notice the values? They're all "0.0". That won't make for a good display name. So, what do we do? We use "WILDCARD" discovery and provide a single column for LM to do an SNMP Walk. It actually doesn't matter which column in this table we choose because the output will be the same. Since we're interested (in this example) in hrProcessorLoad, let's choose that column. Here's what the collector would see when it does the SNMP Walk of 1.3.6.1.2.1.25.3.3.1.2:
Remember that LM needs two pieces of data to create the instances: WILDVALUE and WILDALIAS. By choosing Wildcard as our discovery type, we instruct LM to use the index (left column) as both the WILDVALUE and the WILDALIAS.
Setting the WILDVALUE properly is important because it is used later when defining datapoints. For example, to pull the hrProcessorLoad from the Wildcard example above, my datapoint OID would be "1.3.6.1.2.1.25.3.3.1.##WILDVALUE##". To pull the ifInDiscards for the "Value" example, my datapoint OID would be "1.3.6.1.2.1.2.2.1.13.##WILDVALUE##".
TL;DR - SKIP TO HERE
So, now that you know that this DS probably doesn't need to be multi-instance, where does that leave us? What do we do now? Without active discovery, our SNMP polling becomes very simple. Since the metric is on the device level, the WILDVALUE will always be 0 (@Jeffrey.Young this is why you were seeing an instance with the display name "0" in your screenshot from March 30). So, all we need to do is find the OID(s) containing our desired metric(s) and pull them in as datapoints. It looks like the one you're interested in is crasSVCNumSessions (1.3.6.1.4.1.9.9.392.1.3.35), so the datapoint OID would be ".1.3.6.1.4.1.9.9.392.1.3.35.0". To make sure, I recommend doing an SNMPWalk from the collector's debug tool to the target device. I recommend omitting the .35 from the OID so that you can fetch the entire table and look at all the values at once. @Jeffrey.Young, I did test polls against the devices you DM'd me and didn't get any results. It would appear that those devices don't have data in those OIDs. Could be a firmware issue or Cisco decided that certain models would have the data in a different place (they've done it before).
Jeffrey_Young
Just as a follow up. I opened a TAC case and the OIDs I am using are correct for both the ASA and FPR devices. So....not sure why this isn't working in my environment.
Jeffrey_Young
I'm going to check out the version we are on. In our sandbox we have 1 FPPR, but in our prod system we have 15-20.....I'm assuming that the versions are spread out but going to do some investigating. Thanks again Matt and Stuart!
Matt_M_
I had that issue when I was testing different OIDs to find the right one. Usually it was when I was polling a OID incorrectly or the OID didn't exist on the device. You can try to manually poll that OID and see if you get any value returned. If you get the anyconnect user count you are expecting you know the issue is on your logicmonitor datasource config side. If not -- then you know the issue is on your SNMP/OID side. These 2110 FTDs are running the latest version as they are fairly new so I am not sure if that has anything to do with it.
If you do not get the expected variable returned I would try some other OIDs for your specific firmware, or open a TAC case and ask them what OID to use or why the OID given here isnt working as intended.
Jeffrey_Young
Attached some screenshots. I have pulled this into my prod and sandbox environment and same result.
Jeffrey_Young
That's just it....I see that the appliesto is working, SNMP is now polling correctly, but on the FP devices I'm not seeing the new "Cisco" datasource under the devices....but I do on the ASAs.
LM User
You can check that your appliesto is working properly (click test applies to and click the link to view the results and ensure your new device is in there). If that's successful, that part is done.
Then you can test the active discovery to see if it's discovering anything. If that part's not working, there's a problem with SNMP or the OIDs specified in discovery aren't there on the version of the device you have (doesn't sounds like the latter should be the case).
If all that works, you can test the polling by going to the device, browsing to the datasource, then the raw data tab. Click poll now to see if you're getting data back. If that doesn't work, then there's a problem with SNMP (permissions maybe, v3?) or the OIDs specified in the "Datapoints" section of the DS aren't correct.
Jeffrey_Young
Thank you Matt and Stuart. Unfortunately even after setting the displayName in the appliesto isn't working. I'm having one of the guys take a look as i just noticed that NetFlow is working but we aren't getting any SNMP info...
LM User
What you'll need to do is make sure that the datasource is getting "applied" to the additional devices. It sounds like the OIDs and stuff are probably the same between the two, so you would only need to change the "AppliesTo". You can do that manually by adding " || displayName == '[the display name of an additional device]'" to the current applies to. If that gets you data on the 2110, you'll need to further adjust the AppliesTo so that the datasource is trying to collect data for the additional devices. You can do this with a system.category, or a sysOID mapping, or a property source.
Matt_M_
Let me know how you make out. I can confirm that its working for us at least with two different 2110 devices. The documentation for the 2110s actually says they still use ASA SNMP OIDs and that you can still use the same entries. I just added my devices to my Applies To and it worked great.
Jeffrey_Young
I've uploaded but it doesn't seem to be working for any of the 2100 or 4100 series devices in my system. I'm still playing with it a little. I did have to change your appliesto to hasCategory("CiscoFirepowerSNMP"). None of my devices have CiscoFirepower as a category.
Matt_M_
I can't export mine and share it that way because the Exchange is being re-worked. Here is a copy of my XML (https://pastebin.com/GErayzCE) -- you can save that locally as a XML file and then add it to your tenant by doing DataSources -> Add -> From a file, and selecting your created file.
Note -- I added a category to the "applies to" called CiscoFirePower. You have to add that to any firepower device that you want this to apply to, and then run another active discovery.
Jeffrey_Young
Thank you Matt. I'm confused about where to actually change the OID's that you posted. Are you changing on the datasource and then under parameters? Or somewhere else? Basically i changed what it was in that location to 1.3.6.1.4.1.9.9.392.1.3.35.0 and applied to a FTD but it didn't seem to work. I'm not sure that i did incorrectly.
Matt_M_
You can use this same OID to monitor on FPR devices. Just adjust your applies too to include fire power devices (if you are using the the OID's I posted about). I don't believe the original OIDs worked for firepower for me but the one I updated with did.
Jeffrey_Young
Awesome and thank you, it's working great for my ASAs in the system. Anyone have one to monitor the same thing on the Cisco FPR devices?
Matt_M_
I was able to get accurate results changing the OID polled to:
1.3.6.1.4.1.9.9.392.1.3.35 under the properties, and 1.3.6.1.4.1.9.9.392.1.3.35.0 under the data source.
Matt_M_
I have been seeing session numbers much higher than I would expect. When I looked closer the numbers are not matching the output from manually checking using the CLI. This is across a few dozen devices with different setups. I think the OID may be different I found the following ones that I am testing. I will post back if I get better results:
Nick
As an FYI -
I have added the following OID to the datasource I have downloaded so that we can see the Maximum Session count (Raw Data) - this may be of use to others as well.
alSslStatsMaxSessions - 1.3.6.1.4.1.3076.2.1.2.26.1.3.0
Description - "The maximum number current of active sessions at any one time."
Nick
Thanks for getting this pushed through, with all that's going on at the moment it saved a little time in putting something like this together.
& Thanks to @Sawer.lef for publishing in the first place
LM User
I don't see the need to post the XML unless you really want to. Anyone who wants it can get it from the exchange.
As far as when it will come out: sooner than soon but later than now?
sawyer_lef
OPThanks @Stuart Weenig I didnt see this until today. Do I still need to put the XML for anyone else? When will the new features roll out?
LM User
Check now. It should be good to go.
LM User
On it. Stay tuned.
Nick
@Stuart Weenig it would be good to have this anyconnect sessions module asap, my company use the cisco anyconnect for vpn and due to corvid19 have just been told to all work from home so this would be useful to track VPN connection usage etc
thanks
LM User
This is due to the new changes that are soon to be released regarding the exchange. All non-LM (i.e. non-core) datasources in the exchange are marked as private. Once the exchange features are released, the module owner will be able to flip the switch to make it public.
If the original poster wants, he can publish the XML or the scripts themselves to github, pastebin, etc. and link from here to there.
How urgently did you want to look at it @Nick?
Nick
Unable to download, states it is "LogicModule is Private, Cannot Read" - is this because LM are vetting it?