summaryrefslogtreecommitdiffstats
path: root/daemon/analytics.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/analytics.c')
-rw-r--r--daemon/analytics.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/daemon/analytics.c b/daemon/analytics.c
index 0af41fdd..6c02561d 100644
--- a/daemon/analytics.c
+++ b/daemon/analytics.c
@@ -249,8 +249,9 @@ void analytics_exporters(void)
buffer_free(bi);
}
-int collector_counter_callb(void *entry, void *data)
-{
+int collector_counter_callb(const char *name, void *entry, void *data) {
+ (void)name;
+
struct array_printer *ap = (struct array_printer *)data;
struct collector *col = (struct collector *)entry;
@@ -296,7 +297,7 @@ void analytics_collectors(void)
ap.c = 0;
ap.both = bt;
- dictionary_get_all(dict, collector_counter_callb, &ap);
+ dictionary_walkthrough_read(dict, collector_counter_callb, &ap);
dictionary_destroy(dict);
analytics_set_data(&analytics_data.netdata_collectors, (char *)buffer_tostring(ap.both));
@@ -701,7 +702,7 @@ void get_system_timezone(void)
// http://stackoverflow.com/questions/4554271/how-to-avoid-excessive-stat-etc-localtime-calls-in-strftime-on-linux
const char *tz = getenv("TZ");
if (!tz || !*tz)
- setenv("TZ", config_get(CONFIG_SECTION_GLOBAL, "TZ environment variable", ":/etc/localtime"), 0);
+ setenv("TZ", config_get(CONFIG_SECTION_ENV_VARS, "TZ", ":/etc/localtime"), 0);
char buffer[FILENAME_MAX + 1] = "";
const char *timezone = NULL;
@@ -908,13 +909,13 @@ void set_global_environment()
if (!p)
p = "/bin:/usr/bin";
snprintfz(path, 1024, "%s:%s", p, "/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
- setenv("PATH", config_get(CONFIG_SECTION_PLUGINS, "PATH environment variable", path), 1);
+ setenv("PATH", config_get(CONFIG_SECTION_ENV_VARS, "PATH", path), 1);
// python options
p = getenv("PYTHONPATH");
if (!p)
p = "";
- setenv("PYTHONPATH", config_get(CONFIG_SECTION_PLUGINS, "PYTHONPATH environment variable", p), 1);
+ setenv("PYTHONPATH", config_get(CONFIG_SECTION_ENV_VARS, "PYTHONPATH", p), 1);
// disable buffering for python plugins
setenv("PYTHONUNBUFFERED", "1", 1);