network plugin: Don't blindly re-initialize everything in the init callback.
[collectd.git] / src / plugin.h
index 428c4f0..91978bd 100644 (file)
@@ -100,9 +100,13 @@ typedef struct data_set_s data_set_t;
 typedef struct notification_s
 {
        int    severity;
-       char   message[NOTIF_MAX_MSG_LEN];
        time_t time;
+       char   message[NOTIF_MAX_MSG_LEN];
        char   host[DATA_MAX_NAME_LEN];
+       char   plugin[DATA_MAX_NAME_LEN];
+       char   plugin_instance[DATA_MAX_NAME_LEN];
+       char   type[DATA_MAX_NAME_LEN];
+       char   type_instance[DATA_MAX_NAME_LEN];
 } notification_t;
 
 /*
@@ -144,7 +148,7 @@ void plugin_set_dir (const char *dir);
 int plugin_load (const char *name);
 
 void plugin_init_all (void);
-void plugin_read_all (const int *loop);
+void plugin_read_all (void);
 void plugin_shutdown_all (void);
 
 /*
@@ -201,7 +205,9 @@ int plugin_dispatch_values (const char *name, value_list_t *vl);
 
 int plugin_dispatch_notification (const notification_t *notif);
 
-void plugin_log (int level, const char *format, ...);
+void plugin_log (int level, const char *format, ...)
+       __attribute__ ((format(printf,2,3)));
+
 #define ERROR(...)   plugin_log (LOG_ERR,     __VA_ARGS__)
 #define WARNING(...) plugin_log (LOG_WARNING, __VA_ARGS__)
 #define NOTICE(...)  plugin_log (LOG_NOTICE,  __VA_ARGS__)