--- plugins/check_ping.c.t 2004-08-26 15:44:31.000000000 -0700 +++ plugins/check_ping.c 2004-08-26 16:09:14.000000000 -0700 @@ -388,6 +388,16 @@ strcpy (warn_text, WARN_DUPLICATES); } + /* RHEL 3 puts Destination Host Unreachable messages on stdout, + * not stderr + */ + if (strstr (input_buffer, "Network is unreachable")) + terminate (STATE_CRITICAL, "PING CRITICAL - Network unreachable (%s)", + server_address); + else if (strstr (input_buffer, "Destination Host Unreachable")) + terminate (STATE_CRITICAL, "PING CRITICAL - Host Unreachable (%s)", + server_address); + /* get the percent loss statistics */ if (sscanf (input_buffer, "%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss", @@ -400,6 +410,13 @@ || sscanf (input_buffer, "%*d packets transmitted, %*d received, %d%% loss, time", &pl) == 1 /* Suse 8.0 as reported by Richard * Brodie */ + || sscanf + (input_buffer, "%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss, time", &pl) == 1 + /* 5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4018ms */ + /* 5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 4021ms */ + || sscanf + (input_buffer, "%*d packets transmitted, %*d received, %d%% packet loss, time", &pl) == 1 + /* Above two are for RHEL 3 as reported by Dan Stromberg */ ) continue;