Code

core: Changed internal API to allow for per-plugin intervals.
[collectd.git] / src / nut.c
index edc48c61510ab6e716abe17b52d222136ee7ceba..8ca07781e048bb28542775ad172c66288ee97fad 100644 (file)
--- a/src/nut.c
+++ b/src/nut.c
@@ -117,7 +117,7 @@ static void nut_submit (nut_ups_t *ups, const char *type,
     const char *type_instance, gauge_t value)
 {
   value_t values[1];
-  value_list_t vl = VALUE_LIST_INIT;
+  value_list_t vl = VALUE_LIST_INIT (plugin_interval);
 
   values[0].gauge = value;
 
@@ -282,10 +282,11 @@ static int nut_shutdown (void)
   return (0);
 } /* int nut_shutdown */
 
-void module_register (void)
+void module_register (plugin_loaddata_t *data)
 {
+  PLUGIN_INIT_INTERVAL (data);
   plugin_register_config ("nut", nut_config, config_keys, config_keys_num);
-  plugin_register_read ("nut", nut_read);
+  plugin_register_read ("nut", nut_read, plugin_interval);
   plugin_register_shutdown ("nut", nut_shutdown);
 } /* void module_register */