Code

collectd.conf(5): Document the per-plugin interval configuration.
[collectd.git] / src / notify_email.c
index 6b4678a7882a22baa010a569ba06cf1e7993ab6b..1c3890d1aa32d6bd43559d835afa5d380330df0c 100644 (file)
@@ -229,6 +229,7 @@ static int notify_email_notification (const notification_t *n,
     user_data_t __attribute__((unused)) *user_data)
 {
 
+  time_t tt;
   struct tm timestamp_tm;
   char timestamp_str[64];
 
@@ -248,7 +249,8 @@ static int notify_email_notification (const notification_t *n,
       (email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject,
       severity, n->host);
 
-  localtime_r (&n->time, &timestamp_tm);
+  tt = CDTIME_T_TO_TIME_T (n->time);
+  localtime_r (&tt, &timestamp_tm);
   strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
       &timestamp_tm);
   timestamp_str[sizeof (timestamp_str) - 1] = '\0';
@@ -311,14 +313,16 @@ static int notify_email_notification (const notification_t *n,
   return (0);
 } /* int notify_email_notification */
 
-void module_register (void)
+void module_register (plugin_loaddata_t *data)
 {
+  PLUGIN_INIT_INTERVAL (data);
+
   plugin_register_init ("notify_email", notify_email_init);
   plugin_register_shutdown ("notify_email", notify_email_shutdown);
   plugin_register_config ("notify_email", notify_email_config,
       config_keys, config_keys_num);
   plugin_register_notification ("notify_email", notify_email_notification,
       /* user_data = */ NULL);
-} /* void module_register (void) */
+} /* void module_register (plugin_loaddata_t *data) */
 
 /* vim: set sw=2 sts=2 ts=8 et : */