[Pkg-nagios-changes] [pkg-nagios-plugins] 232/413: Add 44_check_snmp_perfdata.dpatch to fix regression related perfdata

Jan Wagner waja at moszumanska.debian.org
Tue Nov 26 23:13:27 UTC 2013


This is an automated email from the git hooks/post-receive script.

waja pushed a commit to branch master
in repository pkg-nagios-plugins.

commit 5c04a14b7249f6ce3db5b7c80b8462359212f270
Author: Jan Wagner <waja at cyconet.org>
Date:   Thu Apr 1 07:17:31 2010 +0000

    Add 44_check_snmp_perfdata.dpatch to fix regression related perfdata
---
 debian/changelog                             |  1 +
 debian/patches/00list                        |  1 +
 debian/patches/44_check_snmp_perfdata.dpatch | 41 ++++++++++++++++++++++++++++
 3 files changed, 43 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6dd73bb..91a75b3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ nagios-plugins (1.4.14-4) UNRELEASED; urgency=low
     - 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
 
diff --git a/debian/patches/00list b/debian/patches/00list
index d49f91e..197dad3 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -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
diff --git a/debian/patches/44_check_snmp_perfdata.dpatch b/debian/patches/44_check_snmp_perfdata.dpatch
new file mode 100644
index 0000000..9d1e55f
--- /dev/null
+++ b/debian/patches/44_check_snmp_perfdata.dpatch
@@ -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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins.git



More information about the Pkg-nagios-changes mailing list