diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_snmp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index bb3d295e..db16462b 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
@@ -186,7 +186,7 @@ main (int argc, char **argv) | |||
186 | }else{ | 186 | }else{ |
187 | snmpcmd = strdup (PATH_TO_SNMPGET); | 187 | snmpcmd = strdup (PATH_TO_SNMPGET); |
188 | } | 188 | } |
189 | 189 | ||
190 | /* 9 arguments to pass before authpriv options + 1 for host and numoids. Add one for terminating NULL */ | 190 | /* 9 arguments to pass before authpriv options + 1 for host and numoids. Add one for terminating NULL */ |
191 | command_line = calloc (9 + numauthpriv + 1 + numoids + 1, sizeof (char *)); | 191 | command_line = calloc (9 + numauthpriv + 1 + numoids + 1, sizeof (char *)); |
192 | command_line[0] = snmpcmd; | 192 | command_line[0] = snmpcmd; |
@@ -255,15 +255,17 @@ main (int argc, char **argv) | |||
255 | ptr = chld_out.line[i]; | 255 | ptr = chld_out.line[i]; |
256 | oidname = strpcpy (oidname, ptr, delimiter); | 256 | oidname = strpcpy (oidname, ptr, delimiter); |
257 | response = strstr (ptr, delimiter); | 257 | response = strstr (ptr, delimiter); |
258 | if (response == NULL) | ||
259 | break; | ||
260 | |||
258 | if (verbose > 2) { | 261 | if (verbose > 2) { |
259 | printf("Processing line %i\n oidname: %s\n response: %s\n", i+1, oidname, response); | 262 | printf("Processing line %i\n oidname: %s\n response: %s\n", i+1, oidname, response); |
260 | } | 263 | } |
261 | 264 | ||
262 | /* We strip out the datatype indicator for PHBs */ | ||
263 | |||
264 | /* Clean up type array - Sol10 does not necessarily zero it out */ | 265 | /* Clean up type array - Sol10 does not necessarily zero it out */ |
265 | bzero(type, sizeof(type)); | 266 | bzero(type, sizeof(type)); |
266 | 267 | ||
268 | /* We strip out the datatype indicator for PHBs */ | ||
267 | if (strstr (response, "Gauge: ")) | 269 | if (strstr (response, "Gauge: ")) |
268 | show = strstr (response, "Gauge: ") + 7; | 270 | show = strstr (response, "Gauge: ") + 7; |
269 | else if (strstr (response, "Gauge32: ")) | 271 | else if (strstr (response, "Gauge32: ")) |