# [mrtg] finding ifHC* counters by ifName

Pavel Ruzicka pavouk at pavouk.org
Tue Sep 4 10:01:40 CEST 2012

```Hi Adi,

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

cfgmaker can generate configuration based on ifDescr with option
--ifref=descr
This configuration you can use on every machine, where hostname, community
and ifDescr is same.

Best regards,

Pavel

> 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,