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

Diff of /monit/alert.c

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

revision 1.41 by martinp, Sun Feb 13 00:00:13 2005 UTC revision 1.42 by martinp, Fri Aug 12 21:02:31 2005 UTC
# Line 97  void handle_alert(Event_T E) { Line 97  void handle_alert(Event_T E) {
97                
98        if(IS_EVENT_SET(m->events, Event_get_id(E))) {        if(IS_EVENT_SET(m->events, Event_get_id(E))) {
99    
100          Mail_T tmp= NULL;          Mail_T tmp= NULL;
101    
102          NEW(tmp);          NEW(tmp);
103    
104          copy_mail(tmp, m);          copy_mail(tmp, m);
105    
106          if(Event_get_message(E)) {          if(Event_get_message(E)) {
107            tmp->opt_message= xstrdup(Event_get_message(E));            tmp->opt_message= xstrdup(Event_get_message(E));
108          }          }
109    
110          substitute(&tmp, s->name, EVENT_DESCRIPTION(E),          substitute(&tmp, s->name, EVENT_DESCRIPTION(E),
111            Event_get_action_description(E));            Event_get_action_description(E));
112    
113          replace_bare_linefeed(&tmp);          replace_bare_linefeed(&tmp);
114    
115          tmp->next= list;          tmp->next= list;
116          list= tmp;          list= tmp;
117    
118          DEBUG("%s notification is sent to %s\n", EVENT_DESCRIPTION(E), m->to);          DEBUG("%s notification is sent to %s\n", EVENT_DESCRIPTION(E), m->to);
119    
120        }        }
121    
# Line 132  void handle_alert(Event_T E) { Line 132  void handle_alert(Event_T E) {
132    
133        for(n= s->maillist; n; n= n->next) {        for(n= s->maillist; n; n= n->next) {
134          if(IS(m->to, n->to)) {          if(IS(m->to, n->to)) {
135            skip= TRUE;            skip= TRUE;
136            break;            break;
137          }          }
138        }        }
139    
140        if(!skip && IS_EVENT_SET(m->events, Event_get_id(E))) {        if(!skip && IS_EVENT_SET(m->events, Event_get_id(E))) {
141    
142          Mail_T tmp= NULL;          Mail_T tmp= NULL;
143    
144          NEW(tmp);          NEW(tmp);
145    
146          copy_mail(tmp, m);          copy_mail(tmp, m);
147    
148          if(Event_get_message(E))          if(Event_get_message(E))
149            tmp->opt_message= xstrdup(Event_get_message(E));            tmp->opt_message= xstrdup(Event_get_message(E));
150    
151          substitute(&tmp, s->name, EVENT_DESCRIPTION(E),          substitute(&tmp, s->name, EVENT_DESCRIPTION(E),
152            Event_get_action_description(E));            Event_get_action_description(E));
153    
154          replace_bare_linefeed(&tmp);          replace_bare_linefeed(&tmp);
155    
156          tmp->next= list;          tmp->next= list;
157          list= tmp;          list= tmp;
158    
159          DEBUG("%s notification is sent to %s\n", EVENT_DESCRIPTION(E), m->to);          DEBUG("%s notification is sent to %s\n", EVENT_DESCRIPTION(E), m->to);
160    
161        }        }
162    

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

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