Installing Zabbix on CentOS 7

From rdkwiki
Jump to: navigation, search

Intro

The steps below will configure a working Zabbix server. The steps assume that you have a (fresh) CentOS 7 server running.

install Zabbix Server binaries

MySQL installation and configuration

You can find how to install the MySQL database-server here: installing MySQL

copy the create.mysql.gz from the directory /usr/share/doc/zabbix-server-mysql-*/ where you installed the zabbix binaries to your mysql-server.

  • mysql -h localhost -u root -p --> logon to your mysql server
  • create database zabbix; --> create empty zabbix database
  • grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'password'; --> set rights for on db for user zabbix
  • flush privileges; --> reload privileges
  • exit --> quite mysql
  • gunzip create.sql.gz --> extract file
  • mysql -h localhost -u root -p zabbix < create.sql --> create database content

install Zabbix Server

  • sudo yum -y install http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm --> install rpm
  • sudo yum install zabbix-get zabbix-server-mysql zabbix-web-mysql --> install Zabbix-server
  • sudo nano /etc/zabbix/zabbix_server.conf --> change DBHost, DBUser and DBPassword
  • sudo systemctl start zabbix-server --> start the Zabbix Server
  • sudo systemctl enable zabbix-server --> auto-start the Zabbix Server at system startup

install Zabbix Agent

  • sudo yum install zabbix-agent --> install Zabbix-agent
  • sudo nano /etc/zabbix/zabbix_agentd.conf --> change "Server", "ServerActive" and "Hostname"
  • sudo systemctl start zabbix-agent --> start the Zabbix Agent
  • sudo systemctl enable zabbix-agent --> auto-start the Zabbix Agent at system startup

Change httpd settings

  • sudo nano /etc/httpd/conf.d/zabbix.conf --> change "Require all granted" into allowed IP's: "Require ip 127.0.0.1 10.0.0.0/24" (for example) and change timezone "php_value date.timezone Asia/Amsterdam"
  • sudo systemctl restart httpd --> restart webserver

Firewall settings

  • sudo firewall-cmd --add-service={http,https} --permanent --> Allow http and https traffic
  • sudo firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent --> Allow ports for Zabbix communication
  • sudo firewall-cmd --reload --> restart firewall with new configurations

SELINUX settings

  • setsebool -P httpd_can_network_connect_db 1 --> Allow httpd to connect to remote database


if everything worked out well you should be able to reach your new Zabbix server at http://<ip or DNS-name of zambix-server>/zabbix