[mrtg] finding ifHC* counters by ifName

Adi Fairbank adi at adiraj.org
Mon Sep 3 23:21:31 CEST 2012


Hi Pavel,

Yes, I read that in the mrtg-reference manpage.  So first I tried:

Target[network_cume_bond0]: ifInOctets\bond0&ifOutOctets\bond0:public at localhost:::::2

but that only uses the 32bit counters, apparently since I explicitly asked for them with ifInOctets and ifOutOctets.  I understand that it would probably work if I just did something like:

Target[network_cume_bond0]: 2:public at localhost:::::2

but that wouldn't allow me to auto-detect by interface description (bond0).  This is important to me because I am working on an mrtg.cfg which is to be used on more than one server, and different servers have different interface configurations.

Thanks,
Adi

On Sep 3, 2012, at 2:13 PM, Pavel Ruzicka wrote:

> Hello Adi,
> 
> it is not needed to specify ifHCInOctets and ifHCOutOctets.
> If you specify SNMP version two with :::::2 on the end of target,
> that MRTG automatically try to use 64bit counters.
> 
> You can check existence of these counters with snmpwalk.
> Also check existence ifHighSpeed and ifSpeed which is used by cfgmaker
> for maxbytes value.
> 
> You can automatically generate MRTG configuration for your host
> with cfgmaker.
> 
> Best regards,
> 
> Pavel
> 
>> Is it possible in the current version of MRTG to target the
>> ifHC{In,Out}Octets by ifName?  I tried the following and it doesn't work:
>> 
>> Target[network_cume_bond0]:
>> ifHCInOctets#bond0&ifHCOutOctets#bond0:public at localhost:::::2
>> 
>> The error it throws is:
>> 
>> 2012-09-03 13:35:01 -- 2012-09-03 13:35:01: WARNING: could not match&get
>> localhost/ifHCInOctets for Name 'bond0'
>> 
>> When I snmpwalk, the ifName for bond0 is clearly there:
>> 
>> IF-MIB::ifName.1 = STRING: lo
>> IF-MIB::ifName.2 = STRING: eth0
>> IF-MIB::ifName.3 = STRING: eth1
>> IF-MIB::ifName.4 = STRING: bond0
>> 
>> So why couldn't it find it?
>> 
>> Thanks,
>> Adi



More information about the mrtg mailing list