How to install zabbix monitoring tool on CentOS7

This is very quick how to on installing zabbix on CentOS 7.

Install LAMP

'
yum -y install httpd
systemctl start httpd
systemctl enable httpd
yum -y install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install mod_php72w php72w-cli php72w-common php72w-devel php72w-pear php72w-gd php72w-mbstring php72w-mysql php72w-xml php72w-bcmath
yum -y install mariadb-server
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation

Create database for zabbix

create database zabbix; 
shell> mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by '';
mysql> flush privileges;
mysql> quit;

Edit php.ini and make changes that we specify below

vi /etc/php.ini
max_execution_time = 600
max_input_time = 600
memory_limit = 256M
post_max_size = 32M
upload_max_filesize = 16M
date.timezone = America/Toronto

Restart httpd to apply changes

systemctl restart httpd

Install Zabbix

yum install yum-utils
rpm -ivh https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
yum-config-manager --enable rhel-7-server-optional-rpms
yum install zabbix-server-mysql
yum install zabbix-proxy-mysql
yum install zabbix-web-mysql

Import database

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

Restart zabbix server

systemctl start zabbix-server
systemctl enable zabbix-server

Make changes to configuration files

vi  /etc/httpd/conf.d/zabbix.conf  
php_value date.timezone America/Toronto


vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBPassword="password"

Start and enable zabbix server

systemctl enable zabbix-server

Install zabbix agent

 
yum install zabbix-agent
service zabbix-agent start

You can now login to web interface
http:/ipaddress/zabbix

Default login
Admin
zabbix


Install client on windows 2016

1. Download Windows agent from this link — Zabbix agents

2. Extract it and copy bin\win64\zabbix_agentd.exe and conf\zabbix_agentd.win.conf files to c:\zabbix

3. Edit the c:\zabbix\zabbix_agentd.win.conf file to your needs, making sure to specify a correct “Hostname” parameter and “Server” parameter
Note: Make sure hostname is the same as specified under zabbix host configuration

4. After this is done use the following command to install Zabbix agent as Windows service

C:\> c:\zabbix\zabbix_agentd.exe -c c:\zabbix\zabbix_agentd.win.conf -i

5. Start zabbix agent in windows services


Install client on CentOS7

Make sure firewall ports are open before installing client

firewall-cmd --permanent --add-port=10051/tcp
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --reload

1. Install agent

 rpm -ivh https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
 yum install -y zabbix-agent

2. Edit configuration file

vi /etc/zabbix/zabbix_agentd.conf
Server=zabbix server 
Hostname=client_hostname

3. Restart service and enable it to start on boot

service zabbix-agent restart
systemctl enable zabbix-agent