[Nagiosplug-checkins] CVS: nagiosplug/plugins check_procs.c,1.10,1.11
Ton Voon
tonvoon at users.sourceforge.net
Mon Mar 24 09:00:03 CET 2003
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv4957
Modified Files:
check_procs.c
Log Message:
Use max_state
Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** check_procs.c 11 Mar 2003 22:22:11 -0000 1.10
--- check_procs.c 24 Mar 2003 16:23:01 -0000 1.11
***************
*** 165,179 ****
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");
}
- /* if (result == STATE_UNKNOWN || result == STATE_WARNING)
- printf ("System call sent warnings to stderr\n");
- */
(void) fclose (child_stderr);
--- 165,172 ----
if (verbose)
printf ("STDERR: %s", input_buffer);
! result = max_state (result, STATE_WARNING);
! printf ("System call sent warnings to stderr\n");
}
(void) fclose (child_stderr);
***************
*** 181,190 ****
if (spclose (child_process)) {
printf ("System call returned nonzero status\n");
! if ( !(result == STATE_CRITICAL) ) {
! return STATE_WARNING;
! }
! else {
! return result ;
! }
}
--- 174,178 ----
if (spclose (child_process)) {
printf ("System call returned nonzero status\n");
! result = max_state (result, STATE_WARNING);
}
***************
*** 236,256 ****
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); */
}
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); */
}
--- 224,232 ----
else if (wmax >= 0 && procs > wmax) {
printf (fmt, "WARNING", procs);
! return max_state (result, STATE_WARNING);
}
else if (wmin >= 0 && procs < wmin) {
printf (fmt, "WARNING", procs);
! return max_state (result, STATE_WARNING);
}
More information about the Commits
mailing list