Index: p.y =================================================================== RCS file: /cvsroot/monit/monit/p.y,v retrieving revision 1.208 diff -c -b -r1.208 p.y *** p.y 3 Apr 2005 11:56:51 -0000 1.208 --- p.y 28 Jul 2005 20:51:00 -0000 *************** *** 1562,1568 **** addeventaction(&(current)->action_EXEC, ACTION_ALERT, ACTION_ALERT); addeventaction(&(current)->action_INVALID, ACTION_RESTART, ACTION_ALERT); addeventaction(&(current)->action_NONEXIST, ACTION_RESTART, ACTION_ALERT); ! addeventaction(&(current)->action_TIMEOUT, ACTION_UNMONITOR, ACTION_ALERT); addeventaction(&(current)->action_PID, ACTION_ALERT, ACTION_IGNORE); addeventaction(&(current)->action_PPID, ACTION_ALERT, ACTION_IGNORE); --- 1562,1568 ---- addeventaction(&(current)->action_EXEC, ACTION_ALERT, ACTION_ALERT); addeventaction(&(current)->action_INVALID, ACTION_RESTART, ACTION_ALERT); addeventaction(&(current)->action_NONEXIST, ACTION_RESTART, ACTION_ALERT); ! addeventaction(&(current)->action_TIMEOUT, ACTION_ALERT, ACTION_ALERT); addeventaction(&(current)->action_PID, ACTION_ALERT, ACTION_IGNORE); addeventaction(&(current)->action_PPID, ACTION_ALERT, ACTION_IGNORE); Index: validate.c =================================================================== RCS file: /cvsroot/monit/monit/validate.c,v retrieving revision 1.140 diff -b -c -r1.140 validate.c *** validate.c 11 May 2005 21:28:02 -0000 1.140 --- validate.c 28 Jul 2005 20:52:09 -0000 *************** *** 500,505 **** --- 500,511 ---- p->is_available= TRUE; Event_post(s, EVENT_CONNECTION, FALSE, p->action, "'%s' connection passed", s->name); + if(s->ncycle == s->to_cycle){ + s->nstart--; + } + if(s->nstart < 0){ + s->nstart = 0; + } } } *************** *** 1045,1073 **** if(!s->def_timeout) return FALSE; /* * Start counting cycles */ if(s->nstart > 0) s->ncycle++; /* * Check timeout */ if(s->nstart >= s->to_start && s->ncycle <= s->to_cycle) { Event_post(s, EVENT_TIMEOUT, TRUE, s->action_TIMEOUT, ! "'%s' service timed out and will not be checked anymore", s->name); - return TRUE; } /* * Stop counting and reset if the * cycle interval is passed */ ! if(s->ncycle > s->to_cycle) { s->ncycle= 0; ! s->nstart= 0; } return FALSE; --- 1051,1093 ---- if(!s->def_timeout) return FALSE; + /*log( "ns=%d, ts=%d, nc=%d, tc=%d\n", s->nstart, s->to_start, s->ncycle, s->to_cycle);*/ /* * Start counting cycles */ if(s->nstart > 0) s->ncycle++; + /* make sure counters don't exceed set limits */ + if(s->ncycle > s->to_cycle){ + s->ncycle = s->to_cycle; + } + if(s->nstart > s->to_start){ + s->nstart = s->to_start; + } /* * Check timeout */ if(s->nstart >= s->to_start && s->ncycle <= s->to_cycle) { Event_post(s, EVENT_TIMEOUT, TRUE, s->action_TIMEOUT, ! "'%s' service timed out", ! s->name); ! /* return TRUE; */ ! return FALSE; ! }else{ ! Event_post(s, EVENT_TIMEOUT, FALSE, s->action_TIMEOUT, ! "'%s' service timeout recovered.", s->name); } /* * Stop counting and reset if the * cycle interval is passed */ ! /* if(s->ncycle > s->to_cycle) { */ ! if(s->nstart == 0){ s->ncycle= 0; ! /* s->nstart= 2; */ } return FALSE;