How to Install and Configuring Zabbix 4.2.5 on Ubuntu, Linuxmint, Debian & CentOS, Fedora, Redhat Linux - Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee

Wednesday, October 16, 2019

How to Install and Configuring Zabbix 4.2.5 on Ubuntu, Linuxmint, Debian & CentOS, Fedora, Redhat Linux

How to install and compile Zabbix server from sources on Debian 8 Jessie and RHEL/CentOS 7 with MySQL backend database to store collected data, PHP and Apache Web Server as the mainly web interface.
Install Initial Required Software and Dependencies

Website :- https://www.zabbix.com

[On Ubuntu, Linuxmint, Debian]
Step 1 :-
sudo apt-get install build-essential gcc curl wget libsnmp-dev libcurl4-gnutls-dev libxml2-dev

[On CentOS, Fedora, Redhat Linux]
Step 2 :- yum install gcc gcc-c++ make openssl-devel curl wget net-snmp net-snmp-utils net-snmp-libs net-snmp-devel gnutls gnutls-devel libxml2 libxml2-devel

Install MariaDB Database and Library

[On Ubuntu, Linuxmint, Debian]
Step 3 :- sudo apt-get install mariadb-server mariadb-client libmysqld-dev

[On CentOS, Fedora, Redhat Linux]
Step 4 :- yum install mariadb-server mariadb-client mariadb-devel
Step 5 :- mysql_secure_installation

Install Apache Web Server and PHP

[On Ubuntu, Linuxmint, Debian]
Step 6 :- sudo apt-get install apache2 php5 php5-mysql php5-gd php5-cli php5-xmlrpc

[On CentOS, Fedora, Redhat Linux]
Step 7 :- yum install httpd php php-mysql php-gd pgp-cli php-xml php-bcmath php-mbstring mod_ssl openssl

[On Ubuntu, Linuxmint, Debian]
Step 8 :- sudo nano /etc/php5/apache2/php.ini

[On CentOS, Fedora, Redhat Linux]
Step 8 :- nano /etc/php.ini
http://php.net/manual/en/timezones.asia.php#113195

Now, search with CTRL+C and replace the following PHP values as it follows:
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = Continent/City --- Chennai, Kolkata, Mumbai, New Delhi
always_populate_raw_post_data = -1



[On Ubuntu, Linuxmint, Debian]
Step 9 :- sudo systemctl restart apache2.service

[On CentOS, Fedora, Redhat Linux]
Step 10 :- systemctl restart httpd.service

Download, Compile and Install Zabbix Server

Step 11 :- wget http://sourceforge.net/projects/zabbix/files/ZABBIX\ Latest\ \Stable/4.2.5/zabbix-4.2.5.tar.gz
Step 11 :- wget http://sourceforge.net/projects/zabbix/files/ZABBIX\ Latest\ \Stable/4.2.5/zabbix-4.2.5.tar.gz
Step 12 :- ls
Step 13 :- tar xfz zabix-4.2.5.tar.gz
Step 14 :- cd zabix-4.2.5.tar.gz/
Step 15 :- ls
Step 16 :- ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
Step 17 :- make
Step 18 :- make install

Zabbix Post-Installation System Settings
Step 19 :- groupadd zabbix
Step 20 :- useradd -g zabbix -d /usr/local/share/zabbix -s /bin/false zabbix

Configure MariaDB Database for Zabbix
Step 21 :- mysql -u root -p

MariaDB> create database zabbix;
MariaDB> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'your_password';
MariaDB> flush privileges;
MariaDB> exit

Step 22 :- cd zabbix-4.2.5/
Step 23 :- ls database/mysql/
Step 24 :- mysql -u zabbix -p zabbix < database/mysql/schema.sql
Step 25 :- mysql -u zabbix -p zabbix < database/mysql/images.sql
Step 26 :- mysql -u zabbix -p zabbix < database/mysql/data.sql

Configure Apache Webserver for Zabbix
Step 27 :- rm /var/www/html/index.html
Step 28 :- cp -rf frontends/php/* /var/www/html/

[On Ubuntu, Linuxmint, Debian]
Step 29 :- usermod -aG www-data zabbix
Step 30 :- a2enmod ssl
Step 31 :- a2ensite default-ssl
Step 32 :- systemctl restart apache2.service

[On CentOS, Fedora, Redhat Linux]
Step 33 :- usermod -aG apache zabbix
Step 34 :- systemctl restart httpd.service

Configure Zabbix Server

Step 35 :- nano /usr/local/etc/zabbix_server.conf
Once the file is opened for editing search and replace the following values accordingly:
ListenPort=10051
LogFile=/var/log/zabbix_server.log


DBHost=localhost ## Replace with the IP of the remote database in case MySQL server is located on a different host
DBName=zabbix ## Use the name of the Zabbix MySQL database
DBUser =zabbix ## Use the name of the Zabbix MySQL database User
DBPassword=password ## Zabbix MYSQL database password
DBSocket=/var/run/mysqld/mysqld.sock
DBPort=3306

Finally, after all the server configurations are in place, start Zabbix Server and Agent (to collect data about localhost) by issuing the following commands:
Step 36 :- touch /var/log/zabbix_server.log
Step 37 :- chmod 775 /var/log/zabbix_server.log
Step 38 :- chgrp zabbix /var/log/zabbix_server.log
Step 39 :- /usr/local/sbin/zabbix_server
Step 40 :- /usr/local/sbin/zabbix_agentd
Step 41 :- /usr/local/sbin/zabbix_agent
Step 42 :- netstat -tulpn

Install Zabbix Web Frontend Interface

Step 43 :-
http://192.168.1.221/setup.php
OR
https://192.168.1.221/setup.php

[on Ubuntu, Linuxmint, Debian]

Step 44 :-
chown -R www-data /var/www/html/conf/
[on CentOS, Fedora, Redhat Linux]

Step 45 :- chown -R apache /var/www/html/conf/
Step 46 :- chown -R root /var/www/html/conf/
Step 47 :- Username: admin
Step 48 :- Password: zabbix

In order to start Zabbix daemons after system reboot, open /etc/rc.local file for editing and add the following lines before exit 0 statement:
Step 43 :- /usr/local/sbin/zabbix_agentd
Step 44 :- /usr/local/sbin/zabbix_agent
Step 45 :- /usr/local/sbin/zabbix_server

Error 1
Deleted the database created then recreate the database name in mysql

Error 2
Check timezone remove ; before the

That's it
----------------------------------------------------------------------------------------------------------------------
Providing on the Web, online library and learning platform for IT Professional Developers with a unique blend of original content, peer-to-peer advice from the largest community of IT.

For The Latest Technology & Topics...

Redhat Linux | Linux Howtos | Ubuntu | Linux News | Centos | Linux Mint | Fedora | Linux Commands | Interview Question & Answers | Lintu Tricks | Linux Commands | Debian | Cinnamon | Apache | MySQL | Databases | Oracle-db | Java | SQL | pgAdmin | DevOps | Scripting | Python | Jenkins | Amazon AWS | Programming | Videos for Developers | Security & Hacking | VMware | Desktop | Laptops | Servers | Networking | Cloud | Installation | Operating System | MS Office | Switches | Routers | Firewall | Open Source | Outlook,Thunderbird, Gmail Emails | Monitoring Software | JavaScript | YouTube | Android | Smartphone | Facebook | WhatsApp | Snapchat | Instagram | WordPress | Virtualbox | Browsers | Software | Hardware | Internet | Maintenance & Optimization | Antivirus | News | Google Play Store Apps | Prices | SEO | PC Games | Mobile Games | iPhone | Microsoft Windows 7 | Windows 10 | Windows Server 2012/2016/2019 | Windows Tips & Tricks | Tutorials | Training | Troubleshooting | Guides | Tips and Tricks | Reviews | Technology | IT Support | IT News | Advice for Technology | Features | Cloud | Cloud Computing | Privacy & Security| Banks

Follow Cloud Network on Twitter, Facebook and Subscribe to our YouTube channel.