zabbix-docker/Dockerfiles/web-apache-mysql/centos/conf/etc/zabbix/web/zabbix.conf.php

57 lines
2.8 KiB
PHP
Raw Normal View History

2016-08-03 10:09:49 +02:00
<?php
// Zabbix GUI configuration file.
2018-06-01 11:02:20 +02:00
global $DB, $HISTORY;
2016-08-03 10:09:49 +02:00
2020-09-10 14:05:17 +02:00
$DB['TYPE'] = getenv('DB_SERVER_TYPE');
$DB['SERVER'] = getenv('DB_SERVER_HOST');
$DB['PORT'] = getenv('DB_SERVER_PORT');
$DB['DATABASE'] = getenv('DB_SERVER_DBNAME');
2021-11-04 14:42:05 +01:00
$DB['USER'] = (! getenv('VAULT_TOKEN') || ! getenv('ZBX_VAULTURL')) ? getenv('DB_SERVER_USER') : '';
$DB['PASSWORD'] = (! getenv('VAULT_TOKEN') || ! getenv('ZBX_VAULTURL')) ? getenv('DB_SERVER_PASS') : '';
2016-08-03 10:09:49 +02:00
2020-10-08 11:05:12 +02:00
// Schema name. Used for PostgreSQL.
2020-09-10 14:05:17 +02:00
$DB['SCHEMA'] = getenv('DB_SERVER_SCHEMA');
2016-08-03 10:09:49 +02:00
2021-11-17 09:31:10 +01:00
if (getenv('ZBX_SERVER_HOST')) {
$ZBX_SERVER = getenv('ZBX_SERVER_HOST');
$ZBX_SERVER_PORT = getenv('ZBX_SERVER_PORT');
}
2020-09-10 14:05:17 +02:00
$ZBX_SERVER_NAME = getenv('ZBX_SERVER_NAME');
2016-08-03 10:09:49 +02:00
// Used for TLS connection.
2020-09-11 09:39:21 +02:00
$DB['ENCRYPTION'] = getenv('ZBX_DB_ENCRYPTION') == 'true' ? true: false;
$DB['KEY_FILE'] = getenv('ZBX_DB_KEY_FILE');
$DB['CERT_FILE'] = getenv('ZBX_DB_CERT_FILE');
$DB['CA_FILE'] = getenv('ZBX_DB_CA_FILE');
$DB['VERIFY_HOST'] = getenv('ZBX_DB_VERIFY_HOST') == 'true' ? true: false;
$DB['CIPHER_LIST'] = getenv('ZBX_DB_CIPHER_LIST') ? getenv('ZBX_DB_CIPHER_LIST') : '';
2020-10-08 11:05:12 +02:00
// Vault configuration. Used if database credentials are stored in Vault secrets manager.
$DB['VAULT_URL'] = getenv('ZBX_VAULTURL');
$DB['VAULT_DB_PATH'] = getenv('ZBX_VAULTDBPATH');
$DB['VAULT_TOKEN'] = getenv('VAULT_TOKEN');
// Use IEEE754 compatible value range for 64-bit Numeric (float) history values.
// This option is enabled by default for new Zabbix installations.
// For upgraded installations, please read database upgrade notes before enabling this option.
2020-09-11 09:39:21 +02:00
$DB['DOUBLE_IEEE754'] = getenv('DB_DOUBLE_IEEE754') == 'true' ? true: false;
2018-06-01 11:02:20 +02:00
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
// Elasticsearch url (can be string if same url is used for all types).
2020-09-11 09:39:21 +02:00
$history_url = str_replace("'","\"",getenv('ZBX_HISTORYSTORAGEURL'));
2020-09-12 14:15:07 +02:00
$HISTORY['url'] = (json_decode($history_url)) ? json_decode($history_url, true) : $history_url;
2018-06-01 11:02:20 +02:00
// Value types stored in Elasticsearch.
2020-09-11 09:39:21 +02:00
$storage_types = str_replace("'","\"",getenv('ZBX_HISTORYSTORAGETYPES'));
2020-09-12 14:15:07 +02:00
$HISTORY['types'] = (json_decode($storage_types)) ? json_decode($storage_types, true) : array();
2020-09-11 09:39:21 +02:00
// Used for SAML authentication.
2020-10-06 11:08:16 +02:00
$SSO['SP_KEY'] = file_exists('/etc/zabbix/web/certs/sp.key') ? '/etc/zabbix/web/certs/sp.key' : (file_exists(getenv('ZBX_SSO_SP_KEY')) ? getenv('ZBX_SSO_SP_KEY') : '');
$SSO['SP_CERT'] = file_exists('/etc/zabbix/web/certs/sp.crt') ? '/etc/zabbix/web/certs/sp.crt' : (file_exists(getenv('ZBX_SSO_SP_CERT')) ? getenv('ZBX_SSO_SP_CERT') : '');
2020-09-12 14:15:07 +02:00
$SSO['IDP_CERT'] = file_exists('/etc/zabbix/web/certs/idp.crt') ? '/etc/zabbix/web/certs/idp.crt' : (file_exists(getenv('ZBX_SSO_IDP_CERT')) ? getenv('ZBX_SSO_IDP_CERT') : '');
2020-09-11 09:39:21 +02:00
$sso_settings = str_replace("'","\"",getenv('ZBX_SSO_SETTINGS'));
2020-09-12 14:15:07 +02:00
$SSO['SETTINGS'] = (json_decode($sso_settings)) ? json_decode($sso_settings, true) : array();