You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have started to use check_interfaces and found a possible problem with the evaluation logic.
When I use the bandwith parameter the checkresult will show a warning in the second line of the output if the threshold is reached. However the overall status will still show ok.
I described the probelm at the Icinga2 community page, because I was not sure that the observed behaviour was wanted. https://community.icinga.com/t/question-about-plugin-output-and-the-service-status/1918/6
Michael Friedrich answered my questions and directed me to github to file an issue.
I have looked at the sourcecode of snmp_bulkget.c and found at line 1031 a possible fix for the problem.
Here is the original code:
if (lastcheck && (interfaces[i].speed || speed)) {
inbitps = (subtract64(interfaces[i].inOctets, oldperfdata[i].inOctets) / (u64)lastcheck) * 8ULL;
outbitps = (subtract64(interfaces[i].outOctets, oldperfdata[i].outOctets) / (u64)lastcheck) * 8ULL;
if (speed) {
inload = (long double)inbitps / ((long double)speed/100L);
outload = (long double)outbitps / ((long double)speed/100L);
} else {
/* use the interface speed if a speed is not given */
inload = (long double)inbitps / ((long double)interfaces[i].speed/100L);
outload = (long double)outbitps / ((long double)interfaces[i].speed/100L);
}
if ( (bw > 0) && ((int)inload > bw || (int)outload > bw))
warn++;
}
I've changed it to the following:
if (lastcheck && (interfaces[i].speed || speed)) {
inbitps = (subtract64(interfaces[i].inOctets, oldperfdata[i].inOctets) / (u64)lastcheck) * 8ULL;
outbitps = (subtract64(interfaces[i].outOctets, oldperfdata[i].outOctets) / (u64)lastcheck) * 8ULL;
if (speed) {
inload = (long double)inbitps / ((long double)speed/100L);
outload = (long double)outbitps / ((long double)speed/100L);
} else {
/* use the interface speed if a speed is not given */
inload = (long double)inbitps / ((long double)interfaces[i].speed/100L);
outload = (long double)outbitps / ((long double)interfaces[i].speed/100L);
}
if ( (bw > 0) && ((int)inload > bw || (int)outload > bw)) {
warnflag++;
warn++;
}
}
I’ve extended the last if clause with “warnflag++” and put it in curly braces.
I hope that this is usefull. This is my very first post at github and I am a little bit scared (I am not a programmer at all :-) )
Kind regards
Bjoern
The text was updated successfully, but these errors were encountered:
SuperPlusUser
added a commit
to SuperPlusUser/check_interfaces
that referenced
this issue
Dec 2, 2019
- Change overall status to "warning" if an interface exceeds bandwidth limit (see NETWAYS#8 thanks to Bjoern-10101 )
- Do not show (incorrect) performance data for Interfaces which are admin down
- Correct output for down interfaces if crit_on_down_flag is not true
Hi,
I have started to use check_interfaces and found a possible problem with the evaluation logic.
When I use the bandwith parameter the checkresult will show a warning in the second line of the output if the threshold is reached. However the overall status will still show ok.
I described the probelm at the Icinga2 community page, because I was not sure that the observed behaviour was wanted. https://community.icinga.com/t/question-about-plugin-output-and-the-service-status/1918/6
Michael Friedrich answered my questions and directed me to github to file an issue.
I have looked at the sourcecode of snmp_bulkget.c and found at line 1031 a possible fix for the problem.
Here is the original code:
I've changed it to the following:
I’ve extended the last if clause with “warnflag++” and put it in curly braces.
I hope that this is usefull. This is my very first post at github and I am a little bit scared (I am not a programmer at all :-) )
Kind regards
Bjoern
The text was updated successfully, but these errors were encountered: