summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a25083f)
raw | patch | inline | side by side (parent: a25083f)
author | Matthias Eble <psychotrahe@users.sourceforge.net> | |
Wed, 9 Jul 2008 21:53:12 +0000 (21:53 +0000) | ||
committer | Matthias Eble <psychotrahe@users.sourceforge.net> | |
Wed, 9 Jul 2008 21:53:12 +0000 (21:53 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2021 f882894a-f735-0410-b71e-b25c423dba1c
NEWS | patch | blob | history | |
plugins/check_snmp.c | patch | blob | history |
index 64221524b47cb8c515fb25ff68d7e83ef0c50d64..3b95babc7fe754911c00b170268832335b4b85a5 100644 (file)
--- a/NEWS
+++ b/NEWS
Fix Debian bug #479013: check_dig's -l is mandatory now (sf.net #1986306)
check_dig now returns CRITICAL instead of WARNING when no answer section is found
check_procs now captures stderr in external command and adds to plugin output
+ check_snmp now only prints perfdata for non numeric values (#1867716)
1.4.12 27th May 2008
Added ./check_nt -v INSTANCES to count number of instances (Alessandro Ren)
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 0acade256e8159f79b8db00cf62f84ed98a18a41..544c5c0b281c05f61bd8a7c2729e8aca179633d2 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
strncat(perfstr, "| ", sizeof(perfstr)-strlen(perfstr)-1);
while (ptr) {
- char *foo;
+ char *foo, *ptr2;
unsigned int copylen;
foo = strstr (ptr, delimiter);
copylen = foo-ptr;
if (copylen > sizeof(perfstr)-strlen(perfstr)-1)
copylen = sizeof(perfstr)-strlen(perfstr)-1;
- strncat(perfstr, ptr, copylen);
+ ptr2 = ptr;
ptr = foo;
if (ptr == NULL)
i++;
- strncat(perfstr, "=", sizeof(perfstr)-strlen(perfstr)-1);
- strncat(perfstr, show, sizeof(perfstr)-strlen(perfstr)-1);
- if (type)
- strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
- strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1);
+ if (is_numeric(show)) {
+ strncat(perfstr, ptr2, copylen);
+ strncat(perfstr, "=", sizeof(perfstr)-strlen(perfstr)-1);
+ strncat(perfstr, show, sizeof(perfstr)-strlen(perfstr)-1);
+
+ if (type)
+ strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
+ strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1);
+ }
} /* end while (ptr) */