فهرست منبع

check_snmp: small improvement by anonymous submission

- response should not start with the delimiter
- OID response value taken into account

Closes issue #1029
Closes push request 1173
Jan Wagner 12 سال پیش
والد
کامیت
528ac3017a
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      plugins/check_snmp.c

+ 4 - 0
plugins/check_snmp.c

@@ -380,6 +380,7 @@ main (int argc, char **argv)
 		response = strstr (ptr, delimiter);
 		if (response == NULL)
 			break;
+		response = response + 3;
 
 		if (verbose > 2) {
 			printf("Processing oid %i (line %i)\n  oidname: %s\n  response: %s\n", i+1, line+1, oidname, response);
@@ -411,6 +412,9 @@ main (int argc, char **argv)
 		else if (strstr (response, "INTEGER: ")) {
 			show = strstr (response, "INTEGER: ") + 9;
 		}
+		else if (strstr (response, "OID: ")) {
+			show = strstr (response, "OID: ") + 5;
+		}
 		else if (strstr (response, "STRING: ")) {
 			show = strstr (response, "STRING: ") + 8;
 			conv = "%.10g";