Skip to content

Commit

Permalink
Fix nagios-plugins#510 - perfdata tags should remain the same even if…
Browse files Browse the repository at this point in the history
… packet loss is at 100%
  • Loading branch information
sawolf committed Jan 14, 2020
1 parent f94a75a commit a34c8ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions NEWS
@@ -1,5 +1,9 @@
This file documents the major additions and syntax changes between releases.

2.3.2 ????-??-??
FIXES
check_icmp: All performance data tags should show when packet loss is 100% (#510)

2.3.1 2019-12-09
FIXES
check_icmp: Fixed backward-compatibility issue with performance data (#480)
Expand Down
10 changes: 5 additions & 5 deletions plugins-root/check_icmp.c
Expand Up @@ -1592,7 +1592,7 @@ static void finish(int sig) {
if (debug) {
puts("");
}
if (rta_mode && host->pl < 100) {
if (rta_mode) {
printf("%srta=%0.3fms;%0.3f;%0.3f;0; ",
(targets > 1) ? host->name : "", (float)host->rta / 1000,
(float)warn.rta / 1000, (float)crit.rta / 1000);
Expand All @@ -1601,24 +1601,24 @@ static void finish(int sig) {
printf("%spl=%u%%;%u;%u;0;100 ", (targets > 1) ? host->name : "",
host->pl, warn.pl, crit.pl);
}
if (rta_mode && host->pl < 100) {
if (rta_mode) {
printf("%srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ",
(targets > 1) ? host->name : "", (float)host->rtmax / 1000,
(targets > 1) ? host->name : "", (float)host->rtmin / 1000);
}
if (jitter_mode && host->pl < 100) {
if (jitter_mode) {
printf("%sjitter_avg=%0.3fms;%0.3f;%0.3f;0; %sjitter_max=%0.3fms;;;; "
"%sjitter_min=%0.3fms;;;; ",
(targets > 1) ? host->name : "", (float)host->jitter,
(float)warn.jitter, (float)crit.jitter,
(targets > 1) ? host->name : "", (float)host->jitter_max / 1000,
(targets > 1) ? host->name : "", (float)host->jitter_min / 1000);
}
if (mos_mode && host->pl < 100) {
if (mos_mode) {
printf("%smos=%0.1f;%0.1f;%0.1f;0;5 ", (targets > 1) ? host->name : "",
(float)host->mos, (float)warn.mos, (float)crit.mos);
}
if (score_mode && host->pl < 100) {
if (score_mode) {
printf("%sscore=%u;%u;%u;0;100 ", (targets > 1) ? host->name : "",
(int)host->score, (int)warn.score, (int)crit.score);
}
Expand Down

0 comments on commit a34c8ff

Please sign in to comment.