diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2020-02-24 10:26:41 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2020-02-24 10:26:41 +0200 |
commit | 4352cb046a38b969d9b90447d27fe90c07fa43d9 (patch) | |
tree | 250b3ae00054407e5b45e769de9cf9c4b04e167c | |
parent | b42866f337ced2942eca3d02a23813536c108452 (diff) | |
download | ping903-4352cb046a38b969d9b90447d27fe90c07fa43d9.tar.gz ping903-4352cb046a38b969d9b90447d27fe90c07fa43d9.tar.bz2 |
Fix nagios check output for unreachable hosts.
* src/ping903q.c (nagios_check): Fix output for unreachable hosts.
-rw-r--r-- | src/ping903q.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ping903q.c b/src/ping903q.c index 9e7a350..7bc35e1 100644 --- a/src/ping903q.c +++ b/src/ping903q.c @@ -684,7 +684,8 @@ nagios_check(struct json_value *obj, void *data) printf("PING %s UNKNOWN - waiting for data to arrive\n", name); exit(EX_NAGIOS_UNKNOWN); } - if (strcmp(jv->v.s, "invalid") == 0) { + if (strcmp(jv->v.s, "invalid") == 0 + || json_object_get(obj, "stddev", &jv)) { printf("PING %s CRITICAL - Packet loss = 100%%", name); print_perfdata(cd->cth.round_trip, 100.0, cd); exit(EX_NAGIOS_CRITICAL); |