[Nagiosplug-checkins] nagiosplug/plugins check_ping.c,1.56,1.57

Thomas Guyot dermoth at users.sourceforge.net
Sat Jan 6 07:41:49 CET 2007


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7294/plugins

Modified Files:
	check_ping.c 
Log Message:
Fix bug #1629008: check_ping fails to handle Packet filtered error


Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- check_ping.c	6 Jan 2007 06:33:17 -0000	1.56
+++ check_ping.c	6 Jan 2007 06:41:47 -0000	1.57
@@ -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"))





More information about the Commits mailing list