Showing posts with label zabbix. Show all posts
Showing posts with label zabbix. Show all posts

Saturday, June 27, 2020

Install Zabbix Agent on Centos 7

Description: Here I have explained how to install Zabbix Agent on Centos 7

Procedure: Below is the procedure to install Zabbix agent on Centos 7
  • Update and Upgrade packages on systems 
  # yum update
# yum upgrade
  • Install Zabbix Repository
# yum install https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
  • Install Zabbix Agent on CentOS 7
# yum install zabbix-agent
  • Once the installation completed configure zabbix agent in order to communicate Zabbix server. The default file is /etc/zabbix/zabbix_agentd.conf 
  • Edit server details as follow.
Server=103.67.236.58
ServerActive=103.67.236.58
Hostname=test1.example.com
  • Configure firewall to allow traffic port for passive check
firewall-cmd --add-port=10050/tcp --permanent 
firewall-cmd --reload
  • Start and Enable service boot time
systemctl start zabbix-agent
systemctl enable zabbix-agent
  • Add Centos server from Zabbix

Install Zabbix Agent on Windows Server

Description: Here I have explained how to install zabbix agent on windows server

Procedure: 

  • Download the agent from URL https://www.zabbix.com/download_agents/
  • Extract zip file 
  • Make a directory and copy all files in same directory like c:\zabbix
  • Open zabbix agent configuration file zabbix_agentd_win.conf and modify below changes 
Server=103.67.236.58
ServerActive=103.67.236.58
  • Register as windows service using below command
  c:\zabbix\zabbix_agentd.exe -c c:\zabbix\zabbix_agentd.win.conf -i

  • Start service after register


  • Once agent installed add device in zabbix

Thursday, June 11, 2020

How to install Zabbix on Centos-7

Procedure: Here I have explained how to install zabbix on Centos-7

Prerequisites:
  • Centos 7 Sever 
  • Root Privileges
Steps:
Install Apache2/httpd : First we install http on centos server using below command.
  start and enable service after install. 

# yum -y install httpd
# systemctl start httpd
# systemctl enable httpd

Install PHP 7.2 on Centos 7: Before install php 7.2 we will install webtatic and the EPEL repository to the system.

# yum -y install epel-release
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Install PHP using below command


 # yum -y install mod_php72w php72w-cli php72w-common php72w-devel php72w-pear php72w-gd php72w-mbstring php72w-mysql php72w-xml php72w-bcmath

Once Installation complete make below changes on php.ini PHP configuration file locate on /etc/php.ini

 
# 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 = Asia/Kolkata

Once file modified restart httpd service
# systemctl restart httpd

Install and Configure MariaDB: Zabbix supports many database including MySQL, PostgreSQL, SQLite, Oracle Database. We will install MariaDB as a database for Installation.

# yum -y install mariadb-server

After installation start and enable mariadb service

# systemctl start mariadb
# systemctl enable mariadb

Configure MariaDB using below command and setup root password
# mysql_secure_installation

Create Database and user for zabbix. Assigned rights for same.
# mysql -u root -p

create database zabbixdb;
grant all privileges on zabbixdb.* to zabbixuser@'localhost' identified by 'password';
grant all privileges on zabbixdb.* to zabbixuser@'%' identified by 'password';
flush privileges;

Install and Configure Zabbix 3.4

Add zabbix repository to Centos 7 and Install zabbix

 
# yum -y install http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm

# yum -y install zabbix-get zabbix-server-mysql zabbix-web-mysql zabbix-agent


Import Database: Import database from backup Zabbix database sample to our 'zabbix' database

# cd /usr/share/doc/zabbix-server-mysql-3.4.6/
# gunzip create.sql.gz
# mysql -u root -p zabbixdb < create.sql

Configure Zabbix: Configure zabbix by change below in configuration file.
# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBPassword=password


Start and Enable Zabbix service using below command
 
# systemctl start zabbix-server
# systemctl enable zabbix-server

Allow Require port in firewall and reload it.
# firewall-cmd --add-service={http,https} --permanent
# firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent
# firewall-cmd --reload
# firewall-cmd --list-all


  • Open browser and browse http://IP_Address/zabbix/ 
  • Setup database user and database configuration in setup
  • Once setup will completed open URL http://IP_Address/zabbix 
User Name : Admin 
Password : zabbix