diff options
Diffstat (limited to 'plugins/check_fping.c')
-rw-r--r-- | plugins/check_fping.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/check_fping.c b/plugins/check_fping.c index c7cce97d..dad000e6 100644 --- a/plugins/check_fping.c +++ b/plugins/check_fping.c | |||
@@ -177,8 +177,10 @@ textscan (char *buf) | |||
177 | { | 177 | { |
178 | char *rtastr = NULL; | 178 | char *rtastr = NULL; |
179 | char *losstr = NULL; | 179 | char *losstr = NULL; |
180 | char *xmtstr = NULL; | ||
180 | double loss; | 181 | double loss; |
181 | double rta; | 182 | double rta; |
183 | double xmt; | ||
182 | int status = STATE_UNKNOWN; | 184 | int status = STATE_UNKNOWN; |
183 | 185 | ||
184 | if (strstr (buf, "not found")) { | 186 | if (strstr (buf, "not found")) { |
@@ -230,7 +232,12 @@ textscan (char *buf) | |||
230 | } | 232 | } |
231 | else if(strstr (buf, "xmt/rcv/%loss") ) { | 233 | else if(strstr (buf, "xmt/rcv/%loss") ) { |
232 | /* no min/max/avg if host was unreachable in fping v2.2.b1 */ | 234 | /* no min/max/avg if host was unreachable in fping v2.2.b1 */ |
235 | /* in v2.4b2: 10.99.0.1 : xmt/rcv/%loss = 0/0/0% */ | ||
233 | losstr = strstr (buf, "="); | 236 | losstr = strstr (buf, "="); |
237 | xmtstr = 1 + losstr; | ||
238 | xmt = strtod (xmtstr, NULL); | ||
239 | if(xmt == 0) | ||
240 | die (STATE_CRITICAL, _("FPING CRITICAL - %s is down\n"), server_name); | ||
234 | losstr = 1 + strstr (losstr, "/"); | 241 | losstr = 1 + strstr (losstr, "/"); |
235 | losstr = 1 + strstr (losstr, "/"); | 242 | losstr = 1 + strstr (losstr, "/"); |
236 | loss = strtod (losstr, NULL); | 243 | loss = strtod (losstr, NULL); |