Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface Errors percentage over 100% #307

Open
andytlc68 opened this issue Dec 1, 2022 · 0 comments
Open

Interface Errors percentage over 100% #307

andytlc68 opened this issue Dec 1, 2022 · 0 comments

Comments

@andytlc68
Copy link

andytlc68 commented Dec 1, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant