summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e9cb563)
raw | patch | inline | side by side (parent: e9cb563)
author | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Fri, 15 Nov 2002 17:47:03 +0000 (17:47 +0000) | ||
committer | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Fri, 15 Nov 2002 17:47:03 +0000 (17:47 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@204 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_snmp.c | patch | blob | history |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 36a33270abdea53ab287a50d4f08d18d3d3eecae..fc19120182c2daf8565adad80c790f220887af01 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
exit (STATE_UNKNOWN);
#endif
}
-
- if (response && iresult == STATE_DEPENDENT)
- iresult = STATE_OK;
- else if (eval_method[i] & CRIT_PRESENT)
- iresult = STATE_CRITICAL;
- else if (eval_method[i] & WARN_PRESENT)
- iresult = STATE_WARNING;
+ else {
+ if (response && iresult == STATE_DEPENDENT)
+ iresult = STATE_OK;
+ else if (eval_method[i] & CRIT_PRESENT)
+ iresult = STATE_CRITICAL;
+ else if (eval_method[i] & WARN_PRESENT)
+ iresult = STATE_WARNING;
+ }
result = max_state (result, iresult);
case 's': /* string or substring */
strncpy (string_value, optarg, sizeof (string_value) - 1);
string_value[sizeof (string_value) - 1] = 0;
- eval_method[jj++] = CRIT_STRING;
+ eval_method[jj] = CRIT_STRING;
break;
case 'R': /* regex */
#ifdef HAVE_REGEX_H
printf ("Could Not Compile Regular Expression");
return ERROR;
}
- eval_method[jj++] = CRIT_REGEX;
+ eval_method[jj] = CRIT_REGEX;
#else
printf ("SNMP UNKNOWN: call for regex which was not a compiled option");
exit (STATE_UNKNOWN);