summaryrefslogtreecommitdiffstats
path: root/web/attachments/209994-check_ping.response_handling.patch
blob: f86141ca95379d652cb681d67ed040e7e80f449f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Index: plugins/check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.55
diff -u -r1.55 check_ping.c
--- plugins/check_ping.c	6 Jan 2007 04:52:58 -0000	1.55
+++ plugins/check_ping.c	6 Jan 2007 06:08:11 -0000
@@ -503,10 +503,22 @@
 int
 error_scan (char buf[MAX_INPUT_BUFFER], const char *addr)
 {
-	if (strstr (buf, "Network is unreachable"))
-		die (STATE_CRITICAL, _("CRITICAL - Network unreachable (%s)"), addr);
+	if (strstr (buf, "Network is unreachable") ||
+		strstr (buf, "Destination Net Unreachable")
+		)
+		die (STATE_CRITICAL, _("CRITICAL - Network Unreachable (%s)"), addr);
 	else if (strstr (buf, "Destination Host Unreachable"))
 		die (STATE_CRITICAL, _("CRITICAL - Host Unreachable (%s)"), addr);
+	else if (strstr (buf, "Destination Port Unreachable"))
+		die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Port Unreachable (%s)"), addr);
+	else if (strstr (buf, "Destination Protocol Unreachable"))
+		die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Protocol Unreachable (%s)"), addr);
+	else if (strstr (buf, "Destination Net Prohibited"))
+		die (STATE_CRITICAL, _("CRITICAL - Network Prohibited (%s)"), addr);
+	else if (strstr (buf, "Destination Host Prohibited"))
+		die (STATE_CRITICAL, _("CRITICAL - Host Prohibited (%s)"), addr);
+	else if (strstr (buf, "Packet filtered"))
+		die (STATE_CRITICAL, _("CRITICAL - Packet Filtered (%s)"), addr);
 	else if (strstr (buf, "unknown host" ))
 		die (STATE_CRITICAL, _("CRITICAL - Host not found (%s)"), addr);
 	else if (strstr (buf, "Time to live exceeded"))