diff options
Diffstat (limited to 'src/zabbix_server/server.c')
-rw-r--r-- | src/zabbix_server/server.c | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/src/zabbix_server/server.c b/src/zabbix_server/server.c index 84b423f7880..003118e422f 100644 --- a/src/zabbix_server/server.c +++ b/src/zabbix_server/server.c @@ -197,6 +197,13 @@ char **CONFIG_LOAD_MODULE = NULL; char *CONFIG_USER = NULL; +/* web monitoring */ +#ifdef HAVE_LIBCURL +char *CONFIG_SSL_CA_LOCATION = NULL; +char *CONFIG_SSL_CERT_LOCATION = NULL; +char *CONFIG_SSL_KEY_LOCATION = NULL; +#endif + int get_process_info_by_thread(int server_num, unsigned char *process_type, int *process_num) { int server_count = 0; @@ -342,14 +349,19 @@ static void zbx_set_defaults() if (NULL == CONFIG_FPING_LOCATION) CONFIG_FPING_LOCATION = zbx_strdup(CONFIG_FPING_LOCATION, "/usr/sbin/fping"); - #ifdef HAVE_IPV6 if (NULL == CONFIG_FPING6_LOCATION) CONFIG_FPING6_LOCATION = zbx_strdup(CONFIG_FPING6_LOCATION, "/usr/sbin/fping6"); #endif - if (NULL == CONFIG_EXTERNALSCRIPTS) CONFIG_EXTERNALSCRIPTS = zbx_strdup(CONFIG_EXTERNALSCRIPTS, DATADIR "/zabbix/externalscripts"); +#ifdef HAVE_LIBCURL + if (NULL == CONFIG_SSL_CERT_LOCATION) + CONFIG_SSL_CERT_LOCATION = zbx_strdup(CONFIG_SSL_CERT_LOCATION, DATADIR "/zabbix/ssl/certs"); + + if (NULL == CONFIG_SSL_KEY_LOCATION) + CONFIG_SSL_KEY_LOCATION = zbx_strdup(CONFIG_SSL_KEY_LOCATION, DATADIR "/zabbix/ssl/keys"); +#endif #ifdef HAVE_SQLITE3 CONFIG_MAX_HOUSEKEEPER_DELETE = 0; @@ -367,6 +379,14 @@ static void zbx_set_defaults() ******************************************************************************/ static void zbx_validate_config(void) { + if (0 == CONFIG_UNREACHABLE_POLLER_FORKS && 0 != CONFIG_POLLER_FORKS + CONFIG_IPMIPOLLER_FORKS + + CONFIG_JAVAPOLLER_FORKS) + { + zabbix_log(LOG_LEVEL_CRIT, "\"StartPollersUnreachable\" configuration parameter must not be 0" + " if regular, IPMI or Java pollers are started"); + exit(EXIT_FAILURE); + } + if ((NULL == CONFIG_JAVA_GATEWAY || '\0' == *CONFIG_JAVA_GATEWAY) && CONFIG_JAVAPOLLER_FORKS > 0) { zabbix_log(LOG_LEVEL_CRIT, "\"JavaGateway\" configuration parameter is not specified or empty"); @@ -536,6 +556,14 @@ static void zbx_load_config() PARM_OPT, 0, 1}, {"User", &CONFIG_USER, TYPE_STRING, PARM_OPT, 0, 0}, +#ifdef HAVE_LIBCURL + {"SSLCALocation", &CONFIG_SSL_CA_LOCATION, TYPE_STRING, + PARM_OPT, 0, 0}, + {"SSLCertLocation", &CONFIG_SSL_CERT_LOCATION, TYPE_STRING, + PARM_OPT, 0, 0}, + {"SSLKeyLocation", &CONFIG_SSL_KEY_LOCATION, TYPE_STRING, + PARM_OPT, 0, 0}, +#endif {NULL} }; @@ -637,15 +665,15 @@ int main(int argc, char **argv) break; case 'h': help(); - exit(-1); + exit(EXIT_SUCCESS); break; case 'V': version(); - exit(-1); + exit(EXIT_SUCCESS); break; default: usage(); - exit(-1); + exit(EXIT_FAILURE); break; } } @@ -760,7 +788,7 @@ int MAIN_ZABBIX_ENTRY() zbx_create_itservices_lock(); #ifdef HAVE_SQLITE3 - zbx_create_sqlite3_mutex(CONFIG_DBNAME); + zbx_create_sqlite3_mutex(); #endif if (SUCCEED != DBcheck_version()) @@ -966,5 +994,5 @@ void zbx_on_exit() setproctitle_free_env(); #endif - exit(SUCCEED); + exit(EXIT_SUCCESS); } |