[omd-commits] OMD Git: omd: check_icmp: finish patch, fix exit code

git version control git at mathias-kettner.de
Thu Sep 11 14:01:07 CEST 2014


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

Author:   Mathias Kettner <mk at mathias-kettner.de>
Date:     Thu Sep 11 14:01:02 2014 +0200
Commiter: Mathias Kettner <mk at mathias-kettner.de>
Date:     Thu Sep 11 14:01:02 2014 +0200

check_icmp: finish patch, fix exit code

---

 packages/monitoring-plugins/Makefile                |    1 +
 .../patches/0001-check-icmp-allows-pl-of-101.dif    |   19 ++++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/packages/monitoring-plugins/Makefile b/packages/monitoring-plugins/Makefile
index 8493ccd..7a9a000 100644
--- a/packages/monitoring-plugins/Makefile
+++ b/packages/monitoring-plugins/Makefile
@@ -9,6 +9,7 @@ CONFIGUREOPTS = \
     --libexecdir=$(OMD_ROOT)/lib/nagios/plugins
 
 build:
+	rm -rf $(DIR)
 	tar xzf $(DIR).tar.gz
 	set -e ; for p in patches/*.dif ; do \
 	    echo "applying $$p..." ; \
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
index a31289e..a2ab469 100644
--- 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
@@ -1,5 +1,7 @@
---- 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
+Only in monitoring-plugins-2.0: config.log
+diff -ru monitoring-plugins-2.0.orig/plugins-root/check_icmp.c monitoring-plugins-2.0/plugins-root/check_icmp.c
+--- monitoring-plugins-2.0.orig/plugins-root/check_icmp.c	2014-07-06 19:55:03.000000000 +0200
++++ monitoring-plugins-2.0/plugins-root/check_icmp.c	2014-09-11 13:58:42.693502323 +0200
 @@ -940,7 +940,9 @@
  			 * conspicuosly as missing entries in perfparse and cacti */
  			pl = 100;
@@ -20,7 +22,17 @@
  	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 @@
+@@ -980,7 +982,8 @@
+ 		}
+ 		i++;
+ 		if(!host->icmp_recv) {
+-			status = STATE_CRITICAL;
++			if (pl >= crit.pl)
++                            status = STATE_CRITICAL;
+ 			if(host->flags & FLAG_LOST_CAUSE) {
+ 				printf("%s: %s @ %s. rta nan, lost %d%%",
+ 					   host->name,
+@@ -1246,7 +1249,7 @@
  	if(!th->rta) return -1;
  
  	if(th->rta > MAXTTL * 1000000) th->rta = MAXTTL * 1000000;
@@ -29,3 +41,4 @@
  
  	return 0;
  }
+Only in monitoring-plugins-2.0/plugins-root: check_icmp.c.orig



More information about the omd-commits mailing list