src/daemon/plugin.[ch]: Use cdtime_t for the interval argument of "register complex...
[collectd.git] / src / netapp.c
index ac595c2..020bfba 100644 (file)
@@ -1881,14 +1881,16 @@ static int cna_handle_quota_data (const host_config_t *host, /* {{{ */
                        value *= 1024; /* disk-used reports kilobytes */
                        submit_double (host->name, plugin_instance,
                                        /* type = */ "df_complex", /* type instance = */ NULL,
-                                       (double)value, /* timestamp = */ 0, host->interval);
+                                       (double)value, /* timestamp = */ 0,
+                                       host->cfg_quota->interval.interval);
                }
 
                value = na_child_get_uint64 (elem_quota, "files-used", UINT64_MAX);
                if (value != UINT64_MAX) {
                        submit_double (host->name, plugin_instance,
                                        /* type = */ "files", /* type instance = */ NULL,
-                                       (double)value, /* timestamp = */ 0, host->interval);
+                                       (double)value, /* timestamp = */ 0,
+                                       host->cfg_quota->interval.interval);
                }
        } /* for (elem_quota) */
 
@@ -2046,7 +2048,8 @@ static int cna_handle_snapvault_iter (host_config_t *host, /* {{{ */
                        return (-1);
                }
 
-               cna_handle_snapvault_data (host->name, host->cfg_snapvault, elem, host->interval);
+               cna_handle_snapvault_data (host->name, host->cfg_snapvault, elem,
+                               host->cfg_snapvault->interval.interval);
                na_elem_free (elem);
        }
 
@@ -2903,7 +2906,6 @@ static int cna_read (user_data_t *ud);
 static int cna_register_host (host_config_t *host) /* {{{ */
 {
        char cb_name[256];
-       struct timespec interval;
        user_data_t ud;
 
        if (host->vfiler)
@@ -2912,15 +2914,13 @@ static int cna_register_host (host_config_t *host) /* {{{ */
        else
                ssnprintf (cb_name, sizeof (cb_name), "netapp-%s", host->name);
 
-       CDTIME_T_TO_TIMESPEC (host->interval, &interval);
-
        memset (&ud, 0, sizeof (ud));
        ud.data = host;
        ud.free_func = (void (*) (void *)) free_host_config;
 
        plugin_register_complex_read (/* group = */ NULL, cb_name,
                        /* callback  = */ cna_read,
-                       /* interval  = */ (host->interval > 0) ? &interval : NULL,
+                       /* interval  = */ host->interval,
                        /* user data = */ &ud);
 
        return (0);