[mrtg] cfgmaker and not unique ifName

Pavel Ruzicka pavouk at pavouk.org
Fri May 7 11:48:40 CEST 2010


Hello Steve,

> Since interfaces 1 and 6 have the same ifName, you cannot use ifName as a
>  unique identifier; hence cfgmaker does not generate Targets.

Yes, I know.

> Instead use something which is unique - eg, ifDescr, of ifNo.  You can
>  specify options to cfgmaker to specify what to use as the preferred
>  identifier, and later versions of cfgmaker allow you to give multiple
>  options.

I use --ifref=descr which is OK, but I need links to other systems based on 
ifName. I need ifName in a HTML code generated by cfgmaker.
cfgmaker generates right targets with --ifref=descr option, but it leaves
ifName EMPTY. This is not important for MRTG function, but it is important
for other scripts which works with HTML output.

Best regards,

Pavel Ruzicka

> Steve
> 
> ________________________________________
> From: mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch
>  [mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] On Behalf Of
>  Pavel Ruzicka [pavouk at pavouk.org] Sent: Friday, 7 May 2010 2:42 a.m.
> To: mrtg at lists.oetiker.ch
> Subject: [mrtg] cfgmaker and not unique ifName
> 
> Hello,
> 
> On a few of my routers (Cisco 7206, GSR) I want to use ifName in my
>  scripts, but ifName is NOT generated by cfgmaker to the target, because it
>  is not unique. 'Name' is EMPTY.
> Is it the right behaviour of cfgmaker?
> How can I solve it?
> I looked at cfgmaker, but code is too sophisticated for my bad perl
>  knowledge.
> 
> There is snmpwalk for ifDescr and ifName:
>  [mrtg at mole bin]$ snmpwalk -v2c -c public gw1.domain.com ifDescr
> IF-MIB::ifDescr.1 = STRING: GigabitEthernet0/1
> IF-MIB::ifDescr.2 = STRING: GigabitEthernet0/2
> IF-MIB::ifDescr.3 = STRING: GigabitEthernet0/3
> IF-MIB::ifDescr.4 = STRING: Null0
> IF-MIB::ifDescr.5 = STRING: Loopback0
> IF-MIB::ifDescr.6 = STRING: GigabitEthernet0/1-mpls layer
> IF-MIB::ifDescr.7 = STRING: GigabitEthernet0/2-mpls layer
> IF-MIB::ifDescr.8 = STRING: GigabitEthernet0/3.26-802.1Q vLAN subif
> IF-MIB::ifDescr.9 = STRING: GigabitEthernet0/3.31-802.1Q vLAN subif
> IF-MIB::ifDescr.10 = STRING: GigabitEthernet0/3.56-802.1Q vLAN subif
> [mrtg at mole bin]$ snmpwalk -v2c -c public gw1.domain.com ifName
> IF-MIB::ifName.1 = STRING: Gi0/1
> IF-MIB::ifName.2 = STRING: Gi0/2
> IF-MIB::ifName.3 = STRING: Gi0/3
> IF-MIB::ifName.4 = STRING: Nu0
> IF-MIB::ifName.5 = STRING: Lo0
> IF-MIB::ifName.6 = STRING: Gi0/1
> IF-MIB::ifName.7 = STRING: Gi0/2
> IF-MIB::ifName.8 = STRING: Gi0/3.26
> IF-MIB::ifName.9 = STRING: Gi0/3.31
> IF-MIB::ifName.10 = STRING: Gi0/3.56
> 
> There is cutted cfgmaker output, where is visible, that "Name" for Gi0/1
>  and Gi0/2 is EMPTY:
> 
> [mrtg at mole bin]$ ./cfgmaker --community=public --ifref=descr gw1.domain.com
>  | grep -i "^###"
> ### Global Config Options
> ### Global Defaults
> ######################################################################
> ######################################################################
> ### Interface 1 >> Descr: 'GigabitEthernet0/1' | Name: '' | Ip: '10.0.0.1'
>  | Eth: '00-11-21-49-f3-1b' ###
> ### Interface 2 >> Descr: 'GigabitEthernet0/2' | Name: '' | Ip: '10.0.0.5'
>  | Eth: '00-11-21-49-f3-1a' ###
> ### Interface 3 >> Descr: 'GigabitEthernet0/3' | Name: 'Gi0/3' | Ip: '' |
>  Eth: '' ###
> ### Interface 4 >> Descr: 'Null0' | Name: 'Nu0' | Ip: '' | Eth: '' ###
> ### The following interface is commented out because:
> ### * it is a cisco Null0 interface
> ### Interface 5 >> Descr: 'Loopback0' | Name: 'Lo0' | Ip: '192.168.1.1' |
>  Eth: '' ###
> ### The following interface is commented out because:
> ### * it is a Software Loopback interface
> ### Interface 6 >> Descr: 'GigabitEthernet0/1-mpls-layer' | Name: '' | Ip:
>  ''
> 
> | Eth: '' ###
> 
> ### Interface 7 >> Descr: 'GigabitEthernet0/2-mpls-layer' | Name: '' | Ip:
>  ''
> 
> | Eth: '' ###
> 
> ### Interface 8 >> Descr: 'GigabitEthernet0/3.26-802.1Q-vLAN-subif' | Name:
> 'Gi0/3.26' | Ip: '192.168.100.1' | Eth: '' ###
> ### Interface 9 >> Descr: 'GigabitEthernet0/3.31-802.1Q-vLAN-subif' | Name:
> 'Gi0/3.31' | Ip: '192.168.101.1' | Eth: '' ###
> ### The following interface is commented out because:
> ### * it is administratively DOWN
> ### * it is operationally DOWN
> ### Interface 10 >> Descr: 'GigabitEthernet0/3.56-802.1Q-vLAN-subif' |
>  Name: 'Gi0/3.56' | Ip: '192.168.102.1' | Eth: '' ###
> 
> Best regards,
> 
> Pavel Ruzicka



More information about the mrtg mailing list