Cisco ASA/PIX VPN Statistics

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
User avatar
Setarcos
Cacti User
Posts: 143
Joined: Mon Dec 13, 2004 2:55 pm
Location: San Jose, CA
Contact:

Cisco ASA/PIX VPN Statistics

Post by Setarcos »

Hi Folks,

After digging around for something that would allow our organization to monitor LAN to LAN VPN tunnel traffic between our Cisco ASAs and remote peers, I stumbled across this thread but it didn't quite meet my needs. I threw something together based on the script listed in this thread, but enhanced it to work as an indexed script query, so tunnels can be selected by the VPN Peer IP.

Once installed, just add the 'Cisco ASA/PIX -VPN Statistics' data query to your host/host template and graph away.

Update: Added missing Data Query and Template.
Update 3/10/2010: Updated query_lan2lan_cisco.pl to v0.06.
Attachments
templates.zip
Import these templates
(6.81 KiB) Downloaded 5118 times
Example Graph
Example Graph
ASA-IPSec-Traffic.png (29.4 KiB) Viewed 64547 times
cisco_asa_vpn_tunnel.xml
Place this in your script_queries directory
(895 Bytes) Downloaded 6320 times
query_lan2lan_cisco.pl
Place this in your scripts directory (v0.06)
(8.28 KiB) Downloaded 8471 times
Last edited by Setarcos on Thu Mar 11, 2010 12:52 pm, edited 5 times in total.
tonyv250
Posts: 1
Joined: Fri May 23, 2008 2:42 pm

Spikes when IPsec re-keys?

Post by tonyv250 »

Hi.
I am relatively new to Cacti.
Has anyone else seen spikes in VPN tunnel graphs when the IPsec SA re-keys and the RX and TX counters on the ASA are zeroed?
It looks like the subtraction that takes place to get the number of bytes that have been transmitted or received between two polls becomes a negative number and that causes the calculation to produce a negative bits/sec value, which must confuse the graphing process.
Am I doing something wrong?

Thanks.
Leeroy
Posts: 14
Joined: Fri Jan 18, 2008 6:36 am
Location: Paris, France

Post by Leeroy »

Hi,

I've test your script and it works well. But i don't know why for certain host, it isn't detect all VPN peer, for example :

There are 2 VPN Actives but it detects only one :
perl query_lan2lan_cisco.pl public xxx.xxx.xx7.254 ASA index
xxx.xxx.xxx.234

This problem doesn't appear on all ASA, only two of them have this problem.

If you have any ideas :wink:
User avatar
Gorbachov
Posts: 29
Joined: Sun May 04, 2008 12:20 pm
Contact:

Post by Gorbachov »

Maybe it is an OS version issue. Compare working with not working device to see if this is the problem.
electro93
Posts: 3
Joined: Mon Nov 15, 2004 4:22 pm

Post by electro93 »

I am having the same issue running 8.0.3. And I also had to do more than what was mentioned in this thread to get it working. The data query needed to be created and linked to "resource/script_server/cisco_asa_vpn_tunnel.xml". I then was able to add the data query to the hosts, but it appears to only query one and not the true amount of tunnels for each device. Please let me know if anyone has a workaround to this. Thanks!
electro93
Posts: 3
Joined: Mon Nov 15, 2004 4:22 pm

Post by electro93 »

I was able to resolve my issue. Everything is working great. Thanks!
plohish
Posts: 2
Joined: Sat Jun 14, 2008 4:11 am

Post by plohish »

Gorbachov wrote:Maybe it is an OS version issue. Compare working with not working device to see if this is the problem.
Hello! First of all sorry for my English.

I've done next steps:

1. Put query_lan2lan_cisco.pl in <cacti_path>/scripts
2. Put cisco_asa_vpn_tunnel_848.xml in <cacti_path>/resource/script_queries/
3. Import cacti_graph_template_cisco_asa_pix.xml
4. Add a data query 'Cisco ASA/PIX - VPN Statistics' with assosiated graph tempates - 'Cisco ASA/PIX - VPN Statistics'.
5. In host template added 'Cisco ASA/PIX - VPN Statistics' in Associated Data Queries
6. Go to the 'New Graphs' in which I can see 2 of 3! my peers, switch them and click 'Create'.

But .rrd and graphs don't created! :(
plohish
Posts: 2
Joined: Sat Jun 14, 2008 4:11 am

Post by plohish »

RRDTool Command:

/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="92.242.xx.xxx - VPN Statistics" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/usr/local/share/cacti/rra/cisco_asa_5510_rx_34.rrd":RX:AVERAGE \
DEF:b="/usr/local/share/cacti/rra/cisco_asa_5510_rx_34.rrd":TX:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefe=b,8,* \
AREA:cdefa#00CF00FF:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:cdefe#4123A1FF:"Outbound" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s"

RRDTool Says:

ERROR: opening '/usr/local/share/cacti/rra/cisco_asa_5510_rx_34.rrd': No such file or directory
nduda78
Cacti User
Posts: 111
Joined: Tue Mar 01, 2005 11:26 am

Post by nduda78 »

I always get an error when I try to select a peer and graph it, damn really wanted to use this instead of the old one.

Cacti 8.7b patched.


Notice: Undefined index: sgg_10 in /www/htdocs/cacti/graphs_new.php on line 71

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/cacti/graphs_new.php:71) in /www/htdocs/cacti/graphs_new.php on line 323
Nico_TLC
Posts: 2
Joined: Fri Jul 04, 2008 9:00 am

Post by Nico_TLC »

Hi cacti users :)

Did someone successed to use this with cisco PIX ?
I'm trying, but OIDs in perl dont't seem to be the right ones.
We use a 506E Cisco PIX with OS 6.3.

Thanks.
nduda78
Cacti User
Posts: 111
Joined: Tue Mar 01, 2005 11:26 am

Post by nduda78 »

plohish, I am in the same boat as you now. Everything works but the graph RRD dont get created.

Based on my cacti log (set to high and/or debig) i never see the script get called.
User avatar
Setarcos
Cacti User
Posts: 143
Joined: Mon Dec 13, 2004 2:55 pm
Location: San Jose, CA
Contact:

Post by Setarcos »

electro93 wrote:I am having the same issue running 8.0.3. And I also had to do more than what was mentioned in this thread to get it working. The data query needed to be created and linked to "resource/script_server/cisco_asa_vpn_tunnel.xml". I then was able to add the data query to the hosts, but it appears to only query one and not the true amount of tunnels for each device. Please let me know if anyone has a workaround to this. Thanks!
Thanks for catching this electro93. The data template and data query are attached to the original message in this thread.

Note: The in/out statistics are for the sum of all tunnels to/from a given VPN peer.
Last edited by Setarcos on Thu Jul 10, 2008 1:25 pm, edited 1 time in total.
User avatar
Setarcos
Cacti User
Posts: 143
Joined: Mon Dec 13, 2004 2:55 pm
Location: San Jose, CA
Contact:

Re: Spikes when IPsec re-keys?

Post by Setarcos »

tonyv250 wrote:Hi.
I am relatively new to Cacti.
Has anyone else seen spikes in VPN tunnel graphs when the IPsec SA re-keys and the RX and TX counters on the ASA are zeroed?
It looks like the subtraction that takes place to get the number of bytes that have been transmitted or received between two polls becomes a negative number and that causes the calculation to produce a negative bits/sec value, which must confuse the graphing process.
Am I doing something wrong?

Thanks.
See the recently attached data templates to the original message. I originally had these set to COUNTER but had seen the same problem. Once they were changed to DERIVE, the spikes stopped occurring.
nduda78
Cacti User
Posts: 111
Joined: Tue Mar 01, 2005 11:26 am

Post by nduda78 »

can you post your xml for the data query as well?

You posted the data template and graph template...just need the data query now cause no matter how i make it myself the graphs never get made/updated.
User avatar
Setarcos
Cacti User
Posts: 143
Joined: Mon Dec 13, 2004 2:55 pm
Location: San Jose, CA
Contact:

Post by Setarcos »

nduda78 wrote:can you post your xml for the data query as well?

You posted the data template and graph template...just need the data query now cause no matter how i make it myself the graphs never get made/updated.
All the templates and queries are in the zip file attached to the original message.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests