summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElan Ruusamäe <glen@delfi.ee>2016-03-03 21:31:27 +0200
committerElan Ruusamäe <glen@delfi.ee>2017-01-04 22:25:38 +0200
commit05ac8a98a85e748643e6f2ab268587e6f78244f6 (patch)
tree18acbeeb05895645dee92eb7de34b107c2889d8c
parent3fc149f4990358a91ca945f8b649a4c511722e73 (diff)
downloadmonitoring-plugins-05ac8a9.tar.gz
understang ping6 output from iputils package
-rw-r--r--plugins/check_ping.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 423ecbe5..36de7cf6 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -521,12 +521,13 @@ int
521error_scan (char buf[MAX_INPUT_BUFFER], const char *addr) 521error_scan (char buf[MAX_INPUT_BUFFER], const char *addr)
522{ 522{
523 if (strstr (buf, "Network is unreachable") || 523 if (strstr (buf, "Network is unreachable") ||
524 strstr (buf, "Destination Net Unreachable") 524 strstr (buf, "Destination Net Unreachable") ||
525 strstr (buf, "No route")
525 ) 526 )
526 die (STATE_CRITICAL, _("CRITICAL - Network Unreachable (%s)\n"), addr); 527 die (STATE_CRITICAL, _("CRITICAL - Network Unreachable (%s)\n"), addr);
527 else if (strstr (buf, "Destination Host Unreachable")) 528 else if (strstr (buf, "Destination Host Unreachable") || strstr(buf, "Address unreachable"))
528 die (STATE_CRITICAL, _("CRITICAL - Host Unreachable (%s)\n"), addr); 529 die (STATE_CRITICAL, _("CRITICAL - Host Unreachable (%s)\n"), addr);
529 else if (strstr (buf, "Destination Port Unreachable")) 530 else if (strstr (buf, "Destination Port Unreachable") || strstr(buf, "Port unreachable"))
530 die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"), addr); 531 die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"), addr);
531 else if (strstr (buf, "Destination Protocol Unreachable")) 532 else if (strstr (buf, "Destination Protocol Unreachable"))
532 die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"), addr); 533 die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"), addr);
@@ -534,11 +535,11 @@ error_scan (char buf[MAX_INPUT_BUFFER], const char *addr)
534 die (STATE_CRITICAL, _("CRITICAL - Network Prohibited (%s)\n"), addr); 535 die (STATE_CRITICAL, _("CRITICAL - Network Prohibited (%s)\n"), addr);
535 else if (strstr (buf, "Destination Host Prohibited")) 536 else if (strstr (buf, "Destination Host Prohibited"))
536 die (STATE_CRITICAL, _("CRITICAL - Host Prohibited (%s)\n"), addr); 537 die (STATE_CRITICAL, _("CRITICAL - Host Prohibited (%s)\n"), addr);
537 else if (strstr (buf, "Packet filtered")) 538 else if (strstr (buf, "Packet filtered") || strstr(buf, "Administratively prohibited"))
538 die (STATE_CRITICAL, _("CRITICAL - Packet Filtered (%s)\n"), addr); 539 die (STATE_CRITICAL, _("CRITICAL - Packet Filtered (%s)\n"), addr);
539 else if (strstr (buf, "unknown host" )) 540 else if (strstr (buf, "unknown host" ))
540 die (STATE_CRITICAL, _("CRITICAL - Host not found (%s)\n"), addr); 541 die (STATE_CRITICAL, _("CRITICAL - Host not found (%s)\n"), addr);
541 else if (strstr (buf, "Time to live exceeded")) 542 else if (strstr (buf, "Time to live exceeded") || strstr(buf, "Time exceeded"))
542 die (STATE_CRITICAL, _("CRITICAL - Time to live exceeded (%s)\n"), addr); 543 die (STATE_CRITICAL, _("CRITICAL - Time to live exceeded (%s)\n"), addr);
543 else if (strstr (buf, "Destination unreachable: ")) 544 else if (strstr (buf, "Destination unreachable: "))
544 die (STATE_CRITICAL, _("CRITICAL - Destination Unreachable (%s)\n"), addr); 545 die (STATE_CRITICAL, _("CRITICAL - Destination Unreachable (%s)\n"), addr);