Bobcares

Zabbix install ubuntu 16.04 – How we install and fix errors

by | Dec 8, 2019

Are you looking for a monitoring tool to keep an eye on the server? Then installing Zabbix is a good option.

Here we have open-source software for networks and applications to track the server actions.

At Bobcares, we often get requests from our customers to install Zabbix as part of our Server Management Services.

Today, we’ll see how our Support Engineers install Zabbix on Ubuntu and fix its related errors.

 

How we install Zabbix on ubuntu 16.04

Let’s now go through the steps that our Support Engineers follow to install Zabbix on Ubuntu 16.04

1. Initially, we log into the Zabbix server as a root user.

2. Then, we make sure to update the system’s list of available packages with the following command.

apt-get update

3. Next, we install the PHP modules that Zabbix needs.

apt-get install php7.0-xml php7.0-bcmath php7.0-mbstring

4. Here, we use the official Zabbix repository to install the latest stable version.

wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
dpkg -i zabbix-release_3.2-1+xenial_all.deb

5. We update the package index so the new repository is included.

apt-get update

6. Also, we install the Zabbix server and web frontend with MySQL database support.

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

7. Again, we install the Zabbix agent.

apt-get install zabbix-agent

8. We create a MySQL database for Zabbix and assign the permissions.

mysql -u root -p
mysql > create database zabbix character set utf8 collate utf8_bin;
mysql > create user 'zabbix'@'localhost' identified by 'password';
mysql > grant all privileges on zabbix.* to zabbix@localhost identified by 'your_password'
mysql > flush privileges;
mysql > quit;

Also, we load the Zabbix database schema to the database created.

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

9. After that, we configure the Zabbix server to use the database as follows.

nano /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=<your_zabbix_mysql_password>

10. Next, we configure PHP For Zabbix by editing /etc/zabbix/apache.conf.

11. Now, we start and enable the Zabbix server using the below commands.

systemctl start zabbix-server

systemctl enable zabbix-server

12. For further configuration, we can access the web interface via http://your_zabbix_server_ip_address/zabbix/.

Zabbix_install_ubuntu_16.04

Also, we need to configure the agent software that will send monitoring data to the Zabbix server.

13. So, we login to the second server, which needs to be monitored.

14. Again, we run the following commands to install the repository configuration package:

wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
dpkg -i zabbix-release_3.2-1+xenial_all.deb

15. Then, we update the package index.

apt-get update

16. Next, we install the Zabbix agent.

apt-get install zabbix-agent

17. After that, we open /etc/zabbix/zabbix_agentd.conf and edit the IP address of the Zabbix server.

Server= <Zabbix_server ip>

Hostname= <New server name>

18. After adding Zabbix server IP in the configuration file, now we start agent service using the below command.

systemctl start zabbix-agent

systemctl enable zabbix-agent

Finally, the agent is now ready to send data to the Zabbix server.

That’s it.

 

Zabbix install ubuntu 16.04 – Related errors and fixes

At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face problems while installing Zabbix

Now, let’s see the major reasons for this Zabbix installation-related errors and how our Support Engineers fix the top errors.

 

Missing database

Recently, one of our customers had a problem while installing the Zabbix on the Ubuntu server. When he tried to start the Zabbix server service, he received the following error.

Nov 29 19:13:28 Zabbix systemd[1]: zabbix-server.szabbixervice: Control process exited, code=exited status=1
Nov 29 19:13:28 Zabbix systemd[1]: Failed to start Zabbix Server.
Nov 29 19:13:28 Zabbix systemd[1]: zabbix-server.service: Unit entered failed state.
Nov 29 19:13:28 Zabbix systemd[1]: zabbix-server.service: Failed with result 'exit-code'.

 

On checking /var/log/zabbix/zabbix_server.log, our Support Engineers found the following entry.

13714:20191129:165512.416 [Z3005] query failed: [1146] Table 'zabbixdb.users' doesn't exist [select userid from users limit 1]
13714:20191129:165512.416 cannot use database "zabbixdb": database is not a Zabbix database.

Here, the customer forgot to create the Zabbix database. That’s why this error occurred on the server.

Therefore, we created a database with UTF-8 character support.

mysql > create database zabbix character set utf8 collate utf8_bin;

After that, we had to import initial schema and data for the server with MySQL:

zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql zabbixdb -u zabbixuser -p zabbixpassword

Also, we granted all needed privileges to the Zabbix user on that DB.

Also, increasing the CacheSize configuration parameter in the /etc/zabbix/zabbix_server.conf solve the error.

CacheSize=32M

This is how we fixed the error.

 

Incorrect user name and password

Sometimes, customers may face problems while logging into the Zabbix frontend at http://zabbix-frontend-hostname/zabbix in the browser. Often, it occurs when customers use the incorrect login password for accessing the Zabbix. They may use the login password in the config file for Zabbix server-internal purposes (to connect to MySQL DB).

To access the web frontend, customers should use login passwords which are then stored in this ZabbixDB users table.

 

Firewall restriction

Most of the customers may use a firewall to restrict unauthenticated access to the server. So, if there is any firewall like UFW, it is necessary to configure it to allow connections to port 10050.

ufw allow 10050/tcp

 

[Having trouble with Zabbix installation? We’ll help you.] 

 

Conclusion

In short, Zabbix is an open-source software for networks and applications for monitoring purposes. Today, we saw how our Supported Engineers install Zabbix on ubuntu 16.04 and fix related errors.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

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

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF