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