]> arthur.barton.de Git - netdata.git/blob - src/plugins_d.h
properly handle the exit status of plugins to avoid infinite restart attempts; plugin...
[netdata.git] / src / plugins_d.h
1 #include <sys/types.h>
2 #include <unistd.h>
3
4
5 #ifndef NETDATA_PLUGINS_D_H
6 #define NETDATA_PLUGINS_D_H 1
7
8 #define PLUGINSD_FILE_SUFFIX ".plugin"
9 #define PLUGINSD_FILE_SUFFIX_LEN strlen(PLUGINSD_FILE_SUFFIX)
10 #define PLUGINSD_CMD_MAX (FILENAME_MAX*2)
11 #define PLUGINSD_LINE_MAX 1024
12
13 struct plugind {
14         char id[CONFIG_MAX_NAME+1];                     // config node id
15
16         char filename[FILENAME_MAX+1];          // just the filename
17         char fullfilename[FILENAME_MAX+1];      // with path
18         char cmd[PLUGINSD_CMD_MAX+1];           // the command that is executes
19
20         pid_t pid;
21         pthread_t thread;
22
23         size_t successful_collections;          // the number of times we have seen
24                                                                                 // values collected from this plugin
25
26         size_t serial_failures;                         // the number of times the plugin started
27                                                                                 // without collecting values
28
29         int update_every;                                       // the plugin default data collection frequency
30         int obsolete;                                           // do not touch this structure after setting this to 1
31         int enabled;                                            // if this is enabled or not
32
33         time_t started_t;
34
35         struct plugind *next;
36 };
37
38 extern struct plugind *pluginsd_root;
39
40 extern void *pluginsd_main(void *ptr);
41
42 #endif /* NETDATA_PLUGINS_D_H */