summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1295c93)
raw | patch | inline | side by side (parent: 1295c93)
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | |
Wed, 5 Aug 2009 07:12:05 +0000 (03:12 -0400) | ||
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | |
Wed, 5 Aug 2009 07:13:08 +0000 (03:13 -0400) |
plugins/check_snmp.c | patch | blob | history |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index bb3d295e0f31fe0a14b822a7ccfeaf5f72648d1e..db16462bec5e20e7a53abbfc05c8bf4d32e21cb9 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
}else{
snmpcmd = strdup (PATH_TO_SNMPGET);
}
-
+
/* 9 arguments to pass before authpriv options + 1 for host and numoids. Add one for terminating NULL */
command_line = calloc (9 + numauthpriv + 1 + numoids + 1, sizeof (char *));
command_line[0] = snmpcmd;
ptr = chld_out.line[i];
oidname = strpcpy (oidname, ptr, delimiter);
response = strstr (ptr, delimiter);
+ if (response == NULL)
+ break;
+
if (verbose > 2) {
printf("Processing line %i\n oidname: %s\n response: %s\n", i+1, oidname, response);
}
- /* We strip out the datatype indicator for PHBs */
-
/* Clean up type array - Sol10 does not necessarily zero it out */
bzero(type, sizeof(type));
+ /* We strip out the datatype indicator for PHBs */
if (strstr (response, "Gauge: "))
show = strstr (response, "Gauge: ") + 7;
else if (strstr (response, "Gauge32: "))