diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-06-23 10:59:21 +0200 |
---|---|---|
committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-06-23 10:59:21 +0200 |
commit | 7e9519e0ad730ede8fad0503102e1373b8999be2 (patch) | |
tree | 3a8906dadb70e3aa63c5922a035ee2b6b2431fd1 /plugins-root/check_icmp.c | |
parent | b08bafc45cea008abb46e0891c55e7745e117aae (diff) | |
download | monitoring-plugins-7e9519e0ad730ede8fad0503102e1373b8999be2.tar.gz |
check_icmp: correct output strings
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r-- | plugins-root/check_icmp.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 524e1fb9..3edfffa2 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c | |||
@@ -2279,10 +2279,10 @@ mp_subcheck evaluate_target(ping_target target, check_icmp_mode_switches modes, | |||
2279 | 2279 | ||
2280 | if (rta >= crit.rta) { | 2280 | if (rta >= crit.rta) { |
2281 | sc_rta = mp_set_subcheck_state(sc_rta, STATE_CRITICAL); | 2281 | sc_rta = mp_set_subcheck_state(sc_rta, STATE_CRITICAL); |
2282 | xasprintf(&sc_rta.output, "%s > %0.3fms", sc_rta.output, (double)crit.rta / 1000); | 2282 | xasprintf(&sc_rta.output, "%s >= %0.3fms", sc_rta.output, (double)crit.rta / 1000); |
2283 | } else if (rta >= warn.rta) { | 2283 | } else if (rta >= warn.rta) { |
2284 | sc_rta = mp_set_subcheck_state(sc_rta, STATE_WARNING); | 2284 | sc_rta = mp_set_subcheck_state(sc_rta, STATE_WARNING); |
2285 | xasprintf(&sc_rta.output, "%s > %0.3fms", sc_rta.output, (double)warn.rta / 1000); | 2285 | xasprintf(&sc_rta.output, "%s >= %0.3fms", sc_rta.output, (double)warn.rta / 1000); |
2286 | } | 2286 | } |
2287 | 2287 | ||
2288 | if (packet_loss < 100) { | 2288 | if (packet_loss < 100) { |
@@ -2319,10 +2319,10 @@ mp_subcheck evaluate_target(ping_target target, check_icmp_mode_switches modes, | |||
2319 | 2319 | ||
2320 | if (packet_loss >= crit.pl) { | 2320 | if (packet_loss >= crit.pl) { |
2321 | sc_pl = mp_set_subcheck_state(sc_pl, STATE_CRITICAL); | 2321 | sc_pl = mp_set_subcheck_state(sc_pl, STATE_CRITICAL); |
2322 | xasprintf(&sc_pl.output, "%s > %u%%", sc_pl.output, crit.pl); | 2322 | xasprintf(&sc_pl.output, "%s >= %u%%", sc_pl.output, crit.pl); |
2323 | } else if (packet_loss >= warn.pl) { | 2323 | } else if (packet_loss >= warn.pl) { |
2324 | sc_pl = mp_set_subcheck_state(sc_pl, STATE_WARNING); | 2324 | sc_pl = mp_set_subcheck_state(sc_pl, STATE_WARNING); |
2325 | xasprintf(&sc_pl.output, "%s > %u%%", sc_pl.output, crit.pl); | 2325 | xasprintf(&sc_pl.output, "%s >= %u%%", sc_pl.output, warn.pl); |
2326 | } | 2326 | } |
2327 | 2327 | ||
2328 | mp_perfdata pd_pl = perfdata_init(); | 2328 | mp_perfdata pd_pl = perfdata_init(); |
@@ -2345,10 +2345,10 @@ mp_subcheck evaluate_target(ping_target target, check_icmp_mode_switches modes, | |||
2345 | 2345 | ||
2346 | if (target.jitter >= crit.jitter) { | 2346 | if (target.jitter >= crit.jitter) { |
2347 | sc_jitter = mp_set_subcheck_state(sc_jitter, STATE_CRITICAL); | 2347 | sc_jitter = mp_set_subcheck_state(sc_jitter, STATE_CRITICAL); |
2348 | xasprintf(&sc_jitter.output, "%s > %0.3fms", sc_jitter.output, crit.jitter); | 2348 | xasprintf(&sc_jitter.output, "%s >= %0.3fms", sc_jitter.output, crit.jitter); |
2349 | } else if (target.jitter >= warn.jitter) { | 2349 | } else if (target.jitter >= warn.jitter) { |
2350 | sc_jitter = mp_set_subcheck_state(sc_jitter, STATE_WARNING); | 2350 | sc_jitter = mp_set_subcheck_state(sc_jitter, STATE_WARNING); |
2351 | xasprintf(&sc_jitter.output, "%s > %0.3fms", sc_jitter.output, warn.jitter); | 2351 | xasprintf(&sc_jitter.output, "%s >= %0.3fms", sc_jitter.output, warn.jitter); |
2352 | } | 2352 | } |
2353 | 2353 | ||
2354 | if (packet_loss < 100) { | 2354 | if (packet_loss < 100) { |
@@ -2382,10 +2382,10 @@ mp_subcheck evaluate_target(ping_target target, check_icmp_mode_switches modes, | |||
2382 | 2382 | ||
2383 | if (mos <= crit.mos) { | 2383 | if (mos <= crit.mos) { |
2384 | sc_mos = mp_set_subcheck_state(sc_mos, STATE_CRITICAL); | 2384 | sc_mos = mp_set_subcheck_state(sc_mos, STATE_CRITICAL); |
2385 | xasprintf(&sc_mos.output, "%s < %0.1f", sc_mos.output, crit.mos); | 2385 | xasprintf(&sc_mos.output, "%s <= %0.1f", sc_mos.output, crit.mos); |
2386 | } else if (mos <= warn.mos) { | 2386 | } else if (mos <= warn.mos) { |
2387 | sc_mos = mp_set_subcheck_state(sc_mos, STATE_WARNING); | 2387 | sc_mos = mp_set_subcheck_state(sc_mos, STATE_WARNING); |
2388 | xasprintf(&sc_mos.output, "%s < %0.1f", sc_mos.output, warn.mos); | 2388 | xasprintf(&sc_mos.output, "%s <= %0.1f", sc_mos.output, warn.mos); |
2389 | } | 2389 | } |
2390 | 2390 | ||
2391 | if (packet_loss < 100) { | 2391 | if (packet_loss < 100) { |
@@ -2394,8 +2394,8 @@ mp_subcheck evaluate_target(ping_target target, check_icmp_mode_switches modes, | |||
2394 | pd_mos.value = mp_create_pd_value(mos); | 2394 | pd_mos.value = mp_create_pd_value(mos); |
2395 | pd_mos.warn = mp_range_set_end(pd_mos.warn, mp_create_pd_value(warn.mos)); | 2395 | pd_mos.warn = mp_range_set_end(pd_mos.warn, mp_create_pd_value(warn.mos)); |
2396 | pd_mos.crit = mp_range_set_end(pd_mos.crit, mp_create_pd_value(crit.mos)); | 2396 | pd_mos.crit = mp_range_set_end(pd_mos.crit, mp_create_pd_value(crit.mos)); |
2397 | pd_mos.min = mp_create_pd_value(0); | 2397 | pd_mos.min = mp_create_pd_value(0); // MOS starts at 0 |
2398 | pd_mos.max = mp_create_pd_value(5); | 2398 | pd_mos.max = mp_create_pd_value(5); // MOS max is 5, by definition |
2399 | mp_add_perfdata_to_subcheck(&sc_mos, pd_mos); | 2399 | mp_add_perfdata_to_subcheck(&sc_mos, pd_mos); |
2400 | } | 2400 | } |
2401 | mp_add_subcheck_to_subcheck(&result, sc_mos); | 2401 | mp_add_subcheck_to_subcheck(&result, sc_mos); |
@@ -2408,10 +2408,10 @@ mp_subcheck evaluate_target(ping_target target, check_icmp_mode_switches modes, | |||
2408 | 2408 | ||
2409 | if (score <= crit.score) { | 2409 | if (score <= crit.score) { |
2410 | sc_score = mp_set_subcheck_state(sc_score, STATE_CRITICAL); | 2410 | sc_score = mp_set_subcheck_state(sc_score, STATE_CRITICAL); |
2411 | xasprintf(&sc_score.output, "%s < %f", sc_score.output, crit.score); | 2411 | xasprintf(&sc_score.output, "%s <= %f", sc_score.output, crit.score); |
2412 | } else if (score <= warn.score) { | 2412 | } else if (score <= warn.score) { |
2413 | sc_score = mp_set_subcheck_state(sc_score, STATE_WARNING); | 2413 | sc_score = mp_set_subcheck_state(sc_score, STATE_WARNING); |
2414 | xasprintf(&sc_score.output, "%s < %f", sc_score.output, warn.score); | 2414 | xasprintf(&sc_score.output, "%s <= %f", sc_score.output, warn.score); |
2415 | } | 2415 | } |
2416 | 2416 | ||
2417 | if (packet_loss < 100) { | 2417 | if (packet_loss < 100) { |