Closed Napsty closed 4 years ago
Sorry - my mistake. I wrongly misinterpretet octet as bit but it's actual 8 * 1 bit. Hence the calculation in the source code:
$self->{delta_ifInBits} = $self->{delta_ifInOctets} * 8;
$self->{delta_ifOutBits} = $self->{delta_ifOutOctets} * 8;
$self->{inputRate} = $self->{delta_ifInBits} / $self->{delta_timestamp};
$self->{outputRate} = $self->{delta_ifOutBits} / $self->{delta_timestamp};
If I adjust my manual calculations in the spread sheet and use 8*octet on all the octet based values, I get to the same traffic speed.
A discussion between network administrator and me lead to the conclusion that interface speeds are wrongly graphed in our Grafana which is using performance data coming via Icinga2 from check_nwc_health plugin. At first I suspected an error in the derive graph but then realized that the performance data are actual bit/s values, not a counter.
check_nwc_health seems to be using the inputRate and outputRate values to represent traffic (bit/s):
According to the source code, inputRate and outputRate are calculated like this: https://github.com/lausser/check_nwc_health/blob/master/plugins-scripts/Classes/IFMIB/Component/InterfaceSubsystem.pm#L750
I ran check_nwc_health once a minute for 20 minutes and looked at the input/incoming traffic values. I used the following command to get the raw data:
After 20 mins I stopped the process and created a spreadsheet with the data. Columns G-K contain Mbit/s calculations based on calculations of the different values. The Mbit/s calculation using inputRate is way off which suggests that the value of inputRate itself is wrongly calculated? I also tested the same with a more recent version of check_nwc_health but with the same results.
Am I making a mistake or misunderstanding somethign or can you confirm that the interface traffic is not correct?