oetiker / mrtg

MRTG - Multi Router Traffic Grapher
http://www.mrtg.org
247 stars 61 forks source link

SNMPv3 does not pull correct counters with multiple contexts on the same node #21

Open zibartsk opened 4 years ago

zibartsk commented 4 years ago

This functionality below actually prevents SNMPv3 multiple contexts working correctly when retrieving the same OID

%<-------------------------------- SNMP Request Optimization MRTG is designed to economize on its SNMP requests. Where a target definition appears more than once in the configuration file, MRTG requests the data from the device only once per round of data collection and uses the collected data for each instance of a particular target. Recognition of two target definitions as being identical is based on a simple string match rather than any kind of deeper semantic analysis. %<--------------------------------

What happens is that target line is actually identical (OID+IP) but what makes the difference is the context name in SnmpOptions. As a result all contexts will get the same value assigned for the same OID retrieved from the first poll. Workaround seems to be to change host name with mix of different lower and upper case letters for different contexts but would be nice to have a proper fix!

Thanks

oetiker commented 4 years ago

oh, in that case it would make sense to extract the context from the options and adding it to the key for looking up values ... PR welcome!

zibartsk commented 4 years ago

Not too sure if I will have time right now :( since i got the workaround playing with hostname mixing lower/iupper case letters and that works :)