ASA RA VPN user information using SNMP


Tue, 06/20/2017 - 11:25
Oct 2nd, 2010
User Badges:


If we are looking to get the username/ip/tunnel-group of the cisco ipsec ra vpn users connected to the ASA using SNMP


then we need to use this MIB "CISCO-REMOTE-ACCESS-MONITOR-MIB".



crasUsername ( is the OID that can be used to fetch the username.


But if we closely check our ASA we don’t have any such OID in the built-in database of the ASA.


ASA-5510-8x(config)# sh snmp-server oidlist | in crasU


So we don’t have



But if we explore this OID tree on the ASA, then we have a other OID’s which can fetch information about the VPN clients connected to the ASA.          crasGroup          crasAuthenMethod          crasAuthorMethod          crasSessionDuration          crasLocalAddressType          crasLocalAddress          crasISPAddressType        crasISPAddress        crasSessionProtocol        crasProtocolElement        crasSessionEncryptionAlgo        crasSessionPktAuthenAlgo        crasSessionCompressionAlgo        crasHeartbeatInterval        crasClientVendorString        crasClientVersionString        crasClientOSVendorString        crasClientOSVersionString        crasPrimWINSServerAddrType        crasPrimWINSServer        crasSecWINSServerAddrType        crasSecWINSServer        crasPrimDNSServerAddrType        crasPrimDNSServer        crasSecDNSServerAddrType        crasSecDNSServer        crasDHCPServerAddrType        crasDHCPServer        crasSessionInPkts        crasSessionOutPkts        crasSessionInDropPkts        crasSessionOutDropPkts        crasSessionInOctets        crasSessionOutOctets        crasSessionState




ASA as of now doesn’t provides us the username of the VPN user in *clear text* and we have couple of bugs filed for it.



One of them being


CSCtc36391    ASA snmp object crasUsername should be readable



But we can follow this to get other useful information




snmpwalk.exe -c public -v 2c 192.168.16.xx ""


SNMPv2-SMI::enterprises.9.9.392. = STRING: "puneet"



This tells us the name of "tunnel-group" and the "username" used to connect to the ASA.



In this output “puneet” is the name of the tunnel-group.

Now we need to Convert name from ASCII based indexing






                                     a      s      t      r     i       p      a      t



ASCII translation:


  97 = a

115 = s

116 = t

114 = r

105 = i

112 = p

  97 = a

116 = t



Check the hex to character table at this website



Compare this with the simultaneous output from the ASA



ASA-5510-8x(config)# sh vpn-sessiondb remote

Session Type: IPsec

Username     : astripat               Index        : 71

Assigned IP  :                Public IP    :

Protocol     : IKE IPsec

License      : IPsec

Encryption   : 3DES                   Hashing      : MD5 SHA1

Bytes Tx     : 0                           Bytes Rx     : 0

Group Policy : puneet                Tunnel Group : puneet

Login Time   : 12:43:47 MST Thu Jan 14 1993

Duration     : 0h:22m:28s

NAC Result   : Unknown

VLAN Mapping : N/A                    VLAN         : none



These OID's can give us some more information



Client's local ip address (crasISPAddress)


snmpwalk.exe -c public -v 2c 192.168.16.xx

SNMPv2-SMI::enterprises.9.9.392. = STRING: ""



IP address assigned to the vpn client(crasLocalAddress)


snmpwalk.exe -c public -v 2c 192.168.16.xx

SNMPv2-SMI::enterprises.9.9.392. = STRING: ""



Another example:-



snmpwalk.exe -c public -v 2c 192.168.16.xx


SNMPv2-SMI::enterprises.9.9.392. =STRING: "puneet"




                                     g      a      u      r     a     v 

ASCII translation:


103 = g

97  = a

117 = u

114 = r

97 =  a

118 = v



Compare this with the simultaneous output from the ASA



ASA-5510-8x# sh vpn-sessiondb remote


Session Type: IPsec


Username     : gaurav                 Index        : 22

Assigned IP  :                Public IP    :

Protocol     : IKE IPsec

License      : IPsec

Encryption   : 3DES                   Hashing      : SHA1

Bytes Tx     : 0                           Bytes Rx     : 0

Group Policy : puneet                 Tunnel Group : puneet

Login Time   : 17:13:51 MST Sat Jan 2 1993

Duration     : 0h:03m:11s

NAC Result   : Unknown

VLAN Mapping : N/A                    VLAN         : none



Scenario 2:


User is trying to add one of our 5525-X into our solarwinds orion. just wanted to know if temperature OID is supported? i tried to list "resources" for the ASA but it's only giving me CPU, memory, interfaces, etc. but there's no option to monitor its temperature.




Try under "CISCO-FIREWALL-MIB" and OID:- or{cfwHardwareStatusValue}


-Puneet Seth

senthil085 Tue, 11/23/2010 - 06:18
User Badges:

Hi Puneet,

I appreciate your effort in explaining. It is of much useful.



cchoy Thu, 04/05/2012 - 09:09
User Badges:


I have 1 tunnel group and multiple group policies that we use to assign multiple IP local pools (for various reasons).  I see in the example above that you are able to query the SNMP agent by tunnel group name to get the session count. 

I need a way to get the number of sessions per IP local pool so I can monitor the data over time to ensure that a pool is not running short on available addresses.

Is there a way to query the agent for group policy name, and have it return an integer of current active svc sessions assigned to that group policy?

Or is there a way to have the agent count the number of IP addresses in active use for an IP pool name and return an integer?

Many thanks.

puseth Fri, 04/06/2012 - 06:46
User Badges:

Hi cchoy,

Can you paste the VPN part of your configuration and i can try and set this up in my lab for you.

And try what you'd like to see.


puseth Fri, 04/06/2012 - 06:42
User Badges:

Hi Paul,

Sorry i didnt get your question.

What would you like to do via CLI?


probertsyork Fri, 04/06/2012 - 06:58
User Badges:

Hi Puneet,

I'm trying to find the list of sessions and their details much like you have done in SNMP, but do it through CLI (using SSH, running a command...).

cchoy Fri, 04/06/2012 - 07:31
User Badges:

Many thanks Puneet.

Below is an anonymized version of the essence of the VPN configuration.  I am using group policy override to control an agent/server based service migration.  The server side service (completely unrelated to Cisco technology) only recognizes IP address sources as its means of identifying its clients.  In the transition from the old to the new system workers that are 100% telecommuters must be guided into a new source subnet so the new system can identify their workstation and upgrade their agent.  The routable IP local pool space is limited for a number of reasons, so I could not just double the ip local pools for this effort (that would have been too easy of course).  Thus, I need a way to monitor IP usage in the ORIGINAL pool below to the MIGRATED pool as users are migrated throughout the year.  With events like the London Olympics coming, a problem is anticipated and I need to monitor consumption of addresses in both IP pools on a number of remote access dedicated ASA's (meaning no failover or multi context firewalling).

Many thanks.


ldap attribute-map LDAP1

  map-name  attribute1 Group-Policy

tunnel-group TUNNEL1 type remote-access

tunnel-group TUNNEL1 general-attributes

authentication-server-group RADIUS1

authorization-server-group LDAP1

accounting-server-group RADIUS1

default-group-policy ORIGINAL



tunnel-group TUNNEL1 webvpn-attributes


proxy-auth sdi

group-url https://[PUBLIC_IP_ADDR] enable

group-url enable

ip local pool MIGRATED mask

ip local pool ORIGINAL mask

group-policy MIGRATED internal

group-policy MIGRATED attributes

banner value Your agent will use the new system going forward because you have come from the MIGRATED network one time. Even if you are put back on the ORIGINAL network at a later date by taking the attribute1 away from your LDAP1 account your agent has been upgraded and will use the new system.

address-pools value MIGRATED


  svc dtls enable

  svc ask none default svc

group-policy ORIGINAL internal

group-policy ORIGINAL attributes

banner value Your agent will still use the old system and has not received the attribute1 LDAP1 trigger.

vpn-tunnel-protocol svc

default-domain value

address-pools value ORIGINAL


  svc dtls enable

  svc ask none default svc

kalagan750 Thu, 02/14/2013 - 07:21
User Badges:


My device is an ASA 5510 with ASA Version 8.2

I juste want to know if you have a solution to get VPN username who are connecting on my VPN with snmp command.

Thanks for your reply

cchoy Tue, 02/19/2013 - 06:19
User Badges:

[827]   crasVpnUsername

Try an snmp walk of the oid above.

Or do a "show snmp oid" on your ASA (may differ slightly from version to version) and find an OID that looks like it might give you what you need.

kalagan750 Wed, 02/20/2013 - 03:13
User Badges:

Thanks Cchoy,

I get "show snmp oid" on my ASA and a find " [667]   crasVpnUsername "

But when i try snmp walk i have this message : " SNMPv2-SMI::enterprises. = No Such Instance currently exists at this OID "

An idea ?

triam8001 Tue, 03/18/2014 - 00:48
User Badges:


check my script

#!/usr/bin/perl -w
use strict;
use warnings;

open(VPNUSERS,'-|','snmpwalk -v 2c -c public') || die "Failed\n";

while ((my $name = <VPNUSERS>))
        my @t = split(/\./, $name);
        my $x = @t;
        my $iii = 10;
        while ($iii < $x-1) {
                print chr($t[$iii]);
        print "\n";


Christopher Thompson Sat, 04/26/2014 - 19:08
User Badges:

Your script was a help to me. Only thing I changed was to use as the OID to limit to only remote users and exclude my site-to-sites. Cheers.

kalagan750 Wed, 05/07/2014 - 03:35
User Badges:



Great script !

Do you can tell me how i can display  the IP Adress in side Name.

Thanks, Thu, 07/17/2014 - 02:43
User Badges:

great script.

is possible to have a change to show the assigned ip, public ip, tunnel group and converted counter32 duration in hh:mm on the same raw ?

many thanks



Diego Rivera Tue, 05/13/2014 - 05:27
User Badges:

Hello everybody.

I've been seraching everywhere how to monitor several VPNs, only the vpn connections, not users connected to the VPN.  I don't know how to do this. I've been reading this post and it's really interesting but I will appreciate if someone could help me.  What OID can do this? 

DavidAbelGonzalez Tue, 02/14/2017 - 01:09
User Badges:

Hello everyone,

It has been a while since the initial post, but I think it is worth the reply/re-opening.

As I was in need to gather information about the VPN users that were connected to my ASA, I managed to find an script made by Phil Hendren (dizzythinks).

I just modify it a little bit to get the VPN profiles of the users, so all credits go to this guy

Thanks and best regards, David Abel.

erdogankilic Mon, 06/19/2017 - 14:48
User Badges:

Hi David,

Can you please give more information. We have Solarwinds Orion, is it possible to run this script on Orion, and do you know if that works with snmpv3



DavidAbelGonzalez Tue, 06/20/2017 - 02:00
User Badges:

Hello Erdo,

I just run it from Nagios/Icinga, down below you can find a little example of its usage, although if you execute the script with "--help" you can get the optional arguments and their explanation.

[root@server ~]$ /usr/bin/python /usr/local/icinga/libexec/ -f -i, -c SNMPPublicCommunity -o text

NOTE: attached to this reply you can find an update version of the script.

Best regards, David Abel.

erdogankilic Tue, 06/20/2017 - 11:25
User Badges:

Hi David,

Thank you for quick response. This script is great, it is something we have been looking for a long time.

We also have Icinga in production, but I am not sure if Icinga can save historical data. The goal is to have AnyConnect users' activity, so we can easily find in the future, if needed.

That's why I was asking about Solarwinds Orion.

Thank you



This Document

Related Content