summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cea7506)
raw | patch | inline | side by side (parent: cea7506)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Mon, 24 Mar 2003 16:23:01 +0000 (16:23 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Mon, 24 Mar 2003 16:23:01 +0000 (16:23 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@458 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_procs.c | patch | blob | history |
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index ceaff958f74b8ad56589d53a1f8481a176470a1a..e95a07226d8d7b078593873ac485ce36f5b476ea 100644 (file)
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) {
if (verbose)
printf ("STDERR: %s", input_buffer);
- /*Cannot use max() any more as STATE_UNKNOWN is gt STATE_CRITICAL
- result = max (result, STATE_WARNING); */
- if ( !(result == STATE_CRITICAL) ) {
- result = STATE_WARNING;
- }
- printf ("System call sent warnings to stderr\n");
+ result = max_state (result, STATE_WARNING);
+ printf ("System call sent warnings to stderr\n");
}
-/* if (result == STATE_UNKNOWN || result == STATE_WARNING)
- printf ("System call sent warnings to stderr\n");
-*/
(void) fclose (child_stderr);
/* close the pipe */
if (spclose (child_process)) {
printf ("System call returned nonzero status\n");
- if ( !(result == STATE_CRITICAL) ) {
- return STATE_WARNING;
- }
- else {
- return result ;
- }
+ result = max_state (result, STATE_WARNING);
}
if (options == ALL)
}
else if (wmax >= 0 && procs > wmax) {
printf (fmt, "WARNING", procs);
- if ( !(result == STATE_CRITICAL) ) {
- return STATE_WARNING;
- }
- else {
- return result ;
- }
- /*return max (result, STATE_WARNING); */
+ return max_state (result, STATE_WARNING);
}
else if (wmin >= 0 && procs < wmin) {
printf (fmt, "WARNING", procs);
- if ( !(result == STATE_CRITICAL) ) {
- return STATE_WARNING;
- }
- else {
- return result ;
- }
- /*return max (result, STATE_WARNING); */
+ return max_state (result, STATE_WARNING);
}
printf (fmt, "OK", procs);