Zabbix Installation
Basic configuration
Configuring network
# vim /etc/sysconfig/network-script/ifcfg-eth0
BOOTPROTO="static"
ONBOOT="yes"
IPADDR=...
NETMASK=...
GATEWAY=...
DNS1=...
DNS2=...
systemctl restart network
System startup tasks
yum install epel-release
yum install vim wget ntpdate bash-completion-extras
timedatectl set-timezone Asia/Tehran
yum -y install ntpdate
ntpdate pool.ntp.org
systemctl start ntpdate
systemctl enable ntpdate
hostnamectl set-hostname zabbix-server
Installing Zabbix repository
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all
Installing Zabbix component
Zabbix server and agent
yum install zabbix-server-mysql zabbix-agent
Zabbix frontend
# Enable redhat software collections
yum install centos-release-scl
Edit /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository
[zabbix-frontend]
...
enabled=1
...
Install Zabbix frontend packages
yum install zabbix-web-mysql-scl zabbix-apache-conf-scl
Installing MariaDB Database
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
yum install MariaDB-server MariaDB-client
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
Create initial database
mysql -uroot -p
create database zabbix character set utf8 collate utf8_bin;
create user zabbix@localhost identified by 'password';
grant all privileges on zabbix.* to zabbix@localhost;
quit;
Import database schema
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Configure the database for Zabbix server
vim /etc/zabbix/zabbix_server.conf
# line 124: uncomment and change the password
Installing Apache web server
yum -y install httpd
rm -f /etc/httpd/conf.d/welcome.conf
# vim /etc/httpd/conf/httpd.conf
line 86 => ServerAdmin root@zabbix.anisa.local
line 95 => ServerName zabbix.anisa.local:80
line 151 => AllowOverride All
line 164 => DirectoryIndex index.html index.cgi index.php
add follows to the end:
ServerSignature off
ServerTokens Prod
KeepAlive On
systemctl start httpd
systemctl enable httpd
Firewall configuration for Apache
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
Configure PHP for Zabbix frontend
# vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
line 24: uncomment and set Asia/Tehran
Start Zabbix server and agent processes
systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
Configuring Zabbix Firewall
# ZABBIX Server Port: 10051
# ZABBIX Agent Port: 10050
firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent
firewall-cmd --reload
Configuring Zabbix wizard
On browser type following url
zabbix_server_{ ip | fqdn }/zabbix
Default authentication on Zabbix:
- user: Admin
- password : zabbix
SELinux Configuration:
setsebool -P httpd_can_connect_zabbix on
setsebool -P httpd_can_network_connect_db on
yum install policycoreutils-python
grep zabbix_t /var/log/audit/audit.log | audit2allow -M zabbix_server_custom
semodule -i zabbix_server_custom.pp
# Srounding on Zabbix frontend
grep zabbix_t /var/log/audit/audit.log | audit2allow -M zabbix_server
semodule -i zabbix_server.pp