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

Detailed steps for zabbix installation

2025-03-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is to share with you the detailed steps of zabbixd installation, I believe most people do not know how to install, in order to let you learn, to give you a summary of the following, without saying much, let's read on.

Download address

Https://www.zabbix.com/download?zabbix=4.4&os_distribution=centos&os_version=7&db=mysql&ws=nginx

two。 Yum that cannot be installed

Take-y with you when you install it, or I'll get a glass of water and come back, the server will be disconnected.

Yum install zabbix-server-mysql zabbix-agent-y

Zabbix-server-mysql-4.4.6-1.el7.x86_64: [Errno 256] No more mirrors to try.

Zabbix-agent-4.4.6-1.el7.x86_64: [Errno 256] No more mirrors to try.

Good official software steps, installation of this problem, but also our magical network, unable to connect.

The first step is whether or not to go, found that the installation can not go down. Error

Attempt to modify, step to change the official source, invalid

Cat / etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

Cd / etc/yum.repos.d

Wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

Yum clean all

Yum makecache

Invalid

It is said on the Internet that the replacement of DNS can be solved, and the DNS will be changed to 4.4.4.4 because my server is Ali Yun and dare not move after watching it for a long time. I am afraid to restart the network and it will be troublesome if I can't connect it.

Source code installation

From my previous understanding of other software, linux actually has a way to install source code, as long as it can yum

3.1 choose zabbix Sources version 4.4.6 on March 7, 2020

Https://www.zabbix.com/documentation/3.4/zh/manual/installation/install

Rollover failed

Re-upload

cancel

Tar-zxvf zabbix-4.4.6.tar.gz

3.2Creating user and group zabbix

Tip: running Zabbix with root,bin or other special privileges is a security risk, according to official documentation

Groupadd zabbix

Useradd-g zabbix zabbix

3.3.Create Zabbix database

Create database zabbix character set utf8 collate utf8_bin

Grant all privileges on zabbix.* to zabbix@localhost identified by 'Zabbi 111'

If mysql shows up,

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

It means that the password is not strong enough, including uppercase letters, numbers and special characters.

3.4. Compile

The official document is a little verbose, just say this directly.

/ configure-- enable-server-- enable-agent-- with-mysql-- enable-ipv6-- with-net-snmp-- with-libcurl-- with-libxml2

The problem of trampling on 1:mysql library

Configure: error: MySQL library not found

The key here is not to find Mysql, but to see mysql_config.

I asked about mysql.

Which mysql

Mysqladmin-u root-p variables

If you find a place like a log, you can determine where mysql is installed.

| | slow_query_log_file | / var/lib/mysql/rh74-slow.log |

| | socket | / var/lib/mysql/mysql.sock |

Mysql

Result

Yum install mysql-devel

Whereis mysql_config

Just fine

Step on the pit 2.libxml2

/ configure-- enable-server-- enable-agent-- with-mysql-- enable-ipv6-- with-net-snmp-- with-libcurl-- with-libxml2

Error

Configure: error: Not found libxml2 library

Download this page

Http://www.xmlsoft.org/downloads.html

Wget ftp://xmlsoft.org/libxml2/libxml2-git-snapshot.tar.gz

/ configure

Make

Make install

Step on 3.Curl (note that it is not curl)

/ configure-- enable-server-- enable-agent-- with-mysql-- enable-ipv6-- with-net-snmp-- with-libcurl-- with-libxml2

Configure: error: Curl library not found

Yum install curl

Yum install curl-devel

Step on pit 4. Libxml cannot be executed

. / configure runs successfully, when it comes to make

Make & & make install

Expression.c:31:28: fatal error: libxml/parser.h: No such file or directory

Find /-name parser.h

/ usr/local/include/libxml2/libxml/parser.h

Found that it was installed under / usr/local/include/.

In general, look for / usr/lib in the following library.

So build a soft connection libxml under / usr/include

Ln-s / usr/local/include/libxml2/libxml / usr/include/libxmlmake & & make install

Server installed successfully

3.5 start the server and client

Run zabbix_server on the Zabbix server side:

Zabbix_server

Edit Zabbix server's configuration file / usr/local/etc/zabbix_server.conf here

Zabbix_agentd

Edit Zabbix agent's configuration file / usr/local/etc/zabbix_agentd.conf here

If you have Zabbix proxy installed, run zabbix_proxy: (Yue Xiaosheng manually compiled files, there is no such thing)

Zabbix_proxy

3.6 configure php

Front-end file path

Cd / backup/soft/zabbix-4.4.6/frontends/php

Cp-a. / var/www/zabbix

Configure your own nginx without saying much about the path / var/www/zabbix here.

Open the Zabbix link in your browser: http:///zabbix

Https://java-er.com/zabbix/setup.php

Step on pit 1. It is invalid to modify php.ini for half a day, and finally modify the www.conf of php-fpm.

Rollover failed

Re-upload

cancel

There was an error during installation. The options for php are changed in php.ini and then restart php-fpm

Whereis php.ini

Whereis php-fpm.conf

Some properties are in the php-fpm configuration, and this file has a higher priority than php.ini.

Php-I | grep php.ini

Php-fpm-I | grep php.ini

Repeated modification / etc/php.ini restart php-fpm is invalid

Modify

/ etc/php-fpm.d/www.conf takes effect immediately

Php_ value [post _ max_size] = 16m

Php_ value [max _ execution_time] = 300

Php_ value [date.timezone] = Asia/Shanghai

Php_ value [always _ populate_raw_post_data] =-1

Php_ value [always _ populate_raw_post_data] =-1 # change off to on in the prompt, I wrote on is useless, check it, write-1 is valid

Bcmath at first I thought it was a variable, but after checking it, I knew it was a plug-in.

Install bcmath

Yum install php-bcmath

Yum provides php-bcmath

Php56w-bcmath-5.6.40-1.w7.x86_64 found my version

Yum install php56w-bcmath-5.6.40-1.w7.x86_64

Restart php-fpm and all OK will be displayed.

Step on pit 2. It is said that the front-end database does not match

The next step comes out (Yue Xiaosheng sometimes feels that all the problems he can encounter have been bumped into by me)

The frontend does not match Zabbix database

I finally went to download the source code package and found the mysql file.

Ls / backup/soft/zabbix-4.4.6/database/mysql

Data.sql images.sql Makefile Makefile.am Makefile.in schema.sql

There are three of them

/ backup/soft/zabbix-4.4.6/database/mysql/schema.sql

/ backup/soft/zabbix-4.4.6/database/mysql/data.sql

/ backup/soft/zabbix-4.4.6/database/mysql/images.sql

The most primitive way to import the database

Mysql-u zabbix-p

Source / backup/soft/zabbix-4.4.6/database/mysql/schema.sql

One after another, the files were refreshed and passed directly.

Rollover failed

Re-upload

cancel

Default account Admin

The default password is zabbix

Step on pit 3. Said that the time zone was not set correctly.

DateTime::construct (): Invalid date.timezone value 'Asia/Shaihang', we selected the timezone' UTC' for now.

DateTime::construct (): Invalid date.timezone value 'Asia/Shaihang', we selected the timezone' UTC' for now.

Vi / etc/php-fpm.d/www.conf

Change to UTC

Php_ value [date.timezone] = UTC

After reading the above, have you mastered the method of installing zabbixd? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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

Servers

Wechat

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

12
Report