diff --git a/src/interface.c b/src/interface.c
index 1ba6c8c32b73199823134d1662d89975065dc1d9..01dd389604e8b844114565f802b63f3b468a1e10 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
/**
* collectd - src/interface.c
/**
* collectd - src/interface.c
- * Copyright (C) 2005-2008 Florian octo Forster
+ * Copyright (C) 2005-2010 Florian octo Forster
* Copyright (C) 2009 Manuel Sanmartin
*
* This program is free software; you can redistribute it and/or modify it
* Copyright (C) 2009 Manuel Sanmartin
*
* This program is free software; you can redistribute it and/or modify it
static int interface_init (void)
{
kstat_t *ksp_chain;
static int interface_init (void)
{
kstat_t *ksp_chain;
- unsigned long long val;
+ derive_t val;
numif = 0;
numif = 0;
#endif /* HAVE_LIBKSTAT */
static void if_submit (const char *dev, const char *type,
#endif /* HAVE_LIBKSTAT */
static void if_submit (const char *dev, const char *type,
- unsigned long long rx,
- unsigned long long tx)
+ derive_t rx,
+ derive_t tx)
{
value_t values[2];
{
value_t values[2];
- value_list_t vl = VALUE_LIST_INIT;
+ value_list_t vl = VALUE_LIST_INIT (plugin_interval);
if (ignorelist_match (ignorelist, dev) != 0)
return;
if (ignorelist_match (ignorelist, dev) != 0)
return;
- values[0].counter = rx;
- values[1].counter = tx;
+ values[0].derive = rx;
+ values[1].derive = tx;
vl.values = values;
vl.values_len = 2;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "interface", sizeof (vl.plugin));
vl.values = values;
vl.values_len = 2;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "interface", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type, type, sizeof (vl.type));
- sstrncpy (vl.type_instance, dev, sizeof (vl.type_instance));
plugin_dispatch_values (&vl);
} /* void if_submit */
plugin_dispatch_values (&vl);
} /* void if_submit */
#elif KERNEL_LINUX
FILE *fh;
char buffer[1024];
#elif KERNEL_LINUX
FILE *fh;
char buffer[1024];
- unsigned long long incoming, outgoing;
+ derive_t incoming, outgoing;
char *device;
char *dummy;
char *device;
char *dummy;
#elif HAVE_LIBKSTAT
int i;
#elif HAVE_LIBKSTAT
int i;
- unsigned long long rx;
- unsigned long long tx;
+ derive_t rx;
+ derive_t tx;
if (kc == NULL)
return (-1);
if (kc == NULL)
return (-1);
return (0);
} /* int interface_read */
return (0);
} /* int interface_read */
-void module_register (void)
+void module_register (plugin_loaddata_t *data)
{
{
+ PLUGIN_INIT_INTERVAL (data);
+
plugin_register_config ("interface", interface_config,
config_keys, config_keys_num);
#if HAVE_LIBKSTAT
plugin_register_init ("interface", interface_init);
#endif
plugin_register_config ("interface", interface_config,
config_keys, config_keys_num);
#if HAVE_LIBKSTAT
plugin_register_init ("interface", interface_init);
#endif
- plugin_register_read ("interface", interface_read);
+ plugin_register_read ("interface", interface_read, plugin_interval);
} /* void module_register */
} /* void module_register */