{"id":3787,"date":"2019-07-26T22:49:16","date_gmt":"2019-07-26T19:49:16","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3787"},"modified":"2024-03-12T07:31:46","modified_gmt":"2024-03-12T04:31:46","slug":"install-zabbix-server-on-debian-10-buster","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-zabbix-server-on-debian-10-buster\/","title":{"rendered":"Install Zabbix Server on Debian 10 Buster"},"content":{"rendered":"\n
In this guide, we are going to learn how to install Zabbix server on Debian 10 Buster. Zabbix<\/a> is an enterprise class monitoring solution for any kind of IT infrastructure, services, applications, cloud resources.<\/p>\n\n\n\n Zabbix can be built from the source code or can be installed from Zabbix repository. In this guide, we are going to use Zabbix repository.<\/p>\n\n\n\n Debian 10 Buster do not include Zabbix repository by default. Hence, you can install it by running the command below. Note that Zabbix 4.2<\/a> is the current stable release as of this writing. <\/p>\n\n\n\n Next, run system update.<\/p>\n\n\n\n Zabbix uses the LAMP stack components, Apache, MariaDB and PHP. To install these components, run the command below;<\/p>\n\n\n\n The above command installs Apache 2.43, Mariadb 10.3 and PHP 7.3<\/p>\n\n\n\n Also, if you need to monitor the Zabbix server itself, you need to install Zabbix agent.<\/p>\n\n\n\n Once the installation of the Zabbix components completes, begin by creating a MariaDB database for Zabbix and a Zabbix user.<\/p>\n\n\n\n However, run mysql_secure_installation<\/strong> MariaDB initial security script to remove anonymous users, test databases and to disable remote root login.<\/p>\n\n\n\n Note that by default, MariaDB 10.3 uses unix socket for authentication and hence, you can login without password set (Even if you set password with mysql_secure_installation<\/strong>). Therefore, you can login by just typing mysql<\/strong> or mysql -u root<\/strong>.<\/p>\n\n\n\n Create Zabbix database.<\/p>\n\n\n\n Create the Zabbix database user and grant all the privileges on Zabbix database.<\/p>\n\n\n\n Reload the privilege tables to ensure that all changes made take effect immediately and exit the database.<\/p>\n\n\n\n If you need enable root user password authentication, login to database and run the command below;<\/p>\n\n\n\n Next, import initial Zabbix database schema and data to the newly create database.<\/p>\n\n\n\n Next, open the Zabbix configuration file and set the value of DBName<\/strong>, DBUser<\/strong>, DBPassword<\/strong> to reflect your settings. Also, configure local database connection.<\/p>\n\n\n\n Zabbix frontend is written in PHP. On of the configuration that is required is to set the PHP timezone. Hence, edit the file, and set the timezone for PHP 7.<\/p>\n\n\n\n Restart Apache Web server.<\/p>\n\n\n\n The Zabbix frontend configuration will be finalized from the web UI.<\/p>\n\n\n\n Once you are done with the configuration, restart the Zabbix server and agent and enable them to run on system boot.<\/p>\n\n\n\n To complete Zabbix installation, navigate to the browser and access your Zabbix server via the address http:\/\/<server-IP>\/zabbix<\/strong>. When access the address above, the first page you land on is Zabbix welcome page.<\/p>\n\n\n Click Next Step to verify if all the Zabbix requirements have been met.<\/p>\n\n\n Configure Zabbix database connection using the connection details set above.<\/p>\n\n\n Setup the Zabbix server details. You can leave the default settings.<\/p>\n\n\n On the Pre-installation summary, verify if all the configurations are fine.<\/p>\n\n\n If all is well, click Next step to finish the installation. If all is well, you should see Zabbix installation congratulatory message.<\/p>\n\n\n You have successfully setup Zabbix Frontend. Click Finish<\/strong> to get to Zabbix login interface.<\/p>\n\n\n The default login credentials are admin<\/strong> as the username and zabbix<\/strong> as the password. When you successfully login to Zabbix, you should land on the default dashboard.<\/p>\n\n\n Well, there you go. You have successfully installed Zabbix server on Debian 10 Buster. In our next guide, we will how to monitor remote hosts using Zabbix server.<\/p>\n\n\n\n How to Install and Configure Zabbix 4.0 from Source on Fedora 29\/Fedora 28\/CentOS 7<\/a><\/p>\n\n\n\n Install Nagios Core on Debian 10 Buster<\/a><\/p>\n\n\n\n Install and Configure SNMP on Debian 10 Buster<\/a><\/p>\n\n\n\nInstalling Zabbix Server on Debian 10 Buster<\/h2>\n\n\n\n
Install Zabbix APT repository <\/h3>\n\n\n\n
wget https:\/\/repo.zabbix.com\/zabbix\/4.2\/debian\/pool\/main\/z\/zabbix-release\/zabbix-release_4.2-1+buster_all.deb\napt install .\/zabbix-release_4.2-1+buster_all.deb<\/code><\/pre>\n\n\n\n
apt update -y\napt upgrade -y<\/code><\/pre>\n\n\n\n
Install Zabbix Server, Frontend and Agent<\/h3>\n\n\n\n
apt install zabbix-server-mysql zabbix-frontend-php<\/code><\/pre>\n\n\n\n
apache2 -v\nServer version: Apache\/2.4.38 (Debian)\nServer built: 2019-04-07T18:15:40<\/code><\/pre>\n\n\n\n
php -v\nPHP 7.3.4-2 (cli) (built: Apr 13 2019 19:05:48) ( NTS )\nCopyright (c) 1997-2018 The PHP Group\nZend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies\n with Zend OPcache v7.3.4-2, Copyright (c) 1999-2018, by Zend Technologies<\/code><\/pre>\n\n\n\n
mariadb -V\nmariadb Ver 15.1 Distrib 10.3.15-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2<\/code><\/pre>\n\n\n\n
apt install zabbix-agent<\/code><\/pre>\n\n\n\n
Create Zabbix MariaDB Database and User<\/h3>\n\n\n\n
mysql -u root<\/code><\/pre>\n\n\n\n
create database zabbixdb;<\/code><\/pre>\n\n\n\n
grant all on zabbixdb.* to zabbixadmin@localhost identified by 'Str0NGPass';<\/code><\/pre>\n\n\n\n
flush privileges;\nquit<\/code><\/pre>\n\n\n\n
mysql -u root\nSET old_passwords=0;\nALTER USER root@localhost IDENTIFIED BY 'StronGP@SS';\nflush privileges;\nquit<\/code><\/pre>\n\n\n\n
zcat \/usr\/share\/doc\/zabbix-server-mysql\/create.sql.gz | mysql -u zabbixadmin -p zabbixdb<\/code><\/pre>\n\n\n\n
...\nDBHost=localhost\n...\nDBName=zabbixdb\n...\nDBUser=zabbixadmin\n...\nDBPassword=Str0NGPass<\/code><\/pre>\n\n\n\n
Configure PHP for Zabbix frontend<\/h3>\n\n\n\n
vim \/etc\/zabbix\/apache.conf<\/code><\/pre>\n\n\n\n
\n...\n <IfModule mod_php7.c>\n php_value max_execution_time 300\n php_value memory_limit 128M\n php_value post_max_size 16M\n php_value upload_max_filesize 2M\n php_value max_input_time 300\n php_value max_input_vars 10000\n php_value always_populate_raw_post_data -1\n # php_value date.timezone Europe\/Riga\n php_value date.timezone Africa\/Nairobi\n <\/IfModule>\n<\/code><\/pre>\n\n\n\n
systemctl restart apache2<\/code><\/pre>\n\n\n\n
Running Zabbix server and Agent<\/h3>\n\n\n\n
systemctl restart zabbix-server zabbix-agent\nsystemctl enable zabbix-server zabbix-agent<\/code><\/pre>\n\n\n\n
Configure Zabbix Web User Interface<\/h3>\n\n\n\n
<\/a><\/figure><\/div>\n\n\n
<\/a><\/figure><\/div>\n\n\n
<\/a><\/figure><\/div>\n\n\n
<\/a><\/figure><\/div>\n\n\n
<\/a><\/figure><\/div>\n\n\n
<\/figure><\/div>\n\n\n
<\/a><\/figure><\/div>\n\n\n
<\/a><\/figure><\/div>\n\n\n
Related Tutorials<\/h3>\n\n\n\n