Setting up Zabbix Part 1 – Setting up the Server. —

Whats Zabbix? It’s an open source monitoring platform. I’m going to walk through installing the 3.0 LTS version, and then adding some objects into monitoring. 

I’m going to be installing it on CentOS 7 64bit, in a lab which has a Open source Zimbra Mail Server and some Cisco Switches I wish to monitor via SNMP. 

I generally disable the software firewall and selinux on Centos. I’m not saying those aren’t important, but I’m behind a firewall in a lab. 


Step 1 – Install Centos 7 on a VM, disable SE Linux, disable firewalld, and install openssh server. (I may include Links here to help you if you are unfamiliar with how to do those things.)

Step 2 – Install MySQL (You can also use PostgreSQL if you wish)
To accomplish this you need irst need to install MySQL by downloading it’s repository by logging in as root or sudo and typing:

root@localhost:$ rpm -ivh

Then update your repos with:

root@localhost:$ yum update

And finally installing MySQL with:

root@localhost:$ yum install mysql-server

We also need to start MySql

root@localhost:$ systemctl start mysqld

Step 3 – Install Zabbix.
We need to install the repo for Zabbix As root or sudo type:

root@localhost:$ rpm -ivh

We need to again perform a:

root@localhost:$ yum update

and now we can install the packages for zabbix

root@localhost:$ yum install zabbix-server-mysql zabbix-web-mysql

Step 4 – Harden MySQL
By defualt MySQL is installed with no password in this method. This deletes some uneeded databases, users and will allow you to set an initial mysql root password.

root@localhost:$ mysql_secure_installation

If you are unfamiliar with mysql, it’s a great way to learn SQL in general, but not as robust as many of the platforms you can use. Also if you have ever heard of mariadb, they are the same, but built by different teams. If you want to use that instead here you should be able to.

Step 5 – Install the initial DB for Zabbix.
login to mysql with it’s root password with:

root@localhost:$ mysql -u root -p

you will be prompted for the MySQL root password.
You will now be at a mysql> shell prompt, using this you will use the following to create a database, and a user for that database.

root@localhost:$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 464
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

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

This creates a user called zabbix, with a password zabbix (you maybe could change the identified by ” to another value. πŸ˜€ )
Use this command to import the zabbix schema into your new database, you will be prompted for whatever you set the zabbix user’s password to.

root@localhost:$ zcat /usr/share/doc/zabbix-server-mysql-3.0.*/create.sql.gz | mysql -uzabbix -p

Step 6 – Edit the config file for Zabbix.

root@localhost:$ vi /etc/zabbix/zabbix_server.conf

These values need to be set:

Step 7 – Set your Timezone in the PHP config for Zabbix
edit this file.

root@localhost:$ vi /etc/httpd/conf.d/zabbix.conf

and place your time zone from here
to the line
php_value date.timezone America/New_York
I had to also uncomment this line.

Step 8 – Start the Server!

root@localhost:$ systemctl start httpd
root@localhost:$ /sbin/zabbix_server

Step 9 Open a browser and point it to your URL.
This listens on port 80, not https.

Step 10 Walk thru the install, you will be asked to put in the zabbix DB password you set earlier.

[ngg_images source=”galleries” container_ids=”14″ display_type=”photocrati-nextgen_basic_slideshow” gallery_width=”640″ gallery_height=”480″ cycle_effect=”fade” cycle_interval=”10″ show_thumbnail_link=”1″ thumbnail_link_text=”[Show picture list]” order_by=”sortorder” order_direction=”ASC” returns=”included” maximum_entity_count=”500″]Step 11 Login. 

The default user name is Admin (the A is upper case.) and the password is zabbix 

Step 12 Change the password!

In the upper right hand corner you will see a user icon. 
You can use this to set your user preferences and password.

In Part 2 I’ll set up some server monitoring πŸ˜€ 

[amazon_link asins=’1782161287,1785289268,B00YSILK18,178439758X,1784399760′ template=’ProductAd’ store=’geekliketod04-20′ marketplace=’US’ link_id=’3fa240a2-ce8c-11e6-800a-67041a2b48e9′]


Categorised as: Geeking Out | Linux | SysAdmin

Leave a Reply

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