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

Wrong DiscardsPercent for check_nwc_health mode interface-health (FIX) #298

Open
attiliobroglio opened this issue Mar 7, 2022 · 2 comments

Comments

@attiliobroglio
Copy link

Using the check_nwc_health (10.0.0.2), mode interface-health on a Fortinet (but also other vendor/device), I obtain weird values of percentage of discarded in /out packets. It exceeds the 100% (for example 5716%).
Analyzing the device interface via SNMP I see that the interface is generating not so much traffic (delta=128), but a very high number of discarded packets (delta=7317), so I check the code.
In my opinion, the formula used to compute this percentage is not correct, because it doesn't take into account the number of discarded packets in the denominator. So I fix the code in this way (line 73907).

  • Actual Formula: 100 * 7317/128=5716%
  • Proposed Formula: 100 * 7317/(128+7317) = 98,28%

Percentage of Percent of Discards In:

    $self->{inputDiscardsPercent} = $self->{delta_ifInPkts} == 0 ? 0 :
#       100 * $self->{delta_ifInDiscards} / $self->{delta_ifInPkts};
        100 * $self->{delta_ifInDiscards} / ($self->{delta_ifInPkts} + $self->{delta_ifInDiscards});

Percentage of Percent of Discards Out:

    $self->{outputDiscardsPercent} = $self->{delta_ifOutPkts} == 0 ? 0 :
#       100 * $self->{delta_ifOutDiscards} / $self->{delta_ifOutPkts};
        100 * $self->{delta_ifOutDiscards} / ($self->{delta_ifOutPkts} + $self->{delta_ifOutDiscards});

From your point of view, is this proposed fix a valid solution?
Hope this helps

@andytlc68
Copy link

I agree with "attiliobroglio".
I had the same problem and the only way was to change the formula.
If you agree with this change, it might be a good idea to implement the change/fix in the next check_nwc_health release.
Best regards ..

@log1-c
Copy link

log1-c commented Jun 21, 2022

The issue also exists with Cisco C3750 switches Cisco IOS Software, C3750E Software (C3750E-UNIVERSALK9-M), Version 12.2(58)SE1

CRITICAL - interface GigabitEthernet3/0/5 (alias ***MPLS Router***) discards in:0.00% out:158.01% , [...]

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

3 participants