Zabbix Server in Ubuntu 16.04
Installation Environment
Virtual Machine (VM Virtualbox / VMWARE)
HDD - 30 GB
RAM - 4 GB
Network Mode - Bridge
UBUNTU - 16.04.4
IP address - Static / Dynamic
Hostname - www.example.com
Observium Installation Steps:
Install a fresh Ubuntu OS (16.04.4) in the VM.
Set hostname as per convenience. (I used www.example.com)
Update and upgrade existing packages.
Install packages and dependencies for Zabbix as shown below:
root@www:/home/bolcorp# apt-get install apache2
root@www:/home/bolcorp# apt-get install mysql-server
root@www:/home/bolcorp# apt-get install php php7.0-cli php7.0-common php7.0-mysql php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php
*** During the installation of mysql server, we will be prompted by mysql server for a root password. We will set it accordingly and later we will use that password to access the mysql server.
Restart apache2 service
root@www:/home/bolcorp# service apache2 restart
Download Zabbix file and install it as follows:
root@www:/home/bolcorp# wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+xenial_all.deb
root@www:/home/bolcorp# sudo dpkg -i zabbix-release_4.0-3+xenial_all.deb
root@www:/home/bolcorp# wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
root@www:/home/bolcorp# sudo dpkg -i zabbix-release_3.2-1+xenial_all.deb
Update all packages.
root@www:/home/bolcorp# apt update
Install Zabbix mysql and Zabbix frontend-php.
root@www:/home/bolcorp# apt-get install zabbix-server-mysql root@www:/home/bolcorp# apt-get install zabbix-frontend-php
Configure Zabbix mysql database and user. Goto mysql terminal
root@www:/home/bolcorp# mysql -u root -p
Enter password: ******
mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> cd database/myslq
mysql -uzabbix -ppassword zabbix < schema.sql
mysql -uzabbix -ppassword zabbix < images.sql
mysql -uzabbix -ppassword zabbix < data.sql
\q
Create Zabbix mysql table
root@www:/home/bolcorp# cd /usr/share/doc/zabbix-server-mysql/
root@www:/usr/share/doc/zabbix-server-mysql/# ls
changelog.Debian.gz copyright create.sql.gz
root@www:/usr/share/doc/zabbix-server-mysql/#
zcat create.sql.gz | mysql -uroot zabbix -p
[Use mysql root password]
Edit Zabbix Server conf file and make chaags as follows:
root@www:/usr/share/doc/zabbix-server-mysql/#
vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=password
Edit your Server local time zone where Server located. When your server Newyork then type America/New_York into php.ini file. (Line number 924)
root@www:/usr/share/doc/zabbix-server-mysql/#
vi /etc/php/7.0/apache2/php.ini
date.timezone ="Asia/Dhaka”
Restart apache & zabbix services.
root@www:/home/bolcorp# service apache2 restart
root@www:/home/bolcorp# service zabbix-server restart
Now browse the Zabbix server in the web interface: [user:Admin | pass:zabbix]
http://192.168.20.x/zabbix/
Now we will install & configure zabbix agent to monitor the server itself.
root@www:/home/bolcorp# apt install zabbix-agent
root@www:/home/bolcorp# cd /etc/zabbix/
root@www:/home/bolcorp# ls
apache.conf web zabbix_agentd.conf zabbix_agentd.d zabbix_server.conf
root@www:/home/bolcorp# vim zabbix_agentd.conf
#Server=[zabbix server ip]
#Hostname=[Hostname of client system ]
Server=127.0.0.1 [Or Use OS IP ]
Hostname=Zabbix Server [Optional]
service zabbix-agent restart
Email Alert:
https://techexpert.tips/zabbix/zabbix-email-notification-setup/ [Nov21, 2019]
https://www.oodlestechnologies.com/blogs/How-to-configure-mail-alerts-on-zabbix-server/
https://www.tecmint.com/configure-zabbix-to-send-email-alerts-to-gmail/
https://techexpert.tips/zabbix/zabbix-email-notification-setup/
https://www.youtube.com/watch?v=UZ5a3RLTZwA
Problem & Solution:
PHP bcmath extension missing (PHP configuration parameter --enable-bcmath).
PHP mbstring extension missing (PHP configuration parameter --enable-mbstring).
PHP xmlwriter extension missing.
PHP xmlreader extension missing.
Fix these errors with the following:
sudo apt-get install php-bcmath
sudo apt-get install php-mbstring
sudo apt-get install php-xml
PHP mbstring extension missing (PHP configuration parameter --enable-mbstring).
PHP xmlwriter extension missing.
PHP xmlreader extension missing.
Fix these errors with the following:
sudo apt-get install php-bcmath
sudo apt-get install php-mbstring
sudo apt-get install php-xml
Comments
Post a Comment