[mrtg] cfgmaker and not unique ifName

Pavel Ruzicka pavouk at pavouk.org
Thu May 6 16:42:01 CEST 2010


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