diff options
| author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-10-20 07:53:31 +0000 |
|---|---|---|
| committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-10-20 07:53:31 +0000 |
| commit | 70b519bb270268a438d01c298f3e1a35038a0a72 (patch) | |
| tree | 3ef36bb7d53f423891d63d5df9364d12b23d7661 /plugins | |
| parent | b4ac701f3f260bea993bbaec1d8d8c8cf5252b72 (diff) | |
| download | monitoring-plugins-70b519bb270268a438d01c298f3e1a35038a0a72.tar.gz | |
Reverting back accidently regressed code
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1513 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_snmp.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 7ba96847..1e1657b4 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
| @@ -96,8 +96,8 @@ char regex_expect[MAX_INPUT_BUFFER] = ""; | |||
| 96 | regex_t preg; | 96 | regex_t preg; |
| 97 | regmatch_t pmatch[10]; | 97 | regmatch_t pmatch[10]; |
| 98 | char timestamp[10] = ""; | 98 | char timestamp[10] = ""; |
| 99 | char errbuf[MAX_INPUT_BUFFER]; | 99 | char errbuf[MAX_INPUT_BUFFER] = ""; |
| 100 | char perfstr[MAX_INPUT_BUFFER]; | 100 | char perfstr[MAX_INPUT_BUFFER] = ""; |
| 101 | int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE; | 101 | int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE; |
| 102 | int eflags = 0; | 102 | int eflags = 0; |
| 103 | int errcode, excode; | 103 | int errcode, excode; |
| @@ -154,8 +154,7 @@ main (int argc, char **argv) | |||
| 154 | char *ptr = NULL; | 154 | char *ptr = NULL; |
| 155 | char *p2 = NULL; | 155 | char *p2 = NULL; |
| 156 | char *show = NULL; | 156 | char *show = NULL; |
| 157 | char type[8]; | 157 | char type[8] = ""; |
| 158 | char *str[MAX_INPUT_BUFFER]; | ||
| 159 | 158 | ||
| 160 | setlocale (LC_ALL, ""); | 159 | setlocale (LC_ALL, ""); |
| 161 | bindtextdomain (PACKAGE, LOCALEDIR); | 160 | bindtextdomain (PACKAGE, LOCALEDIR); |
| @@ -257,6 +256,10 @@ main (int argc, char **argv) | |||
| 257 | } | 256 | } |
| 258 | 257 | ||
| 259 | /* We strip out the datatype indicator for PHBs */ | 258 | /* We strip out the datatype indicator for PHBs */ |
| 259 | |||
| 260 | /* Clean up type array - Sol10 does not necessarily zero it out */ | ||
| 261 | bzero(type, sizeof(type)); | ||
| 262 | |||
| 260 | if (strstr (response, "Gauge: ")) | 263 | if (strstr (response, "Gauge: ")) |
| 261 | show = strstr (response, "Gauge: ") + 7; | 264 | show = strstr (response, "Gauge: ") + 7; |
| 262 | else if (strstr (response, "Gauge32: ")) | 265 | else if (strstr (response, "Gauge32: ")) |
| @@ -348,8 +351,11 @@ main (int argc, char **argv) | |||
| 348 | 351 | ||
| 349 | i++; | 352 | i++; |
| 350 | 353 | ||
| 351 | asprintf(str, "=%s%s;;;; ", show, type ? type : ""); | 354 | strcat(perfstr, "="); |
| 352 | strcat(perfstr, *str); | 355 | strcat(perfstr, show); |
| 356 | if (type) | ||
| 357 | strcat(perfstr, type); | ||
| 358 | strcat(perfstr, " "); | ||
| 353 | 359 | ||
| 354 | } /* end while (ptr) */ | 360 | } /* end while (ptr) */ |
| 355 | 361 | ||
