Discussion:
[mrtg] Syntax for 10Gbps interface name
Rick Pummel
2016-12-05 23:07:07 UTC
Permalink
I'm hoping someone can answer what is probably a pretty easy question.
While I have been using MRTG for years, I have only recently needed to
start gathering stats on 10G interfaces. I can't seem to figure out the
correct syntax to identify the interface in the MRTG config file.

I use MRTG to graph around 15 of our key Cisco switches. The device in
question is a Cisco WS-C4500X-16 running
IOS cat4500e-universalk9.SPA.03.08.01.E.152-4.E1.

On a 1Gbps interface, my target statement looks like the following, which
works fine:
Target[WWHS]: #Gi6/1:***@10.255.255.7:::::2

However, I have scoured the MRTG documentation and still cannot find the
appropriate syntax for a 10Gbps port on the same switch. I have
experimented with a number of creative names, just guesses, but none have
worked. I have even tried using the interface description (as detailed in
the documentation) instead of the name, but that yielded 0 output. In the
past, I have found that referencing a VLAN does not seem to work on any of
my Cisco switches, as it only shows Kbps of traffic rather than the
Mbps/Gbps I would expect.

Any advice?

Rick Pummel
Walla Walla Public Schools
Alex van den Bogaerdt
2016-12-05 23:26:30 UTC
Permalink
Post by Rick Pummel
However, I have scoured the MRTG documentation and still cannot find the
appropriate syntax for a 10Gbps port on the same switch. I have
experimented with a number of creative names, just guesses, but none have
worked. I have even tried using the interface description (as detailed in
the documentation) instead of the name, but that yielded 0 output. In the
past, I have found that referencing a VLAN does not seem to work on any of
my Cisco switches, as it only shows Kbps of traffic rather than the
Mbps/Gbps I would expect.
It is some time ago and my memory may be a bit fuzzy, but if memory serves
me well, the problem you describe last is that the switch offloads traffic
to the backbone so it is never seen by the vlan interfaces, only the
initial frame.

And for the first problem: you will not find this in MRTG documentation as
this is not an MRTG problem. You will need to look through Cisco
documentation and/or experiment with SNMP walk to find what you are
looking for. If available at all.

Maybe you can call Cisco or whoever sold you the switch?
Pavel Ruzicka
2016-12-06 10:26:01 UTC
Permalink
Hi Rick,
Post by Rick Pummel
However, I have scoured the MRTG documentation and still cannot find the
appropriate syntax for a 10Gbps port on the same switch.
First you can get Interface names with "snmpwalk" command. It is part of "net-
snmp-utils" package on Centos for example.

You can get interface names for machines (ifName) or for people (ifDescr).
Here is example for C4507:
[***@mrtg ~]$ snmpwalk -v2c -c public c45switch ifName
IF-MIB::ifName.2 = STRING: Te1/1
IF-MIB::ifName.3 = STRING: Te1/2
IF-MIB::ifName.4 = STRING: Gi1/3
IF-MIB::ifName.5 = STRING: Gi1/4
...

[***@mrtg ~]$ snmpwalk -v2c -c public c45switch ifDescr
IF-MIB::ifDescr.2 = STRING: TenGigabitEthernet1/1
IF-MIB::ifDescr.3 = STRING: TenGigabitEthernet1/2
IF-MIB::ifDescr.4 = STRING: GigabitEthernet1/3
IF-MIB::ifDescr.5 = STRING: GigabitEthernet1/4
...

Also it is not needed to create MRTG configuration manually. It is better to
generate it automatically. Advantage is that somebody add new interface that
it will be automatically measured.
I am running my script which call "cfgmaker".

cfgmaker is part of MRTG package and it automatically generate MRTG
configuration file. You can call them for example 1 per day from cron at
night. I use main mrtg.cfg file with Includes. One included file is per one
switch/router.

Here is example of cfgmaker:
cfgmaker --ifref=name --snmp-options=:::2::2 ***@c45switch

Here is part of output for 10G interface:

----------------------------------------------
### Interface 2 >> Descr: 'TenGigabitEthernet1/1' | Name: 'Te1/1' | Ip: '' |
Eth: '' ###

Target[c45switch_Te1_1]: #Te1/1:***@c45switch:::2::2
SetEnv[c45switch_Te1_1]: MRTG_INT_IP="" MRTG_INT_DESCR="TenGigabitEthernet1/1"
MaxBytes[c45switch_Te1_1]: 1250000000
Title[c45switch_Te1_1]: Traffic Analysis for Te1/1 -- C45SWITCH
PageTop[c45switch_Te1_1]: <h1>Traffic Analysis for Te1/1 -- C45SWITCH</h1>
<div id="sysdetails">
<table>
<tr>
<td>System:</td>
<td>C45SWITCH in </td>
</tr>
<tr>
<td>Maintainer:</td>
<td></td>
</tr>
<tr>
<td>Description:</td>
<td>TenGigabitEthernet1/1 Uplink port
</td>
</tr>
<tr>
<td>ifType:</td>
<td>ethernetCsmacd (6)</td>
</tr>
<tr>
<td>ifName:</td>
<td>Te1/1</td>
</tr>
<tr>
<td>Max Speed:</td>
<td>1250.0 MBytes/s</td>
</tr>
</table>
</div>
------------------------------------------------

Best regards, Pavel.
Rick Pummel
2016-12-06 20:16:04 UTC
Permalink
Perfect, this is exactly the information I needed! Thank you!

Rick Pummel
Walla Walla Public Schools
Post by Pavel Ruzicka
Hi Rick,
Post by Rick Pummel
However, I have scoured the MRTG documentation and still cannot find the
appropriate syntax for a 10Gbps port on the same switch.
First you can get Interface names with "snmpwalk" command. It is part of "net-
snmp-utils" package on Centos for example.
You can get interface names for machines (ifName) or for people (ifDescr).
IF-MIB::ifName.2 = STRING: Te1/1
IF-MIB::ifName.3 = STRING: Te1/2
IF-MIB::ifName.4 = STRING: Gi1/3
IF-MIB::ifName.5 = STRING: Gi1/4
...
IF-MIB::ifDescr.2 = STRING: TenGigabitEthernet1/1
IF-MIB::ifDescr.3 = STRING: TenGigabitEthernet1/2
IF-MIB::ifDescr.4 = STRING: GigabitEthernet1/3
IF-MIB::ifDescr.5 = STRING: GigabitEthernet1/4
...
Also it is not needed to create MRTG configuration manually. It is better to
generate it automatically. Advantage is that somebody add new interface that
it will be automatically measured.
I am running my script which call "cfgmaker".
cfgmaker is part of MRTG package and it automatically generate MRTG
configuration file. You can call them for example 1 per day from cron at
night. I use main mrtg.cfg file with Includes. One included file is per one
switch/router.
----------------------------------------------
### Interface 2 >> Descr: 'TenGigabitEthernet1/1' | Name: 'Te1/1' | Ip: '' |
Eth: '' ###
SetEnv[c45switch_Te1_1]: MRTG_INT_IP="" MRTG_INT_DESCR="
TenGigabitEthernet1/1"
MaxBytes[c45switch_Te1_1]: 1250000000
Title[c45switch_Te1_1]: Traffic Analysis for Te1/1 -- C45SWITCH
PageTop[c45switch_Te1_1]: <h1>Traffic Analysis for Te1/1 -- C45SWITCH</h1>
<div id="sysdetails">
<table>
<tr>
<td>System:</td>
<td>C45SWITCH in </td>
</tr>
<tr>
<td>Maintainer:</td>
<td></td>
</tr>
<tr>
<td>Description:</td>
<td>TenGigabitEthernet1/1 Uplink port
</td>
</tr>
<tr>
<td>ifType:</td>
<td>ethernetCsmacd (6)</td>
</tr>
<tr>
<td>ifName:</td>
<td>Te1/1</td>
</tr>
<tr>
<td>Max Speed:</td>
<td>1250.0 MBytes/s</td>
</tr>
</table>
</div>
------------------------------------------------
Best regards, Pavel.
Loading...