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 propertyovpns devices:
### The following interface is commented out because: ### * has no ifSpeed propertyovpnc devices:
### The following interface is commented out because: ### * has no ifSpeed propertyNo 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 propertylo or lo0 :
### * it is a Software Loopback interface ### * has no ifSpeed propertypflog or pflog0 :
### * it is administratively DOWN ### * it is operationally DOWN ### * has no ifSpeed propertypfsync or pfsync0 :
### * it is administratively DOWN ### * it is operationally DOWN ### * has no ifSpeed propertyThe solution was to change cfgmaker arguments:
/usr/bin/cfgmaker --zero-speed=10000000 -o outfile.cfg community@objectAdditionally, --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@routerIf 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