According to Wikipedia:
Zabbix is enterprise open source monitoring software for networks and applications, created by Alexei Vladishev. It is designed to monitor and track the status of various network services, servers, and other network hardware.
Zabbix uses MySQL, PostgreSQL, SQLite, Oracle or IBM DB2 to store data. Its backend is written in C and the web frontend is written in PHP. Zabbix offers several monitoring options:
- Simple checks can verify the availability and responsiveness of standard services such as SMTP or HTTP without installing any software on the monitored host.
- A Zabbix agent can also be installed on UNIX and Windows hosts to monitor statistics such as CPU load, network utilization, disk space, etc.
- As an alternative to installing an agent on hosts, Zabbix includes support for monitoring via SNMP, TCP and ICMP checks, as well as over IPMI, JMX, SSH, Telnet and using custom parameters. Zabbix supports a variety of near-real-time notification mechanisms, including XMPP.
In this blog, I will be installing Zabbix 3.0 on The latest version of Amazon Linux version 2016.09 EC2 Using MySQL database server and Additional Japanese Language Interface.
Before we start, Please make sure you have Amazon linux ec2 running and connected to it using SSH protocol.
Then, Let's update your system by using the command below:
1 |
<span class="pln">$ sudo yum update</span> |
Step:1 Install PHP 7 modules and git
1 2 |
<span class="pln">$ sudo yum -y install php70 php70-bcmath php70-cli php70-common php70-devel php70-gd php70-json php70-mbstring php70-mcrypt php70-mysqlnd php70-opcache php70-pdo php70-process git </span> |
Step:2 Clone Prepared Zabbix Packages
I already prepared the packages necessary only for the zabbix server to be installed on your EC2 server. Now clone it using the git command below:
1 |
$ git clone https://github.com/Joeper214/zabbix_rpms.git |
Step:3 Install Zabbix Server, Database, Web Server, PHP packages, Japanese Language Web Interface and Modules.
1 |
$ cd zabbix_rpms |
1 |
$ sudo yum install ./fping-2.4b2-16.amzn1.x86_64.rpm ./iksemel-1.4-2.amzn1.x86_64.rpm ./zabbix-agent-3.0.4-1.amzn1.x86_64.rpm ./zabbix-web-japanese-3.0.4-1.amzn1.noarch.rpm ./zabbix-web-mysql-3.0.4-1.amzn1.noarch.rpm ./zabbix-server-mysql-3.0.4-1.amzn1.x86_64.rpm zabbix-sender-3.0.4-1.amzn1.x86_64.rpm ./zabbix-web-3.0.4-1.amzn1.noarch.rpm |
Step:4 Configure Zabbix Database.
Start the Database (MySQL) service
1 |
$ sudo chkconfig mysqld on |
1 |
$ sudo service mysqld start |
Now create the Zabbix Database (zabbix) and database user (zabbix_user) and grant all privileges to the user on the Zabbix database.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ mysql -uroot mysql> CREATE USER zabbix; Query OK, 0 rows affected (0.00 sec) mysql> CREATE DATABASE zabbix; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON zabbix_user.* TO zabbix@localhost IDENTIFIED BY '{your_own_choice_of_password}'; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> exit; |
Now import the database Schema using this commands below,
1 2 |
$ cd /usr/share/doc/zabbix-server-mysql-3.0.4/ $ zcat create.sql.gz| mysql -uroot zabbix_user |
Step:4 Copy the Zabbix Server Configuration file
Copy the Zabbix Server’s example config file (/usr/share/doc/zabbix-web-3.0.4/httpd24-example.conf/) to the apache (/etc/httpd/conf.d/zabbix.conf) location for zabbix
1 |
$ sudo cp /usr/share/doc/zabbix-web-3.0.4/httpd24-example.conf /etc/httpd/conf.d/zabbix.conf |
Then edit the Zabbix Server’s config file (/etc/httpd/conf.d/zabbix.conf) and specify the database name for zabbix , database user name & its password.
1 2 3 4 5 6 |
[root@zabbix ~]# vi /etc/zabbix/zabbix_server.conf ................................... DBHost=localhost DBName=zabbix DBUser=zabbix_user DBPassword=your_own_choice_of_password |
Configure PHP Setting
Set the below parameters in the PHP config file (/etc/php.ini )
1 2 3 4 5 6 7 8 9 |
$ sudo 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/Tokyo ............................... |
Start the Zabbix and Web Server Service and make sure it will run during reboot.
1 2 3 4 |
$ sudo service zabbix-server start $ sudo chkconfig zabbix-server on $ sudo service httpd start $ sudo chkconfig httpd on |
Installing frontend
Please see: Zabbix UI Installtion Guide
After you follow the instructions shown in the Zabbix Documentation Page.
Then you are good to go! Take time to explore and discover the awesomeness of zabbix monitoring tool.
If you have some questions, Please feel free to comment below. Thank!