Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Debian9.2 install Zabbix3.4.2

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Recently, I want to install zabbix monitoring software to have a look, but I found a lot of information that did not install successfully, and many of them are installation environment problems, which can not solve the dependency between installation packages. Although there are official documentation, it is still very difficult to install. Fortunately, I found a document about the installation method under Centos, which was imitated. As a result, although it could not be used, the installation was successful. Finally, I installed it a few more times, and the installation was successful. This is just an explanation of how to install it, and some experience will be written later. Needless to say, here are the installation steps:

1. Please visit the following website to download the source code installation package. In addition, the installation source code package will be stored 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.gzhttps://pan.baidu.com/s/1c22LFaS password: cbg9

2 、

Install dependent libraries

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

3. Install the compilation environment

Apt install-y build-essential gcc gathers + 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 files are located in the root directory, and later installations are also installed in the root directory)

Tar-zxf zabbix-3.4.2.tar.gzcd zabbix-3.4.2/./configure-prefix=/usr/local/zabbix-enable-server-enable-agent-with-mysql-enable-ipv6-with-net-snmp-with-libcurl-with-libxml2makemake install

6. Install zabbix-agent

Apt install zabbix-agent

7. Create zabbix users and user groups

Groupadd zabbix

Useradd-r-g zabbix zabbix

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

*

* # if the following prompt appears, it already exists. # *

* groupadd: group 'zabbix' already exists *

* useradd: user 'zabbix' already exists *

*

8. Create zabbix database and import table structure

Mysql-uroot-pcreate 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

Import table structure needs to be imported one by one, do not paste and copy the code in batch.

9. Create a log directory

Cd / usr/local/zabbixmkdir logschown zabbix:zabbix logs

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

10. Backup the original zabbix_server.conf and zabbix_agentd.conf files.

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

11. Modify zabbix_server.conf configuration

Nano / etc/zabbix/zabbix_server.confLogFile=/var/log/zabbix-server/zabbix_server.logPidFile=/var/run/zabbix/zabbix_server.pidDBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=zabbixDBSocket=/tmp/mysql.sockInclude=/etc/zabbix/zabbix_server.conf.d/*.conf

The location of the log file here is the default location, which is generally recommended to be placed under / var/log/.

12. Modify zabbix_agentd.conf configuration

Nano / etc/zabbix/zabbix_agentd.confPidFile=/var/run/zabbix/zabbix_agentd.pidLogFile=/var/log/zabbix-agent/zabbix_agentd.logInclude=/etc/zabbix/zabbix_agentd.conf.d/*.conf

13. Create a zabbix_server.log log

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

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

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

When starting the zabbix_server service and the zabbix_agentd service, check to see if the system will report an error.

14. Start the zabbix service

/ usr/local/zabbix/sbin/zabbix_server/usr/local/zabbix/sbin/zabbix_agent

15. Configure web access for zabbix.

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

16. Conduct web visit.

Use the browser to enter: http://ip/index.php to access. As follows:

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

If you are prompted to report the above error, you need to modify the configuration file / etc/php/7.0/apache2/php.ini for the error that has been framed to read as follows:

1; date.timezone = = > remove comments and add Asia/Shanghai2, max_input_time = 6003, max_execution_time = 6004, post_max_size = 32m after =

For other errors, please use apt install php-* to install and solve. After installation, you need to restart the apache2 process.

18. Modify apache2.conf configuration file

For children's shoes that have not been modified by apache2, I believe they will be encountered in stop or start:

Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message.

At this point, you only need to add ServerName localhost:80 to the / etc/apache2/apache2.conf configuration file. Restart again and you won't see the same error again.

19. Modify mysql permissions. For users who are unable to log in by entering the correct username and password, check that the password set in / usr/share/zabbix-server-mysql/zabbix_server.conf is the same as the password previously set. After the modification, enter the database and give the corresponding permissions to the 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 of installation, you may encounter a prompt below, which prompts you to click on the URL to download and save it. The tips are as follows:

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

Or you can download it from Baidu network disk and place it under / var/www/html/conf/ after the download is finished.

Link: https://pan.baidu.com/s/1bpLK2jd password: hcwl

21. User login

The default login user name is Admin and the password is zabbix.

22. This is the whole installation process, and how to configure it next will be explained in a later document. Thank you

In addition, attach the referenced articles. As follows: https://www.cnblogs.com/rnckty/p/7650978.html hopes to help more people.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report