[omd-commits] OMD Git: omd: check_icmp: allow levels for packet loss > 100%

git version control git at mathias-kettner.de
Thu Sep 11 13:50:36 CEST 2014


Module:   omd
Branch:   master
Commit:   da6fc54000ff03b8d7330f40b77fa2478185e406
URL:      http://omdistro.org/projects/omd/repository/revisions/da6fc54000ff03b8d7330f40b77fa2478185e406

Author:   Mathias Kettner <mk at mathias-kettner.de>
Date:     Thu Sep 11 13:50:22 2014 +0200
Commiter: Mathias Kettner <mk at mathias-kettner.de>
Date:     Thu Sep 11 13:50:22 2014 +0200

check_icmp: allow levels for packet loss > 100%

---

 packages/monitoring-plugins/Makefile               |    8 ++---
 .../patches/0001-check-icmp-allows-pl-of-101.dif   |   31 ++++++++++++++++++++
 packages/monitoring-plugins/patches/README         |   14 +++++----
 3 files changed, 43 insertions(+), 10 deletions(-)

diff --git a/packages/monitoring-plugins/Makefile b/packages/monitoring-plugins/Makefile
index 3e31e3f..8493ccd 100644
--- a/packages/monitoring-plugins/Makefile
+++ b/packages/monitoring-plugins/Makefile
@@ -10,10 +10,10 @@ CONFIGUREOPTS = \
 
 build:
 	tar xzf $(DIR).tar.gz
-	#set -e ; for p in patches/*.dif ; do \
-	#    echo "applying $$p..." ; \
-	#    ( cd $(DIR) ; patch -p1 -b ) < $$p ; \
-	#done
+	set -e ; for p in patches/*.dif ; do \
+	    echo "applying $$p..." ; \
+	    ( cd $(DIR) ; patch -p1 -b ) < $$p ; \
+	done
 	cd $(DIR) ; ./configure $(CONFIGUREOPTS)
 	$(MAKE) -C $(DIR) all
 
diff --git a/packages/monitoring-plugins/patches/0001-check-icmp-allows-pl-of-101.dif b/packages/monitoring-plugins/patches/0001-check-icmp-allows-pl-of-101.dif
new file mode 100644
index 0000000..a31289e
--- /dev/null
+++ b/packages/monitoring-plugins/patches/0001-check-icmp-allows-pl-of-101.dif
@@ -0,0 +1,31 @@
+--- monitoring-plugins-2.0/plugins-root/check_icmp.c.orig	2014-09-11 13:33:32.743945623 +0200
++++ monitoring-plugins-2.0/plugins-root/check_icmp.c	2014-09-11 13:43:59.488254263 +0200
+@@ -940,7 +940,9 @@
+ 			 * conspicuosly as missing entries in perfparse and cacti */
+ 			pl = 100;
+ 			rta = 0;
+-			status = STATE_CRITICAL;
++			if (pl >= crit.pl)
++                            status = STATE_CRITICAL;
++
+ 			/* up the down counter if not already counted */
+ 			if(!(host->flags & FLAG_LOST_CAUSE) && targets_alive) targets_down++;
+ 		}
+@@ -964,7 +966,7 @@
+ 		host = host->next;
+ 	}
+ 	/* this is inevitable */
+-	if(!targets_alive) status = STATE_CRITICAL;
++	if(!targets_alive && crit.pl <= 100) status = STATE_CRITICAL;
+ 	if(min_hosts_alive > -1) {
+ 		if(hosts_ok >= min_hosts_alive) status = STATE_OK;
+ 		else if((hosts_ok + hosts_warn) >= min_hosts_alive) status = STATE_WARNING;
+@@ -1246,7 +1248,7 @@
+ 	if(!th->rta) return -1;
+ 
+ 	if(th->rta > MAXTTL * 1000000) th->rta = MAXTTL * 1000000;
+-	if(th->pl > 100) th->pl = 100;
++	if(th->pl > 101) th->pl = 101;
+ 
+ 	return 0;
+ }
diff --git a/packages/monitoring-plugins/patches/README b/packages/monitoring-plugins/patches/README
index 62d89b2..d6c5762 100644
--- a/packages/monitoring-plugins/patches/README
+++ b/packages/monitoring-plugins/patches/README
@@ -1,7 +1,9 @@
-0001-fix-compile-error-on-raring.dif:
-    This patch fixes a compile error on Ubuntu 13.04 (raring).
-    The unpatched version complains about a missing gets. This
-    results from a over-ambitious check in some stdio.h replacement
-    that is created in compile time. The patch simply disables
-    this check.
+0001-check-icmp-allows-pl-of-101.dif
+    This patch allows to configure check_icmp in a way that a packet loss of
+    100% is not CRITICAL. Consider:
 
+    check_icmp 10.1.1.1 -t1 -w500,80% -c1000,101%
+
+    In this case the user would expect the outcome to be WARN, if 100%
+    packats are lost. An RTA is "nan" in this case. But check_icmp would
+    insist to make the outcome CRITICAL. The patch fixes this.



More information about the omd-commits mailing list