Переглянути джерело

fix: replaced check for first of (-123456789) with check for open parens

root 2 роки тому
батько
коміт
46cce72a37
1 змінених файлів з 4 додано та 2 видалено
  1. 4 2
      plugins/check_snmp.c

+ 4 - 2
plugins/check_snmp.c

@@ -496,8 +496,10 @@ main (int argc, char **argv)
 		/* Process this block for numeric comparisons */
 		/* Make some special values,like Timeticks numeric only if a threshold is defined */
 		if (thlds[i]->warning || thlds[i]->critical || calculate_rate || is_ticks || offset != 0.0 || multiplier != 1.0) {
-			ptr = strpbrk (show, "-0123456789");
-
+			/* Find the first instance of the '(' character - the value of the OID should be contained in parens */
+			ptr = strpbrk(show, "(");
+			ptr++;
+			
 			if (ptr == NULL)
 				die (STATE_UNKNOWN,_("No valid data returned (%s)\n"), show);
 			while (i >= response_size) {