aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_ping.c
diff options
context:
space:
mode:
authorGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2007-01-06 06:41:47 +0000
committerGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2007-01-06 06:41:47 +0000
commit142b9da7c0b0c0b24cd3bbfbf42c4df165588869 (patch)
tree38593bcf86895c26ec6f41cec8c267540ab1c012 /plugins/check_ping.c
parentc653cd701020d9a23434cb3b713cabf308666ef8 (diff)
downloadmonitoring-plugins-142b9da7c0b0c0b24cd3bbfbf42c4df165588869.tar.gz
Fix bug #1629008: check_ping fails to handle Packet filtered error
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1563 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_ping.c')
-rw-r--r--plugins/check_ping.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index eb3a6dbf..ca40920c 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -503,10 +503,22 @@ run_ping (const char *cmd, const char *addr)
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"))