summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1795f8b)
raw | patch | inline | side by side (parent: 1795f8b)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 4 Jun 2008 13:50:56 +0000 (15:50 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 4 Jun 2008 13:50:56 +0000 (15:50 +0200) |
SMTPHost -> SMTPServer
SMTPFrom -> From
SMTPSubject -> Subject
EmailTo -> Recipient
SMTPFrom -> From
SMTPSubject -> Subject
EmailTo -> Recipient
src/collectd.conf.in | patch | blob | history | |
src/notify_email.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index 06f9a92c531feb49c738410a0163dcbdb0b81048..476a39d304d7063cd27a2448d36c90bd9be02b0b 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
#</Plugin>
#<Plugin notify_email>
-# SMTPHost "localhost"
+# SMTPServer "localhost"
# SMTPPort 25
-# SMTPSubject "Aaaaaa!! %s on %s!!!!!" # <WARNING/FAILURE/OK> on <hostname>. beware! do not use not more than two %s in this string!!!
-# SMTPFrom "collectd@main0server.com"
# SMTPUser "my-username"
# SMTPPassword "my-password"
-# EmailTo "email1@domain1.net"
-# EmailTo "email2@domain2.com"
+# From "collectd@main0server.com"
+# # <WARNING/FAILURE/OK> on <hostname>. beware! do not use not more than two %s in this string!!!
+# Subject "Aaaaaa!! %s on %s!!!!!"
+# Recipient "email1@domain1.net"
+# Recipient "email2@domain2.com"
#</Plugin>
#<Plugin ntpd>
diff --git a/src/notify_email.c b/src/notify_email.c
index 2059db4cb60a7b572aee03139b56cc4e360b1d00..dc4e47f73cc29990a46b3a0f9f6914f11b3e2a21 100644 (file)
--- a/src/notify_email.c
+++ b/src/notify_email.c
static const char *config_keys[] =
{
- "SMTPHost",
+ "SMTPServer",
"SMTPPort",
"SMTPUser",
"SMTPPassword",
- "SMTPFrom",
- "SMTPSubject",
- "EmailTo"
+ "From",
+ "Recipient",
+ "Subject"
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
static char *smtp_host = NULL;
static char *smtp_user = NULL;
static char *smtp_password = NULL;
-static char *smtp_from = NULL;
-static char *smtp_subject = NULL;
+static char *email_from = NULL;
+static char *email_subject = NULL;
#define DEFAULT_SMTP_HOST "localhost"
#define DEFAULT_SMTP_FROM "root@localhost"
static int notify_email_config (const char *key, const char *value)
{
- if (strcasecmp (key, "EmailTo") == 0)
+ if (strcasecmp (key, "Recipient") == 0)
{
char **tmp;
}
recipients_len++;
}
- else if (0 == strcasecmp (key, "SMTPHost")) {
+ else if (0 == strcasecmp (key, "SMTPServer")) {
sfree (smtp_host);
smtp_host = strdup (value);
}
sfree (smtp_password);
smtp_password = strdup (value);
}
- else if (0 == strcasecmp (key, "SMTPFrom")) {
- sfree (smtp_from);
- smtp_from = strdup (value);
+ else if (0 == strcasecmp (key, "From")) {
+ sfree (email_from);
+ email_from = strdup (value);
}
- else if (0 == strcasecmp (key, "SMTPSubject")) {
- sfree (smtp_subject);
- smtp_subject = strdup (value);
+ else if (0 == strcasecmp (key, "Subject")) {
+ sfree (email_subject);
+ email_subject = strdup (value);
}
else {
return -1;
: ((n->severity == NOTIF_OKAY) ? "OKAY" : "UNKNOWN")));
ssnprintf (subject, sizeof (subject),
- (smtp_subject == NULL) ? DEFAULT_SMTP_SUBJECT : smtp_subject,
+ (email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject,
severity, n->host);
localtime_r (&n->time, ×tamp_tm);
ERROR ("notify_email plugin: cannot set SMTP message");
return (-1);
}
- smtp_set_reverse_path (message, smtp_from);
+ smtp_set_reverse_path (message, email_from);
smtp_set_header (message, "To", NULL, NULL);
smtp_set_message_str (message, buf);