Hero Image

Grafana and Zabbix 3.4 setup on ubuntu

Zabbix Install

Php installation

sudo apt update
sudo apt dist-upgrade
sudo apt install php7.0-xml php7.0-bcmath php7.0-mbstring

Add repository

Setup the repository.

wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
sudo dpkg -i zabbix-release_3.4-1+xenial_all.deb
sudo apt update

Server packages

For the server, install these packages:

sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent

Setup the database

This will setup MySQL for the use of Zabbix.

mysql -uroot -p

Set privileges.

create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'your_password';
flush privileges;
quit;

Import the database.

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

Zabbix configure

Update the database settings to the config.

sudo nano /etc/zabbix/zabbix_server.conf
...
### Option: DBPassword                           
#       Database password. Ignored for SQLite.   
#       Comment this line if no password is used.
#                                                
# Mandatory: no                                  
# Default:                                       
# DBPassword=

DBPassword=your_zabbix_mysql_password

Update the web server config

sudo nano /etc/zabbix/apache.conf
...
<IfModule mod_php7.c>
    php_value max_execution_time 300
    php_value memory_limit 128M
    php_value post_max_size 16M
    php_value upload_max_filesize 2M
    php_value max_input_time 300
    php_value always_populate_raw_post_data -1
    # php_value date.timezone Europe/Riga
</IfModule>

Adjust timezone to your country. Here is a list of supported timezones: http://php.net/manual/en/timezones.php

Apply settings

Apache restart and zabbix start

sudo systemctl restart apache2
sudo systemctl start zabbix-server

Check the status

Check the status to be sure that everthing is setup properly.

sudo systemctl status zabbix-server apache2

You should see active (running) for both.

Enable Zabbix

Now its time to enable Zabbix at boot time.

sudo systemctl enable zabbix-server

Continue with the web interface

The rest of the setup is done throught the web interface.

To access to the web interface, open your web browser to this address http://your_zabbix_server_ip_address/zabbix/.

Client package

For the client, setup the repository and install this package:

sudo apt install zabbix-agent

Update the client config

Now the client need to know who is the server.

sudo nano /etc/zabbix/zabbix_agentd.conf
### Option: Server
#       List of comma delimited IP addresses (or hostnames) of Zabbix servers.
#       Incoming connections will be accepted only from the hosts listed here.
#       If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
#
# Mandatory: no
# Default:
# Server=

Server=zabbix_server_ip

Do the same for server active and hostname.

Beware, hostname needs to be the exact name of the client computer.

Apply the client settings

Now we're almost done, we just need to apply settings and add host the configuration.

sudo systemctl start zabbix-agent
sudo systemctl enable zabbix-agent
sudo systemctl status zabbix-agent

You should see active (running).

Firewal setup

This needs to be done on both, clients and server(s).

sudo ufw allow 10050/tcp
sudo ufw allow 10051/tcp

Add the host to the configuration

This is the last step to finish the Zabbix installation.

Proceed as usual

Grafana

Quick install instructions for using Grafana with Zabbix.

sudo nano /etc/apt/sources.list

Add this line: deb https://packagecloud.io/grafana/stable/debian/ jessie main

Install the repository key:

curl https://packagecloud.io/gpg.key | sudo apt-key add -

Update package information and install the server package:

sudo apt update
sudo apt install grafana

Start the service and check the status:

sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server

You should see active (running).

Let the server start at boot:

sudo systemctl enable grafana-server.service

Install the plugin

Now we can continue and install the Zabbix plugin for Grafana.

sudo grafana-cli plugins install alexanderzobnin-zabbix-app

You should see this on sucess:

✔ Installed alexanderzobnin-zabbix-app successfully

Configure the plugin

To finish, we need to configure the plugin to use our Zabbix server.

Go to this address to proceed, http://your_zabbix_server_ip_address:3000

Default credentials are: Admin/zabbix

Other Related Posts:

Kubernetes setup on ubuntu 16.04

Master: Install dependencies

apt update && apt upgrade -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

cat < /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF

apt-get update
apt install linux-image-extra-virtual c...

Read more

6th Mar 2019

MediaWiki with Lighttpd on Ubuntu

Introduction

In this guide, we will be setting up the latest version of MediaWiki on an Ubuntu server. We will use the lighttpd web server to make the actual content available, php-fpm to handle dynamic processing, and mysql to store our wiki's data.

This guide walks you through installin...

Read more

26th Feb 2019