summaryrefslogtreecommitdiffstats
path: root/plugins/check_ping.c
diff options
context:
space:
mode:
authorSubhendu Ghosh <sghosh@users.sourceforge.net>2002-04-23 12:50:51 (GMT)
committerSubhendu Ghosh <sghosh@users.sourceforge.net>2002-04-23 12:50:51 (GMT)
commit288f40a0bbd8babac9dfdf5facdbd9f37bd1841f (patch)
treed2944324efe23a89e520e36fb089e2a4b9e66ec5 /plugins/check_ping.c
parent58fad23452357dae19db896c06c025592f6d34c9 (diff)
downloadmonitoring-plugins-288f40a0bbd8babac9dfdf5facdbd9f37bd1841f.tar.gz
corrected program name and added rtt patch for RH7.2+beta
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@17 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_ping.c')
-rw-r--r--plugins/check_ping.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index b61b41b..3a02597 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -10,7 +10,7 @@
10* 10*
11*****************************************************************************/ 11*****************************************************************************/
12 12
13#define PROGNAME "check_pgsql" 13#define PROGNAME "check_ping"
14#define REVISION "$Revision$" 14#define REVISION "$Revision$"
15#define COPYRIGHT "1999-2001" 15#define COPYRIGHT "1999-2001"
16#define AUTHOR "Ethan Galstad/Karl DeBisschop" 16#define AUTHOR "Ethan Galstad/Karl DeBisschop"
@@ -390,12 +390,14 @@ run_ping (char *command_line)
390 390
391 /* get the percent loss statistics */ 391 /* get the percent loss statistics */
392 if (sscanf 392 if (sscanf
393 (input_buffer, 393 (input_buffer, "%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss",
394 "%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss", 394 &pl) == 1
395 &pl) == 1 395 || sscanf
396 || sscanf (input_buffer, 396 (input_buffer, "%*d packets transmitted, %*d packets received, %d%% packet loss",
397 "%*d packets transmitted, %*d packets received, %d%% packet loss", 397 &pl) == 1
398 &pl) == 1) 398 || sscanf
399 (input_buffer, "%*d packets transmitted, %*d packets received, %d%% loss, time", &pl) == 1
400 )
399 continue; 401 continue;
400 402
401 /* get the round trip average */ 403 /* get the round trip average */
@@ -415,7 +417,10 @@ run_ping (char *command_line)
415 "round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f", 417 "round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f",
416 &rta) == 1 418 &rta) == 1
417 || sscanf (input_buffer, "round-trip (ms) min/avg/max = %*f/%f/%*f", 419 || sscanf (input_buffer, "round-trip (ms) min/avg/max = %*f/%f/%*f",
418 &rta) == 1) 420 &rta) == 1
421 || sscanf (input_buffer, "rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms",
422 &rta) == 1
423 )
419 continue; 424 continue;
420 } 425 }
421 426