[Pkg-nagios-changes] [pkg-nagios] r1876 - in nagios-plugins/trunk/debian: . patches

Jan Wagner waja at alioth.debian.org
Thu Apr 1 07:17:36 UTC 2010


Author: waja
Date: 2010-04-01 07:17:31 +0000 (Thu, 01 Apr 2010)
New Revision: 1876

Added:
   nagios-plugins/trunk/debian/patches/44_check_snmp_perfdata.dpatch
Modified:
   nagios-plugins/trunk/debian/changelog
   nagios-plugins/trunk/debian/patches/00list
Log:
Add 44_check_snmp_perfdata.dpatch to fix regression related perfdata

Modified: nagios-plugins/trunk/debian/changelog
===================================================================
--- nagios-plugins/trunk/debian/changelog	2010-03-29 02:32:31 UTC (rev 1875)
+++ nagios-plugins/trunk/debian/changelog	2010-04-01 07:17:31 UTC (rev 1876)
@@ -6,6 +6,7 @@
     - Provide package specific documentation with the packages
     - Provide symlinks from other packages
   * Remove debian/TODO cause it't totally outdated
+  * Add 44_check_snmp_perfdata.dpatch to fix regression related perfdata
 
  -- Jan Wagner <waja at cyconet.org>  Wed, 24 Mar 2010 20:24:51 +0100
 

Modified: nagios-plugins/trunk/debian/patches/00list
===================================================================
--- nagios-plugins/trunk/debian/patches/00list	2010-03-29 02:32:31 UTC (rev 1875)
+++ nagios-plugins/trunk/debian/patches/00list	2010-04-01 07:17:31 UTC (rev 1876)
@@ -19,3 +19,4 @@
 41_check_ping_detect_args.dpatch
 42_check_linux_raid_fix_r10.dpatch
 43_check_http_large_pages_mleak.dpatch
+44_check_snmp_perfdata.dpatch

Added: nagios-plugins/trunk/debian/patches/44_check_snmp_perfdata.dpatch
===================================================================
--- nagios-plugins/trunk/debian/patches/44_check_snmp_perfdata.dpatch	                        (rev 0)
+++ nagios-plugins/trunk/debian/patches/44_check_snmp_perfdata.dpatch	2010-04-01 07:17:31 UTC (rev 1876)
@@ -0,0 +1,41 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 44_check_snmp_perfdata.dpatch
+## From: Thomas Guyot-Sionnest <dermoth at aei.ca>
+## Date: Wed, 31 Mar 2010 06:45:45 +0000 (02:45 -0400)
+## Subject: [PATCH] Fix regression introduced in #1867716 where partially valid performance strings would not be printed anymore
+## X-Git-Url: http://repo.or.cz/w/nagiosplugins.git/blobdiff/e7e9a99117d7e0a7189393b3a04366393620efab..e5690e3ddaebdd98bfd96c2303453e4e0d7ed318:/plugins/check_snmp.c
+##
+## DP: Fix regression introduced in #1867716
+
+ at DPATCH@
+
+diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
+index dcb3138..fdb5819 100644
+--- a/plugins/check_snmp.c
++++ b/plugins/check_snmp.c
+@@ -117,7 +117,7 @@ int needmibs = FALSE;
+ int
+ main (int argc, char **argv)
+ {
+-	int i;
++	int i, len;
+ 	int iresult = STATE_UNKNOWN;
+ 	int result = STATE_UNKNOWN;
+ 	int return_code = 0;
+@@ -351,10 +351,14 @@ main (int argc, char **argv)
+ 		if (nunits > (size_t)0 && (size_t)i < nunits && unitv[i] != NULL)
+ 			asprintf (&outbuff, "%s %s", outbuff, unitv[i]);
+ 
+-		if (is_numeric(show)) {
++		/* Write perfdata with whatever can be parsed by strtod, if possible */
++		ptr = NULL;
++		strtod(show, &ptr);
++		if (ptr > show) {
+ 			strncat(perfstr, oidname, sizeof(perfstr)-strlen(perfstr)-1);
+ 			strncat(perfstr, "=", sizeof(perfstr)-strlen(perfstr)-1);
+-			strncat(perfstr, show, sizeof(perfstr)-strlen(perfstr)-1);
++			len = sizeof(perfstr)-strlen(perfstr)-1;
++			strncat(perfstr, show, len>ptr-show ? ptr-show : len);
+ 
+ 			if (type)
+ 				strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);




More information about the Pkg-nagios-changes mailing list