lausser / check_nwc_health

nwc = network component. This plugin checks lots of aspects of routers, switches, wlan controllers, firewalls,.....
http://labs.consol.de/nagios/check_nwc_health
GNU General Public License v2.0
146 stars 88 forks source link

Interface Errors percentage over 100% #307

Open andytlc68 opened 1 year ago

andytlc68 commented 1 year ago

Using the check_nwc_health (10.0.0.2), mode interface-health, I obtain weird values of percentage of errors in /out. It exceeds the 100% (for example 165%). In my opinion, the formula used to compute this percentage is not correct, because it doesn't take into account the number of errors in the denominator. So I fix the code in this way:

Percentage of Percent of Errors In:

$self->{inputErrorsPercent} = $self->{delta_ifInPkts} == 0 ? 0 :

original: 100 $self->{delta_ifInErrors} / $self->{delta_ifInPkts}; my fix: 100 $self->{delta_ifInErrors} / ($self->{delta_ifInErrors} + $self->{delta_ifInPkts});

Percentage of Percent of Errors Out:

$self->{outputErrorsPercent} = $self->{delta_ifOutPkts} == 0 ? 0 :

original: 100 $self->{delta_ifOutErrors} / $self->{delta_ifOutPkts}; my fix: 100 $self->{delta_ifOutErrors} / ($self->{delta_ifOutErrors} + $self->{delta_ifOutPkts});

If you are agree with me, I propose a fix for the next release. Hope this helps