/[monit]/monit/alert.c
ViewVC logotype

Diff of /monit/alert.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.42 by martinp, Fri Aug 12 21:02:31 2005 UTC revision 1.43 by martinp, Sun Aug 14 08:44:48 2005 UTC
# Line 83  void handle_alert(Event_T E) { Line 83  void handle_alert(Event_T E) {
83    ASSERT(E);    ASSERT(E);
84    
85    s= Event_get_source(E);    s= Event_get_source(E);
86    if(s->maillist||Run.maillist) {    if(s->maillist || Run.maillist) {
87      Mail_T m;      Mail_T m;
88      Mail_T n;      Mail_T n;
89      sigset_t ns, os;      sigset_t ns, os;
# Line 95  void handle_alert(Event_T E) { Line 95  void handle_alert(Event_T E) {
95       */       */
96      for(m= s->maillist; m; m= m->next) {      for(m= s->maillist; m; m= m->next) {
97                
98        if(IS_EVENT_SET(m->events, Event_get_id(E))) {        if(
99            /* particular event notification type is allowed for given recipient */
100            IS_EVENT_SET(m->events, Event_get_id(E)) &&
101            (
102              /* 'changed' event type is sent always */
103              E->id == EVENT_CHANGED ||
104              /* state change notification is sent always */
105              E->state_changed       ||
106              /* in the case that the state is failed for more cycles we check
107               * whether we should send the reminder */
108              (
109                E->state && m->reminder && E->count % m->reminder == 0
110              )
111            )
112          )
113          {
114    
115          Mail_T tmp= NULL;          Mail_T tmp= NULL;
116    
# Line 137  void handle_alert(Event_T E) { Line 152  void handle_alert(Event_T E) {
152          }          }
153        }        }
154    
155        if(!skip && IS_EVENT_SET(m->events, Event_get_id(E))) {        if(
156            /* the local service alert definition has not overrided the global one */
157            !skip &&
158            /* particular event notification type is allowed for given recipient */
159            IS_EVENT_SET(m->events, Event_get_id(E)) &&
160            (
161              /* 'changed' event type is sent always */
162              E->id == EVENT_CHANGED ||
163              /* state change notification is sent always */
164              E->state_changed       ||
165              /* in the case that the state is failed for more cycles we check
166               * whether we should send the reminder */
167              (
168                E->state && m->reminder && E->count % m->reminder == 0
169              )
170            )
171          )
172          {
173    
174          Mail_T tmp= NULL;          Mail_T tmp= NULL;
175    

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26