bsnmpd ifSpeed MRTG cfgmaker workaround
-
MRTG cfgmaker gave this result for devices such as gif, lo, ovpnc, ovpns:
gif or gif0 :
### The following interface is commented out because: * has no ifSpeed property
ovpns devices:
### The following interface is commented out because: ### * has no ifSpeed property
ovpnc devices:
### The following interface is commented out because: ### * has no ifSpeed property
No effect for administratively DOWN or operationally DOWN interfaces, or softwareLoopback devices: e.g.:
enc or enc0 :
### * it is administratively DOWN ### * it is operationally DOWN ### * has no ifSpeed property
lo or lo0 :
### * it is a Software Loopback interface ### * has no ifSpeed property
pflog or pflog0 :
### * it is administratively DOWN ### * it is operationally DOWN ### * has no ifSpeed property
pfsync or pfsync0 :
### * it is administratively DOWN ### * it is operationally DOWN ### * has no ifSpeed property
The solution was to change cfgmaker arguments:
/usr/bin/cfgmaker --zero-speed=10000000 -o outfile.cfg community@object
Additionally, --ifdesc=descr changed the Title to start with device or device.vlan where appropriate.
Here is the site that gave me the hint:
https://aacable.wordpress.com/2014/07/07/mrtg-monitoring-with-esxi-hosted-guest-return-interface-is-commented-has-no-ifspeed-property/https://oss.oetiker.ch/mrtg/doc/cfgmaker.en.html
However, cfgmaker does not have an argument for enabling monitoring of loopback devices, though there is a more complicated method to work around that using something such as '--if-filter=($default_iftype && $if_admin)' with type 24, softwareLoopback as documented at the website above or something like below:
"--if-filter=($default || $if_type==24)"
The positional order is important, all flags need to precede community@router. --if-filter carries a caveat:
--if-filter=f Test every interface against filter f to decide wether or not to include that interface into the collection. Currently f is being evaluated as a Perl expression and it's truth value is used to reject or accept the interface. (Experimental, under development, might change)
The resulting command line argument contains double quotes:
/usr/bin/cfgmaker --ifdesc=descr --zero-speed=10000000 "--if-filter=($default || $if_type==24)" -o outfile.cfg community@router
If you run into an issue with the shell interpreting the contents, switch to the double quotes to single quotes.
Now lo0 is monitored by MRTG using bsnmpd. To monitor lo0 and everything ethernet:
/usr/bin/cfgmaker --ifdesc=descr --zero-speed=10000000 "--if-filter=($default || $if_type==24 || $if_type==6)" -o outfile.cfg community@router