diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:22:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:22:44 +0000 |
commit | 1e6c93250172946eeb38e94a92a1fd12c9d3011e (patch) | |
tree | 8ca5e16dfc7ad6b3bf2738ca0a48408a950f8f7e /src/proc_sys_kernel_random_entropy_avail.c | |
parent | Update watch file (diff) | |
download | netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.tar.xz netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.zip |
Merging upstream version 1.11.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/proc_sys_kernel_random_entropy_avail.c')
-rw-r--r-- | src/proc_sys_kernel_random_entropy_avail.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/proc_sys_kernel_random_entropy_avail.c b/src/proc_sys_kernel_random_entropy_avail.c deleted file mode 100644 index ca4d7657c..000000000 --- a/src/proc_sys_kernel_random_entropy_avail.c +++ /dev/null @@ -1,47 +0,0 @@ -#include "common.h" - -int do_proc_sys_kernel_random_entropy_avail(int update_every, usec_t dt) { - (void)dt; - - static procfile *ff = NULL; - - if(unlikely(!ff)) { - char filename[FILENAME_MAX + 1]; - snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/sys/kernel/random/entropy_avail"); - ff = procfile_open(config_get("plugin:proc:/proc/sys/kernel/random/entropy_avail", "filename to monitor", filename), "", PROCFILE_FLAG_DEFAULT); - if(unlikely(!ff)) return 1; - } - - ff = procfile_readall(ff); - if(unlikely(!ff)) return 0; // we return 0, so that we will retry to open it next time - - unsigned long long entropy = str2ull(procfile_lineword(ff, 0, 0)); - - static RRDSET *st = NULL; - static RRDDIM *rd = NULL; - - if(unlikely(!st)) { - st = rrdset_create_localhost( - "system" - , "entropy" - , NULL - , "entropy" - , NULL - , "Available Entropy" - , "entropy" - , "proc" - , "sys/kernel/random/entropy_avail" - , 1000 - , update_every - , RRDSET_TYPE_LINE - ); - - rd = rrddim_add(st, "entropy", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); - } - else rrdset_next(st); - - rrddim_set_by_pointer(st, rd, entropy); - rrdset_done(st); - - return 0; -} |