This page covers common configuration steps for Zabbix deployments.
| Component | Configuration Path |
|---|---|
| Zabbix Server | /etc/zabbix/zabbix_server.conf |
| Zabbix Agent | /etc/zabbix/zabbix_agentd.conf |
| Zabbix Agent 2 | /etc/zabbix/zabbix_agent2.conf |
| Web Frontend | /etc/zabbix/web/zabbix.conf.php |
Edit /etc/zabbix/zabbix_server.conf:
### Option: DBHost
# Name of host 'DBHost'
# Mandatory: no
# Default:
DBHost=localhost
### Option: DBName
# Database name 'DBName'
# Mandatory: yes
# Default:
DBName=zabbix
### Option: DBUser
# Database user 'DBUser'
# Mandatory: yes
# Default:
DBUser=zabbix
### Option: DBPassword
# Database password 'DBPassword'
# Mandatory: no
# Default:
DBPassword=your_secure_password
### Option: DBSocket
# Unix socket name 'DBSocket'
# Mandatory: no
# Default:
DBSocket=/var/run/postgresql/.s.PGSQL.5432
### Option: StartPollers
# Number of pre-forked instances of pollers
# Default: 5
StartPollers=50
### Option: StartTrappers
# Number of pre-forked instances of trappers
# Default: 5
StartTrappers=20
### Option: StartPingers
# Number of pre-forked instances of pingers
# Default: 1
StartPingers=10
### Option: StartDiscoverers
# Number of pre-forked instances of discoverers
# Default: 1
StartDiscoverers=15
### Option: StartHTTPPollers
# Number of pre-forked instances of HTTP pollers
# Default: 1
StartHTTPPollers=10
### Option: CacheSize
# Size of configuration cache
# Default: 8M
CacheSize=128M
### Option: HistoryCacheSize
# Size of history cache
# Default: 4M
HistoryCacheSize=128M
### Option: TrendCacheSize
# Size of trend cache
# Default: 4M
TrendCacheSize=32M
### Option: ValueCacheSize
# Size of value cache
# Default: 8M
ValueCacheSize=256M
### Option: AlertScriptsPath
# Full path to alert scripts directory
# Default:
AlertScriptsPath=/usr/lib/zabbix/alertscripts
### Option: ExternalScripts
# Full path to external scripts directory
# Default:
ExternalScripts=/usr/lib/zabbix/externalscripts
### Option: FpingLocation
# Location of fping
# Default:
FpingLocation=/usr/sbin/fping
### Option: Fping6Location
# Location of fping6
# Default:
Fping6Location=/usr/sbin/fping6
Edit /etc/zabbix/zabbix_agentd.conf:
### Option: Server
# List of IP addresses of Zabbix servers
# Mandatory: yes
Server=127.0.0.1,192.168.1.100
### Option: ServerActive
# List of Zabbix servers for active checks
# Mandatory: no
ServerActive=127.0.0.1,192.168.1.100
### Option: Hostname
# Unique hostname
# Mandatory: yes
Hostname= monitored-server
### Option: ListenPort
# Agent listening port
# Default: 10050
ListenPort=10050
### Option: ListenIP
# Agent listening IP
# Default: 0.0.0.0
ListenIP=0.0.0.0
### Option: RefreshActiveChecks
# How often to refresh active checks
# Default: 120
RefreshActiveChecks=60
### Option: BufferSend
# Do not keep data longer than this
# Default: 5
BufferSend=5
### Option: BufferSize
# Maximum number of values in buffer
# Default: 100
BufferSize=200
### Option: UserParameter
# Custom user parameters
UserParameter=custom.check[*],/usr/local/bin/check_script.sh $1
UserParameter=system.discovery[*],/usr/bin/zabbix_system_discovery.sh
Edit /etc/zabbix/web/zabbix.conf.php:
<?php
// Zabbix GUI configuration file
$DB = [
'TYPE' => 'POSTGRESQL',
'SERVER' => 'localhost',
'PORT' => '5432',
'DATABASE' => 'zabbix',
'USER' => 'zabbix',
'PASSWORD' => 'your_secure_password',
'SCHEMA' => '',
'DOUBLE_IEEE' => false,
'ENCRYPTION' => false,
'KEY_FILE' => null,
'CERT_FILE' => null,
'CA_FILE' => null,
'VERIFY_HOST' => false,
'CIPHER_LIST' => null,
];
$ZBX_SERVER = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'Zabbix Server';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
zabbix_server --config /etc/zabbix/zabbix_server.conf --runtime-control
zabbix_agentd --config /etc/zabbix/zabbix_agentd.conf --test
# Zabbix Server
sudo systemctl restart zabbix-server
# Zabbix Agent
sudo systemctl restart zabbix-agent2
# Web Server (Apache)
sudo systemctl restart apache2
# Web Server (Nginx + PHP-FPM)
sudo systemctl restart php-fpm
sudo systemctl restart nginx
sudo systemctl status zabbix-server
sudo systemctl status zabbix-agent2
zabbix_get -s localhost -k system.uptime
zabbix_agentd -t system.uptime
Access http://SERVER_IP/zabbix and verify login works.
Running Zabbix in regulated environments? We assist with:
Secure your deployment: office@linux-server-admin.com | Contact Page