Zabbix server setup - requirements

Revision as of 17:08, 11 June 2014 by WikiFreak (talk | contribs)


System installation

Requirements

You should already have:


O.S installation

On dedicated hardware you need to install Ubuntu Server 14.04 LTS using an USB key.



System configuration

Update sources.list and install key packages

Edit your sources.list

apt-get install vim
vim /etc/apt/sources.list


Put the following:

### Custom repositories list
#
# May 2014 - Guillaume Diaz
# This is an ajdustement of the default "debootstrap" sources.list
# This is required to provided update, security and advanced tools to all our clients
#

#########################
# Ubuntu 14.04 LTS [Trusty]
#########################
# Official repositories
deb http://se.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://se.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse

# Official updates 
deb http://se.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

# Canonical partners
#deb http://archive.canonical.com/ubuntu trusty partner

# Community partners
#deb http://extras.ubuntu.com/ubuntu trusty main


Update your package list:

apt-get update && apt-get upgrade


Linux utilities

Now, you can install the basic programs:

# NFS is a bit low, and if you're using many client it might result in time faults. 
# You must install NTP to overcome this !!
apt-get install ntp ntpdate

# Basic set of utilities
apt-get install unzip zip htop python3 sysv-rc-conf mc

# Network tools
apt-get install curl

# Advanced APT manager (require to add repository from command line)
apt-get install software-properties-common python-software-properties

# SSH server
apt-get install openssh-server openssh-client


Adjust bash and vim configuration

Edit your VIM configuration:

vim /etc/vim/vimrc

Enable dark background + set nu + set ruler


Edit your bash configuration files to adjust the alias and enable auto-completion:

vim /etc/bash.bashrc
vim /home/<username>/.bashrc
vim /root/.bashrc


Firewall script

See Firewall to get more details.



Setup network interfaces

Even though you're using the NetBoot process you still have to register some interfaces! More important, the NetBoot disable the loopback "lo" - so you should better add that one back!

# Adjust "xxxx" by your distribution name
vim /etc/network/interfaces


Add:

auto lo
iface lo inet loopback

# Ethernet default interface
auto eth0
iface eth0 inet dhcp

# Intel NUC ethernet interface is named em1
auto em1
iface em1 inet dhcp



Zabbix server # installation

Source: https://www.zabbix.com/documentation/2.2/manual/installation/install_from_packages


Add Zabbix repository

wget http://repo.zabbix.com/zabbix/2.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_2.2-1+trusty_all.deb
dpkg -i zabbix-release_2.2-1+trusty_all.deb
apt-get update


Install Zabbix server

apt-get install zabbix-server-mysql zabbix-frontend-php


During installation you have to set:

  • MySQL administrator password
  • Allow the automatic DB configuration: reply 'yes to "Configure DB for zabbix-server-mysql with dbconfig-common?"
  • Enter your administrator password
  • Set the MySQL zabbix password. As this will only be used inside a LAN (in my case) I put zabbix as password


The Zabbix server application will now use the MySQL login: zabbix and the password I set earlier (zabbix).


Allow remote connections to MySQL

See MySQL server


Set timezone and PHP settings

Edit the configuration file

vim /etc/apache2/conf.d/zabbix


Find the following lines and edit them as follows. If the lines doesn’t exists, add them.

[...]
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 date.timezone Asia/Kolkata
[...]

Adjust your timezone !! To get the right value see: http://www.php.net//manual/en/timezones.php

Save and close the file.


Set Apache2 V.Host

Last step: you have to copy this configuration to your local Apache2 server [zabbix has installed one for you].

cp /etc/apache2/apache.conf /etc/apache2/conf-available/zabbix.conf
a2enconf zabbix.conf
service apache2 reload


Restart zabbix server

To restart zabbix you have to restart 2 processes:

  • BACKEND: Zabbix-server
  • FRONTEND: Apache2


service apache2 restart
service zabbix-server restart


Zabbix server # Web installer

Now you can, at least, run the web-installer.


Go to http://yourserver/zabbix


Installation

Welcome screen:

Zabbix server installation 01


Installation check:

Zabbix server installation 02


Database configuration:

Zabbix server installation 03

During the installation Zabbix already setup a database for us! :)

  • Db host: localhost
  • Db Port: 3306 (default)
  • Db name: zabbix
  • Db user: zabbix
  • Db password: your password (mine is zabbix)


Zabbix server details

Zabbix server installation 04

You can, if you want, name your installation. In my case I will not have any proxy or other zabbix server so I didn't used that option.


Confirmation


First login

Zabbix server installation 06

Default credentials are:

  • Username = Admin
  • Password = zabbix

Notice the big 'A' for Admin.



Zabbix agents

Now you should configure your zabbix agents to use the current server. See Zabbix agent setup




Zabbix server configuration

Login to your zabbix server: http://myServer/zabbix


Add host

You have to had a host (= machine with a zabbix agent) on the server side in order to monitor it.


1. Go to the Configuration > "Add host" menu

Zabbix add host - step 01
  • Click on Configuration Menu
  • Click on Hosts submenu
  • Click on Create Host button at right side


2. Now fill the following details of remote host

Zabbix add host - step 02
  • Hostname: Hostname of Remote system
  • Visible name: Name to be display in zabbix
  • Group: Select the desired group for you host
  • Agent interface: Fill the info of Zabbix agent running on host
  • Status: Select initial status


IMPORTANT !! The name of the hostname must match the real hostname - as return by the `hostname` command !!


3. Set some monitoring templates to apply

Click on the "Templates" tab

Zabbix add host - step 03

To get the list of templates, just type template in the search area. Select, at least:

  • Template OS Linux
  • Template Zabbix agent

Don't forget to click the "ADD" button!



Configuration > Discovery


  • Set the correct LAN settings
  • Enable zabbix agent search
  • Enable discovery



Click on add link

Select desired Template : Please select carefully, Because it will enabled all checks for the host


Click on save button add-zabbix-host-3

add-zabbix-host-4

Congratulation! You have added first host for zabbix monitoring. Repeat the same task for other hosts too.

How to View Graph in Zabbix

Graphs are always attracted the new users, Below screenshot will help you to how to view graphs in zabbix. If you have just added the host, you need to wait for few time, so that zabbix can collect some data from remote host to show on graph.

graph-network

Thank You for using this article, if this tutorial helps please do forgot to share it with your friends




Zabbix server configuration files

Main zabbix server configuration file is available in: "/etc/zabbix/zabbix_server.conf"



References

Zabbix official documentation (very good): https://www.zabbix.com/documentation/


Digitial Ocean community - Zabbix tutorial: https://www.digitalocean.com/community/tutorials/389


Tecadmin tutorial: