Debian 9.2 install Zabbix 3.4.2

Source: Internet
Author: User
Tags fully qualified domain name

Debian 9.2 install Zabbix 3.4.2

Recently, I want to install Zabbix monitoring software In Debian 9.2. I have no choice but to find that many documents have not been installed successfully. Many of them are due to installation environment problems and cannot solve the dependency between installation packages. Although there are official instructions, it is still difficult to install them. Fortunately, I found a document about the installation method in CentOS, Which is modeled after the installation. Although the result is unavailable, the installation is successful, the installation is successful after several installation attempts. Here is just a description of how to install it. Later I will write some usage tips. The installation steps are as follows:

1. visit the following website to download the source code installation package. In addition, the installation source code package will be included in the attachment or download file, and the link will be put up later:

Http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.4.2/zabbix-3.4.2.tar.gz

2. Install the dependency Library

Apt update

Apt install libsnmp-dev libxml2-dev libcurl4-openssl-dev libevent-dev

3. Install the compiling environment

Apt install-y build-essential gcc g ++ libtool automake

4. Install mysql

Apt install mysql-server mysql-common mysql-client php-mysql php7.0-mysql php7.0 zabbix-server-mysql libmysql ++-dev libpcre3-dev php7.0-gd

5. Compile and install zabbix (My zabbix file is located in the root directory, and later installation is also based on the root directory)

Tar-zxf zabbix-3.4.2.tar.gz
Cd zabbix-3.4.2/
./Configure -- prefix =/usr/local/zabbix -- enable-server -- enable-agent -- with-mysql -- enable-ipv6 -- with-net-snmp -- with-libcurl -- with-libxml2
Make
Make install

6. Install zabbix-agent

Apt install zabbix-agent

7. Create zabbix users and user groups

Groupadd zabbix

Useradd-r-g zabbix

Cd/usr/local & chown-R zabbix: zabbix

**************************************** ****

* # If the following prompt appears, it indicates that it already exists. #*

* Groupadd: group 'zabbix' already exists *

* Useradd: user 'zabbix' already exists *

**************************************** ****

8. Create a zabbix database and import the table structure.

Mysql-uroot-p
Create database if not exists zabbix default character set utf8 collate utf8_general_ci;
Use zabbix;
Source/zabbix-3.4.2/database/mysql/schema. SQL;
Source/zabbix-3.4.2/database/mysql/images. SQL;
Source/zabbix-3.4.2/database/mysql/data. SQL;

The structure of the imported table must be imported one by one. Do not paste the copy code in batches. 

9. Create a log directory

Cd/usr/local/zabbix
Mkdir logs
Chown zabbix: zabbix logs

This step is only used when you modify the log file. If you do not need to modify the log file, this step can be ignored.

10. Back up the original zabbix_server.conf and zabbix_agentd.conf files.

Cp/etc/zabbix/zabbix_agentd.conf/etc/zabbix/zabbix_agentd.conf.bak
Cp/etc/zabbix/zabbix_server.conf/etc/zabbix/zabbix_server.conf.bak

11. Modify zabbix_server.conf.

Nano/etc/zabbix/zabbix_server.conf
 
LogFile =/var/log/zabbix-server/zabbix_server.log
PidFile =/var/run/zabbix/zabbix_server.pid
DBHost = localhost
DBName = zabbix
DBUser = zabbix
DBPassword = zabbix
DBSocket =/tmp/mysql. sock
Include =/etc/zabbix/zabbix_server.conf.d/*. conf

Here, the location of the log file is the default location. It is generally recommended to place it under/var/log.

12. Modify zabbix_agentd.conf Configuration

Nano/etc/zabbix/zabbix_agentd.conf
 
PidFile =/var/run/zabbix/zabbix_agentd.pid
LogFile =/var/log/zabbix-agent/zabbix_agentd.log
Include =/etc/zabbix/zabbix_agentd.conf.d/*. conf

13. Create zabbix_server.log

Touch/var/log/zabbix-server/zabbix_server.log

The log location can be defined in zabbix_server.conf. In addition, another purpose of creating this file is:

Tail-f/var/log/zabbix-server/zabbix_server.log
Tail-f/var/log/zabbix-agent/zabbix_agentd.log

When starting the zabbix_server service and zabbix_agentd service, check whether the system reports an error.

14. Start the zabbix Service

/Usr/local/zabbix/sbin/zabbix_server
/Usr/local/zabbix/sbin/zabbix_agent

15. Configure zabbix web access.

Cp-r/zabbix-3.4.2/frontends/php/*/var/www/html/

16. Perform web access.

Enter http: // ip/index. php in the browser. As follows:

17. Configure the php. ini file. When you use an IP address for access and installation, an error may be reported because some installation options do not conform to the system settings. As follows:

If the preceding error is reported, modify the configuration file/etc/php/7.0/apache2/php. ini to the following:

1. date. timezone ==> remove comments and add Asia/Shanghai
2. max_input_time = 600
3. max_execution_time = 600
4. post_max_size = 32 M

For other errors, use apt install php. After installation, restart the apache2 process.

 

18. Modify the apache2.conf configuration file

For shoes that have not modified apache2, we believe they will encounter:

 

Cocould not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'servername' ctictive
Globally to suppress this message.

 

In this case, you only need to add ServerName localhost: 80 to the/etc/apache2/apache2.conf configuration file. After restarting, you will no longer see the same error.

19. Modify mysql permissions. If you cannot log on to a user by entering the correct user name and password, check whether the password set in/usr/share/zabbix-server-mysql/zabbix_server.conf is the same as that set earlier. After modification, go to the database and grant the corresponding permissions to localhost. The Error message is as follows:-Error connecting to database: Access denied for user 'zabbix' @ 'localhost '. The solution is as follows:

Mysql
Grant all privileges on zabbix. * to zabbix @ localhost identified by 'zabbix ';

20. Download zabbix. conf. php

In the last step, you may receive the following prompt, prompting you to click the URL to download and download the package, and then save it. The prompt is as follows:

Alternatively, you can install it manually:
1. Download the configuration file
2. Save it as "/var/www/html/conf/zabbix. conf. php"

Alternatively, you can download the package from the home Resource Station. After the download is complete, place it under/var/www/html/conf.

------------------------------------------ Split line ------------------------------------------

Free in http://linux.bkjia.com/

The username and password are both www.bkjia.com

Download the Zabbix 3.4.2/July 2018/July 12/July March/Debian 9.2/

For the download method, see

------------------------------------------ Split line ------------------------------------------

21. User Login

The default logon username is Admin and the password is zabbix.

22. The entire installation process is like this. The configuration of the next step will be described in future documents. Thank you.

In addition, I have attached a reference article. As follows: https://www.bkjia.com/linux/2017-12/149327.htmhope to help more people.

This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151338.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.