1 --- nagios-plugins-1.4.16/plugins/check_ping.c~ 2012-12-06 16:43:57.000000000 +0200
2 +++ nagios-plugins-1.4.16/plugins/check_ping.c 2012-12-06 16:45:32.053840313 +0200
4 error_scan (char buf[MAX_INPUT_BUFFER], const char *addr)
6 if (strstr (buf, "Network is unreachable") ||
7 - strstr (buf, "Destination Net Unreachable")
8 + strstr (buf, "Destination Net Unreachable") ||
9 + strstr (buf, "No route")
11 die (STATE_CRITICAL, _("CRITICAL - Network Unreachable (%s)\n"), addr);
12 - else if (strstr (buf, "Destination Host Unreachable"))
13 + else if (strstr (buf, "Destination Host Unreachable") || strstr(buf, "Address unreachable"))
14 die (STATE_CRITICAL, _("CRITICAL - Host Unreachable (%s)\n"), addr);
15 - else if (strstr (buf, "Destination Port Unreachable"))
16 + else if (strstr (buf, "Destination Port Unreachable") || strstr(buf, "Port unreachable"))
17 die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"), addr);
18 else if (strstr (buf, "Destination Protocol Unreachable"))
19 die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"), addr);
21 die (STATE_CRITICAL, _("CRITICAL - Network Prohibited (%s)\n"), addr);
22 else if (strstr (buf, "Destination Host Prohibited"))
23 die (STATE_CRITICAL, _("CRITICAL - Host Prohibited (%s)\n"), addr);
24 - else if (strstr (buf, "Packet filtered"))
25 + else if (strstr (buf, "Packet filtered") || strstr(buf, "Administratively prohibited"))
26 die (STATE_CRITICAL, _("CRITICAL - Packet Filtered (%s)\n"), addr);
27 else if (strstr (buf, "unknown host" ))
28 die (STATE_CRITICAL, _("CRITICAL - Host not found (%s)\n"), addr);
29 - else if (strstr (buf, "Time to live exceeded"))
30 + else if (strstr (buf, "Time to live exceeded") || strstr(buf, "Time exceeded"))
31 die (STATE_CRITICAL, _("CRITICAL - Time to live exceeded (%s)\n"), addr);
32 else if (strstr (buf, "Destination unreachable: "))
33 die (STATE_CRITICAL, _("CRITICAL - Destination Unreachable (%s)\n"), addr);