[mrtg] Help graphing MAC address count from Cisco switch

Fred Weston fweston at gmail.com
Fri Mar 18 18:10:01 CET 2016


I'm trying to create a graph showing the # of devices connected to a
particular network.  The simplest way I can think of to do so is to
grab the # of MAC addresses in the CAM table for that particular VLAN
from the L3 switch which is the default gateway for the network.

I realize that all MAC addresses may not show in the CAM table of this
switch if the associated hosts aren't communicating with anything off
of the local VLAN, but I don't necessarily care about that since my
reason for doing this is to plot # of devices on the network against
Internet bandwidth consumption so I can work out the average bandwidth
consumption per host.

I found this command online, and it returns an integer which
represents the # of MAC addresses the switch knows about for the
particular VLAN in question (VLAN 40 as shown below):

snmpwalk -v 2c -c public at 30 . |wc -l

The problem is that the SNMP call itself is returning a list of all of
the MAC addresses, and that result is being piped through the wc
command to turn that into an integer count value.

I'm not sure how I'd go about creating a graph based on output from a
command like this instead of a direct SNMP call.  Can anyone help?

In case it matters, I am running MRTG 2.17.4 on Debian 8.3.


More information about the mrtg mailing list