Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/zabbix_proxy/proxy.c')
-rw-r--r--src/zabbix_proxy/proxy.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/zabbix_proxy/proxy.c b/src/zabbix_proxy/proxy.c
index c0674d7c1c0..d4e990b8a01 100644
--- a/src/zabbix_proxy/proxy.c
+++ b/src/zabbix_proxy/proxy.c
@@ -298,6 +298,8 @@ int CONFIG_DOUBLE_PRECISION = ZBX_DB_DBL_PRECISION_ENABLED;
static char *config_file = NULL;
static int config_allow_root = 0;
+static zbx_config_log_t log_file_cfg = {NULL, NULL, LOG_TYPE_UNDEFINED, 1};
+
zbx_vector_ptr_t zbx_addrs;
int get_process_info_by_thread(int local_server_num, unsigned char *local_process_type, int *local_process_num);
@@ -503,8 +505,8 @@ static void zbx_set_defaults(void)
program_type = ZBX_PROGRAM_TYPE_PROXY_PASSIVE;
}
- if (NULL == CONFIG_LOG_TYPE_STR)
- CONFIG_LOG_TYPE_STR = zbx_strdup(CONFIG_LOG_TYPE_STR, ZBX_OPTION_LOGTYPE_FILE);
+ if (NULL == log_file_cfg.log_type_str)
+ log_file_cfg.log_type_str = zbx_strdup(log_file_cfg.log_type_str, ZBX_OPTION_LOGTYPE_FILE);
if (NULL == CONFIG_SOCKET_PATH)
CONFIG_SOCKET_PATH = zbx_strdup(CONFIG_SOCKET_PATH, "/tmp");
@@ -610,7 +612,7 @@ static void zbx_validate_config(ZBX_TASK_EX *task)
/* because they have non-zero default values */
#endif
- if (SUCCEED != zbx_validate_log_parameters(task))
+ if (SUCCEED != zbx_validate_log_parameters(task, &log_file_cfg))
err = 1;
#if !(defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL))
@@ -779,11 +781,11 @@ static void zbx_load_config(ZBX_TASK_EX *task)
PARM_OPT, 0, 5},
{"PidFile", &CONFIG_PID_FILE, TYPE_STRING,
PARM_OPT, 0, 0},
- {"LogType", &CONFIG_LOG_TYPE_STR, TYPE_STRING,
+ {"LogType", &log_file_cfg.log_type_str, TYPE_STRING,
PARM_OPT, 0, 0},
- {"LogFile", &CONFIG_LOG_FILE, TYPE_STRING,
+ {"LogFile", &log_file_cfg.log_file_name, TYPE_STRING,
PARM_OPT, 0, 0},
- {"LogFileSize", &CONFIG_LOG_FILE_SIZE, TYPE_INT,
+ {"LogFileSize", &log_file_cfg.log_file_size, TYPE_INT,
PARM_OPT, 0, 1024},
{"ExternalScripts", &CONFIG_EXTERNALSCRIPTS, TYPE_STRING,
PARM_OPT, 0, 0},
@@ -911,7 +913,7 @@ static void zbx_load_config(ZBX_TASK_EX *task)
zbx_set_defaults();
- CONFIG_LOG_TYPE = zbx_get_log_type(CONFIG_LOG_TYPE_STR);
+ log_file_cfg.log_type = zbx_get_log_type(log_file_cfg.log_type_str);
zbx_validate_config(task);
@@ -1118,7 +1120,8 @@ int main(int argc, char **argv)
exit(SUCCEED == ret ? EXIT_SUCCESS : EXIT_FAILURE);
}
- return zbx_daemon_start(config_allow_root, CONFIG_USER, t.flags, get_pid_file_path, zbx_on_exit);
+ return zbx_daemon_start(config_allow_root, CONFIG_USER, t.flags, get_pid_file_path, zbx_on_exit,
+ log_file_cfg.log_type, log_file_cfg.log_file_name);
}
static void zbx_check_db(void)
@@ -1231,7 +1234,7 @@ int MAIN_ZABBIX_ENTRY(int flags)
exit(EXIT_FAILURE);
}
- if (SUCCEED != zabbix_open_log(CONFIG_LOG_TYPE, CONFIG_LOG_LEVEL, CONFIG_LOG_FILE, &error))
+ if (SUCCEED != zabbix_open_log(&log_file_cfg, CONFIG_LOG_LEVEL, &error))
{
zbx_error("cannot open log:%s", error);
zbx_free(error);