Posted on

Who should read this blog?

Every IT Specialist, IT Man, DevOps Engineer OR anyone who wants to monitor their Services, Servers, IoT Devices on beautiful charts might find these series of blogs useful. I will share all the Dashboards, Shell-Scripts, plugins, … which I used to plot the interesting things on a Map or a Chart.

Since I am not a native English speaker, I might have too many Grammar issues & Typo in all of the blogs. So, Help me correct them ;-). Your feedback is really important to make this blog useful for others.

About Zabbix

I think Zabbix Team could introduce themselves better that me. So let me paste their quote here. 😉

“Our aims are to develop an exceptional monitoring solution and to provide responsive and dependable support to resolve any issues regarding its installation, operation and use…” Zabbix Team. To know more about Zabbix LLC visit this page: https://www.zabbix.com/about

About Grafana

Grafana is an Opensource Data visualization & Monitoring with support for Graphite, InfluxDB, Prometheus, Elasticsearch and many more databases. Visit Grafana website: https://grafana.com

Steps to go

  1. Installing Zabbix: We will install Zabbix on Ubuntu Server 18.4 to gather information from several devices & Services. Zabbix has many predefined templates to gather information from devices. Also many people will share the templates which they made that you can Import it to your Zabbix server. I think official website https://share.zabbix.com and this repository on github https://monitoringartist.github.io/zabbix-searcher might help you find the template that you are looking for.

    • Sampling Data: Configuring Zabbix to gather information from VMware vSphere SDK

  2. Installing Grafana: Although by using Zabbix you can plot charts according to the items that you’ve gathered, I find Grafana a better solution for Data Visualizations. There is a wonderful plugin which you can use to integrate Zabbix and Grafana. This plugin developed by “Alexander Zobnin” and it’s available here https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app

    • Integration: Installing Zabbix-App Plugin

    • Data Visualization: Using Zabbix-App as a data source and visualize metrics

Time to get your hands dirty

  • Install Zabbix

    You can install Zabbix using different methods like Package, Docker container, A virtual Appliance, Compile it from it’s source. I will use DEB package to install it on Ubuntu Server 18.04. But if you are interested in any others you can visit https://www.zabbix.com/download. They provided the great documentation. Also you can choose to use MySQL or PostgreSQL for your Zabbix server. I will use MySQL for this training article.

    Adding Zabbix Repo: As I mentioned before, I am running Ubuntu Server 18.04 (bionic) and we need to Add Zabbix Repo for this version using the further commands

    
    $ wget https://repo.zabbix.com/zabbix/4.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.2-1+bionic_all.deb
    $ sudo dpkg -i zabbix-release_4.2-1+bionic_all.deb
    $ sudo apt-get update
    			

    Zabbix Installation: Simply run the following command to Install MySQL Server & Zabbix together with a single command

    
    $ sudo apt-get install -y zabbix-server-mysql zabbix-frontend-php zabbix-agent
    			

    MySQL DB Configuration: Use these commands to configure Zabbix DB Configuration

    
    $ sudo mysql
    MariaDB [(none)]> CREATE DATABASE zabbix CHARACTER SET utf8 collate utf8_bin;
    MariaDB [(none)]> GRANT ALL ON zabbix.* TO 'zabbix'@'localhost' IDENTIFIED BY 'STRONG-PASSWORD';
    			

    *** Don’t Forget to change ‘STRONG-PASSWORD’ with your own password! ***

    Database Initialization: We have to initialize Zabbix DB with the provided DB schema by Zabbix Team.

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

    Change Zabbix DB Config: To let Zabbix connect to DB you must edit file /etc/zabbix/zabbix_server.conf. Change the DBPassword value with the STRONG PASSWORD that you have chosen before.

    
    DBPassword=STRONG-PASSWORD
    			

    Timezone Configuration: One of the most important configuration which you need to config is your Timezone. To do that you need to edit /etc/zabbix/apache.conf. Uncomment # php_value date.timezone Europe/Riga and replace Europa/Riga with your time zone. Since I am living in Iran, I will change it to Asia/Tehran.

    
    php_value date.timezone Asia/Tehran
    			

    Also, You might need to edit the /etc/php/7.2/apache2/php.ini and change the line ;date.timezone = with your timezone. For me, The correct option is: date.timezone = Asia/Tehran

    Restart & Auto-Start Needed Services: To make your changes effective, restart the services and let the OS start them automatically on OS startup using these two commands

    
    sudo systemctl restart zabbix-server zabbix-agent apache2
    sudo systemctl enable zabbix-server zabbix-agent apache2 
    			

  • Configuring Zabbix Front-End

    To open Zabbix front-end App you need to open this URL on your browser: http://your-server-IP-or-FQDN/zabbix

    Zabbix Installation

    click on Next Step button.

    Installation will check the installation pre-requisites. If you do the mentioned steps, You must see every thing is fine like the further screenshot 😉

    Zabbix Installation

    If everything is fine, click on Next Step button.

    Now, You should provide your DB Connection. According to our installation Our DB name and username is zabbix and you setup a “STRONG-PASSWORD” for this user. Now put that password in password field and let other field as it is then click on Next step button.

    Zabbix Installation

    Now we have to provide the Zabbix Server details. Change it to your need. Name field is optional and if you set it, It will be displayed in Menu Bar and Page Titles.

    Zabbix Installation

    Click on Next step button to review your installation

    If everything is fine, Click on Next step to continue with Front-end installation

    Zabbix Installation

    If everything goes well, you will see the Congratulations! You have successfully installed Zabbix frontend. message like the screenshot.

    Zabbix Installation

    Click on Finish button to finish the installation.

    You will be redirected to Login page. The default username and password is (username: Admin, Password: zabbix)

    Zabbix Login Page

    After login you can see the Zabbix Server Health by clicking on the All Dashboard and then click on Zabbix server health dashboard.

    Zabbix Server Health

Next Step

Now we finished our Zabbix Installation. In PART 2 we will continue our installation with Grafana on the same machine to provide Data Visualization to the items that Zabbix has gathered!

Let me know your great opinions by commenting them here 😉

Leave a Reply

Your email address will not be published. Required fields are marked *