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

Diff of /monit/alert.c

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

revision 1.37 by martinp, Mon Nov 1 21:54:35 2004 UTC revision 1.38 by hauk, Sun Dec 12 23:45:08 2004 UTC
# Line 180  static void substitute(Mail_T *m, char * Line 180  static void substitute(Mail_T *m, char *
180    const char *action) {    const char *action) {
181    
182    char host[STRLEN];    char host[STRLEN];
183    char *now= get_RFC822date(NULL);    char *now= Util_getRFC822Date(NULL);
184    
185    ASSERT(m && name && event && action);    ASSERT(m && name && event && action);
186    
# Line 188  static void substitute(Mail_T *m, char * Line 188  static void substitute(Mail_T *m, char *
188      snprintf(host, STRLEN, "%s", LOCALHOST);      snprintf(host, STRLEN, "%s", LOCALHOST);
189    }    }
190    
191    replace_string(&(*m)->from, "$HOST", host);    Util_replaceString(&(*m)->from, "$HOST", host);
192    replace_string(&(*m)->subject, "$DATE", now);    Util_replaceString(&(*m)->subject, "$DATE", now);
193    replace_string(&(*m)->message, "$DATE", now);    Util_replaceString(&(*m)->message, "$DATE", now);
194    replace_string(&(*m)->subject, "$HOST", host);    Util_replaceString(&(*m)->subject, "$HOST", host);
195    replace_string(&(*m)->message, "$HOST", host);    Util_replaceString(&(*m)->message, "$HOST", host);
196    replace_string(&(*m)->subject, "$PROGRAM", name);    Util_replaceString(&(*m)->subject, "$PROGRAM", name);
197    replace_string(&(*m)->message, "$PROGRAM", name);    Util_replaceString(&(*m)->message, "$PROGRAM", name);
198    replace_string(&(*m)->subject, "$SERVICE", name);    Util_replaceString(&(*m)->subject, "$SERVICE", name);
199    replace_string(&(*m)->message, "$SERVICE", name);    Util_replaceString(&(*m)->message, "$SERVICE", name);
200    replace_string(&(*m)->subject, "$EVENT", event);    Util_replaceString(&(*m)->subject, "$EVENT", event);
201    replace_string(&(*m)->message, "$EVENT", event);    Util_replaceString(&(*m)->message, "$EVENT", event);
202    replace_string(&(*m)->subject, "$ACTION", action);    Util_replaceString(&(*m)->subject, "$ACTION", action);
203    replace_string(&(*m)->message, "$ACTION", action);    Util_replaceString(&(*m)->message, "$ACTION", action);
204    
205    FREE(now);    FREE(now);
206    
# Line 236  static void copy_mail(Mail_T n, Mail_T o Line 236  static void copy_mail(Mail_T n, Mail_T o
236    
237    
238  static void replace_bare_linefeed(Mail_T *m) {  static void replace_bare_linefeed(Mail_T *m) {
239      
240    replace_string(&(*m)->message, "\r\n", "\n");    Util_replaceString(&(*m)->message, "\r\n", "\n");
241    replace_string(&(*m)->message, "\n", "\r\n");    Util_replaceString(&(*m)->message, "\n", "\r\n");
242    if((*m)->opt_message) {    if((*m)->opt_message) {
243      replace_string(&(*m)->opt_message, "\r\n", "\n");      Util_replaceString(&(*m)->opt_message, "\r\n", "\n");
244      replace_string(&(*m)->opt_message, "\n", "\r\n");      Util_replaceString(&(*m)->opt_message, "\n", "\r\n");
245    }    }
246      
247  }  }

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

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