summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/check_snmp.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 36a3327..fc19120 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -356,13 +356,14 @@ main (int argc, char **argv)
356 exit (STATE_UNKNOWN); 356 exit (STATE_UNKNOWN);
357#endif 357#endif
358 } 358 }
359 359 else {
360 if (response && iresult == STATE_DEPENDENT) 360 if (response && iresult == STATE_DEPENDENT)
361 iresult = STATE_OK; 361 iresult = STATE_OK;
362 else if (eval_method[i] & CRIT_PRESENT) 362 else if (eval_method[i] & CRIT_PRESENT)
363 iresult = STATE_CRITICAL; 363 iresult = STATE_CRITICAL;
364 else if (eval_method[i] & WARN_PRESENT) 364 else if (eval_method[i] & WARN_PRESENT)
365 iresult = STATE_WARNING; 365 iresult = STATE_WARNING;
366 }
366 367
367 result = max_state (result, iresult); 368 result = max_state (result, iresult);
368 369
@@ -549,7 +550,7 @@ process_arguments (int argc, char **argv)
549 case 's': /* string or substring */ 550 case 's': /* string or substring */
550 strncpy (string_value, optarg, sizeof (string_value) - 1); 551 strncpy (string_value, optarg, sizeof (string_value) - 1);
551 string_value[sizeof (string_value) - 1] = 0; 552 string_value[sizeof (string_value) - 1] = 0;
552 eval_method[jj++] = CRIT_STRING; 553 eval_method[jj] = CRIT_STRING;
553 break; 554 break;
554 case 'R': /* regex */ 555 case 'R': /* regex */
555#ifdef HAVE_REGEX_H 556#ifdef HAVE_REGEX_H
@@ -566,7 +567,7 @@ process_arguments (int argc, char **argv)
566 printf ("Could Not Compile Regular Expression"); 567 printf ("Could Not Compile Regular Expression");
567 return ERROR; 568 return ERROR;
568 } 569 }
569 eval_method[jj++] = CRIT_REGEX; 570 eval_method[jj] = CRIT_REGEX;
570#else 571#else
571 printf ("SNMP UNKNOWN: call for regex which was not a compiled option"); 572 printf ("SNMP UNKNOWN: call for regex which was not a compiled option");
572 exit (STATE_UNKNOWN); 573 exit (STATE_UNKNOWN);