diff --git zabbix src zabbix_agent zabbix_agentd zabbix src zabbix_age

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff --git a/zabbix/src/zabbix_agent/zabbix_agentd.c b/zabbix/src/zabbix_agent/zabbix_agentd.c
index af7add6..8bfe516 100644
--- a/zabbix/src/zabbix_agent/zabbix_agentd.c
+++ b/zabbix/src/zabbix_agent/zabbix_agentd.c
@@ -368,6 +368,31 @@ void load_user_parameters(void)
};
parse_cfg_file(CONFIG_FILE,cfg);
+
+ DIR *dir;
+ struct dirent *dp;
+ char *pathd = "/etc/zabbix/zabbix_agentd.conf.d";
+
+ if (dir = opendir( pathd ))
+ {
+ while (NULL != (dp = readdir(dir)))
+ {
+ char fname[MAXNAMLEN+1];
+
+ if ( strchr(dp->d_name, '.') ||
+ dp->d_name[strlen(dp->d_name)-1] == '~')
+ continue;
+
+ snprintf(fname, sizeof(fname), "%s/%s", pathd, dp->d_name);
+ printf("opening file %s\n", &fname);
+ parse_cfg_file(fname, cfg);
+ }
+ closedir(dir);
+ }
+ else
+ {
+
+ }
}
void process_child(int sockfd)