Host Template: VLAN Statistics (for Catalyst 4500)

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

Moderators: Developers, Moderators

TrilceAC
Posts: 9
Joined: Thu Apr 10, 2008 2:50 am
Location: Valencia (Spain)

Host Template: VLAN Statistics (for Catalyst 4500)

Post by TrilceAC »

Hi all:

I'm pretty new using Cacti, but I have done some templates for monitoring VLAN Traffic. At the moment this template only allows to monitor bits and bytes per second, but it is relatively easy to extend it for monitoring packets that hit the VLANs.

These were my first templates. I'm using Cacti only for 2 weeks, and I have never exported a Template, so it is possible that I have done any mistake. Use it at your own risk (I don't really think that something wrong can happens, but it is my first time :wink: )

I think that the method to export them is creating a host template, and then associate to it the new data queries and grpah templates. Finally I've exported the new host template. If I have done any mistake, please, let me know.

I'm monitoring a Cisco Catalyst 4500 Switch using Cacti 8.6.i. I'm monitoring 64-bit counters, so you will need to use at leats version 2 of snmp. I hope that this template could help.

Regards.

Image
Image[/img]
Attachments
cacti_host_template_cisco_router_with_vlan_statistics.xml
Template based on the Cisco Router template that also is able to monitos VLAN Statistics
(129.45 KiB) Downloaded 4082 times
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

Isn't this exactly the same as the existing interface graphs??
TrilceAC
Posts: 9
Joined: Thu Apr 10, 2008 2:50 am
Location: Valencia (Spain)

Post by TrilceAC »

niobe wrote:Isn't this exactly the same as the existing interface graphs??
As far as I know, no, it isn't the same. I have to use Version 0.8.6i. I was able to see and to check the VLANs of the standard "SNMP - Interface Statistics", but cacti was unable to get any traffic data for these items. The OID that cacti should walk in order to get some data for VLANs have a double index instead of the typical "ifIndex" (1) used to obtain the traffic of the interfaces. The index of VLANs data was something like "ifIndex.NumberOfVlan" (2). The "interface.xml" under the directory "resource/snmp_queries" is not able to navigate in order to get data from "smonVlanIdStatsTotalHCOctets", because interface.xml uses (1) as index, and this data is accesible using (2) instead of (1).

As I said, I must use cacti version 0.8.6i. Perhaps new versions are able to get this data. I have no notice about it. I googled a little bit and I only found requests to do it. So I wrote this template.

Have you monitored VLAN traffic (in a Cisco 4500 Switch) using the standar SNMP data Query? Which version of cacti are you using? How did you monitor that?

Regards.
TrilceAC
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

No I haven't tried to monitor a VLAN interface, though we have both 4500s and 6500s. Hrmm, now I think about it, I think I consciously avoided monitoring the VLAN interfaces since I know the counters in "show interface" are inaccurate for VLAN interfaces on the multilayer switches...so not surprised that the SNMP version doesn't work so well. Will definitely have a closer look at your template.

By the way , what supervisor are you using this with?

cheers,
N
TrilceAC
Posts: 9
Joined: Thu Apr 10, 2008 2:50 am
Location: Valencia (Spain)

Post by TrilceAC »

niobe wrote:By the way , what supervisor are you using this with?
WS-X4516-10GE
TrilceAC
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Re: Host Template: VLAN Statistics (for Catalyst 4500)

Post by mcutting »

I get "Could not find data query XML file at 'C:/wamp/www/Cacti/resource/snmp_queries/vlan-snmp.xml'" when I run a verbose query, so it looks like the data query is missing.

Could you please post this ?

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
TrilceAC
Posts: 9
Joined: Thu Apr 10, 2008 2:50 am
Location: Valencia (Spain)

Post by TrilceAC »

Oh, sorry. I'm newbie and that is my first template. I thought that I only had to export a host template and check the dependencies button. But now I know that it is not enough.

Here you have the data query that I wrote. There are more fields than the used by the template, so it is possible to complete the template in order to monitor more data. At the moment this template does not query all the monitorable information of VLANs. It is also possible to complete the data query by adding the missed OIDs, and then to complete the host template.

Do you also need the data template or the graph template? I hope that you don't, but let me know if you need it and if this template with the query works for you.

---> Take care when saving this xml data query. You should save it as "vlan-snmp.xml" under your "resources/snmp_queries/" directory.

Enjoy.
Attachments
vlan-snmp.xml
xml data query to monitor VLAN statistics. SAVE IT AS "vlan-snmp.xml" UNDER your ...cacti/resources/snmp_queries/ directory or the template will not work.
(1.99 KiB) Downloaded 2749 times
TrilceAC
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

Hey, have finally had a look at this since I want to graph some vlan data..

I have tracked the OIDs from your query to SMON.MIB. First thing I notice is the MIB cannot separate inbound and outbound data. Kinda makes sense to have an OID only interested in the number of packets/bits switched by a Catalyst, but I was hoping there'd be a sum of all the packets in and out of all interfaces in a vlan - guess this would be a fair bit trickier.

Anyway, just a suggestion to make this clear in your templates, so people don't think this is the same as traffic on an interface but for VLANs e.g. Graph legend "packets switched" or similar

cheers,

N
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Cisco Catalyst VLAN Traffic Stats

Post by niobe »

I have tweaked this a little..hope you don't mind

- Fixed OID regexp which was broken for index numbers not exactly 3 digits
- Added non unicast octets (or packets - forgot which one was missing).
- New 'sexy' graph templates for Packets and Traffic (see http://forums.cacti.net/viewtopic.php?t=25415)
- Clarified on axis that these stats are in+out
- Renamed some names/fields slightly to be consistent with other queries

I have tested on Catalyst 6500 and 4500, works a treat.

cheers,

N
Attachments
VLAN Traffic Graph
VLAN Traffic Graph
cisco.vlan.traffic.png (30.89 KiB) Viewed 42790 times
VLAN Packets Graph
VLAN Packets Graph
cisco.vlan.packets.png (31.19 KiB) Viewed 42790 times
cisco_vlan.xml
Cisco VLAN Stats query
(2.11 KiB) Downloaded 3400 times
cacti_data_query_cisco_-_vlan_statistics.xml
Cisco VLAN Templates
(33.07 KiB) Downloaded 3529 times
TrilceAC
Posts: 9
Joined: Thu Apr 10, 2008 2:50 am
Location: Valencia (Spain)

Post by TrilceAC »

Thank you for completing my work. My boss only wanted to monitor traffic on VLANs (bits per second). He has no interest on packets. As this was the fisrt time that I use cacti (and any other monitoring-tool, I'm newbie in a new work with a new boss) I spent a lot of time learning. I would like to complete the hole template but I ran out of time and I received new tasks. It is nice to see that someone has helped me and has complete it :-) Thanks a lot, I'll use it ;-)

As you mentioned you have tunned the graphs. I detected some mistakes in mines. First, I wasn't able to draw the colored box with the name of the area in the legend of the graphs. I see that you have done it. I am not sure what I have forgotten, I'll compare check your template to find my mistake :-)

I also wanted to draw together total and non-unicast traffic. But I was trying to do something a little bit more complicated. I wanted to infer the unicast traffic given the total- and the non-unicast traffic. It is only supposed to be a difference between both values, but since I have no previous experience with CDEFs, I was not able to get this result. Is it possible to compute this difference and draw it using cacti?
- Fixed OID regexp which was broken for index numbers not exactly 3 digits
I used a fixed length of 3 digits because the index numbers used by my router for this particular issue have a fixed length of 3 digits. I thought that every router would work like mine. Sorry if this is not true.

Thanks again niobe for the very big enhancements to these templates. I'll download it now :-)
TrilceAC
TrilceAC
Professor Hognutz
Posts: 4
Joined: Fri Jun 15, 2007 12:28 pm

c3560 and vlan stats

Post by Professor Hognutz »

I tried this query on a catalyst 3560 and I got this:

+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.16.22.1.2.2.1.7'
+ No SNMP data returned

Could it be I need a different index for this model? Where do I go about finding this sort of thing?

Thanks...
Professor Hognutz
Posts: 4
Joined: Fri Jun 15, 2007 12:28 pm

Maybe I'm out of luck...

Post by Professor Hognutz »

snmpwalk returns:
SNMPv2-SMI::mib-2.16.22.1.2.2.1.7 = No Such Object available on this agent at this OID
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

Go to the Cisco MIBS page and find the MIBS for your platform.

6500's typically have small differences from the other platforms. That's why this is a 6500 template :)
overlord
Posts: 3
Joined: Fri Aug 01, 2008 7:34 pm

Post by overlord »

Hey, Im pretty new to cacti and SNMP in general, but im trying to get the VLAN monitoring working on a Catalyst 4506 running IOS 12.1(19) with snmp version 3.

I was able to get a basic interface monitored with SNMP however the VLAN template isnt working. When I go to check the "Cisco - VLAN Statistics" query on the device listing, the verbose output says:

Code: Select all

+ Running data query [11].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/resource/snmp_queries/cisco_vlan.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.16.22.1.2.2.1.7'
+ No SNMP data returned
+ Found data query XML file at '/var/www/html/resource/snmp_queries/cisco_vlan.xml'
+ Found data query XML file at '/var/www/html/resource/snmp_queries/cisco_vlan.xml'
+ Found data query XML file at '/var/www/html/resource/snmp_queries/cisco_vlan.xml'

This is using the last 2 XML files posted above me.

How do I get this to work on a catalyst 4506? Sorry if Im asking stupid questions but I have little experience with SNMP monitoring and googling for the past few hours hasnt gotten me any results. Thanks
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

overlord wrote: How do I get this to work on a catalyst 4506? Sorry if Im asking stupid questions but I have little experience with SNMP monitoring and googling for the past few hours hasnt gotten me any results. Thanks
The thing to try is a manual snmp walk. If you're using *nix the command is snmpwalk usually part of snmp-utils package. Use the OID contained in your message and see what result you get.

If you get something like "value not defined at this OID" or similar, then your software does not support this snmp query. I would suspect this is the case since I think you are running quite an old version - you might want to upgrade!

cheers,

N
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest