summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1070fdb)
raw | patch | inline | side by side (parent: 1070fdb)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 17 Jun 2011 12:04:07 +0000 (14:04 +0200) | ||
committer | Sebastian Harl <sh@teamix.net> | |
Mon, 19 Sep 2011 07:47:12 +0000 (09:47 +0200) |
contrib/examples/myplugin.c | patch | blob | history |
index f68cc1ac85c090792efa1bfe9433272327b378fa..fc63a5c86e01b298c239ab23f7705bd686df2e88 100644 (file)
{
value_t values[1]; /* the size of this list should equal the number of
data sources */
- value_list_t vl = VALUE_LIST_INIT;
+ value_list_t vl = VALUE_LIST_INIT (plugin_interval);
/* do the magic to read the data */
values[0].gauge = random ();
* This function is called after loading the plugin to register it with
* collectd.
*/
-void module_register (void)
+void module_register (plugin_loaddata_t *data)
{
+ PLUGIN_INIT_INTERVAL (data);
+
plugin_register_log ("myplugin", my_log);
plugin_register_notification ("myplugin", my_notify);
plugin_register_data_set (&ds);
- plugin_register_read ("myplugin", my_read);
+ plugin_register_read ("myplugin", my_read, plugin_interval);
plugin_register_init ("myplugin", my_init);
plugin_register_write ("myplugin", my_write);
plugin_register_shutdown ("myplugin", my_shutdown);