当前位置:网站首页>ZABBIX agent2 installation
ZABBIX agent2 installation
2022-07-05 12:19:00 【Xiaobo】
Zabbix Agent2 Introduce
Zabbix 5.0 Version introduces the use go Language rewrites Agent2, It's also 5.0 Version new features ,Agent2 Has the following characteristics :
The completed plug-in framework supports , Scalable services and application monitoring
Support flexible collection cycle scheduling
More efficient data acquisition and transmission
Can completely replace the existing agent
…..
There are many features , It is recommended to use . Due to the use go Language writing , Compilation and installation are different from previous versions .Agent2 Default 10050 port , And Zabbix Agent Same port , Without modifying the port , The same machine cannot be started at the same time Zabbix Agent And Zabbix Agent2.
install
You can use yum Or compile and install , For novice , It is recommended to use yum install .
yum install
Good configuration yum Source , Use the following command to install Zabbix Agent2
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all
yum install zabbix-agent2 -y
The default profile is
/etc/zabbix/zabbix_agent2.conf
The default binary file is
/usr/sbin/zabbix_agent2
Start with the following command Agent2 And configure boot up
systemctl enable --now zabbix-agent2
Compilation and installation
install gcc And other basic compilation environments , Due to the use go To write , So you need to configure go Compile environment , Download and configure go Language compiling environment
cd /opt
wget https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
tar zxvf go1.14.3.linux-amd64.tar.gz -C /usr/local/
echo "export PATH=$PATH:/opt/go/bin" >>/etc/profile
source /etc/profile
go env
The final display is as follows , indicate go Locale configuration succeeded .
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build821720893=/tmp/go-build -gno-record-gcc-switches"
Turn on go mod, Because the compilation process requires online downloading of dependent packages , To configure go mod agent
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
download zabbix 5.0 Source code
cd /opt
wget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.0.tar.gz
tar zxvf zabbix-5.0.0.tar.gz
cd zabbix-5.0.0
If you just want to compile agent2, Direct addition -enable-agent2 Parameters can be
./configure --prefix=/usr/local/zabbix -enable-agent2
make
make install
You must pay attention to errors in the compilation process , You need to download dependent packages online , Wait patiently for the installation to complete .
Default profile
/usr/local/zabbix/etc/zabbix_agent2.conf
Binary program
/usr/local/zabbix/sbin/zabbix_agent2
To configure systemd Startup file
vi /lib/systemd/system/zabbix-agent2.service
The contents are as follows
[Unit]
Description=Zabbix Agent 2
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_agent2.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-agent2
Type=simple
Restart=on-failure
PIDFile=/tmp/zabbix_agent2.pid
KillMode=control-group
ExecStart=/usr/local/zabbix/sbin/zabbix_agent2 -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
User=zabbix
Group=zabbix
[Install]
WantedBy=multi-user.target
Configure startup and set startup
systemctl enable --now zabbix-agent2
Agent2 No component dependency , You can directly copy the compiled binary files and configuration files and run them on other hosts .
边栏推荐
- Matlab label2idx function (convert the label matrix into a cell array with linear index)
- Four operations and derivative operations of MATLAB polynomials
- 调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击
- Principle of persistence mechanism of redis
- How to design an interface?
- 【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
- Linux安装部署LAMP(Apache+MySQL+PHP)
- Select drop-down box realizes three-level linkage of provinces and cities in China
- 强化学习-学习笔记3 | 策略学习
- ABAP table lookup program
猜你喜欢
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
Error modulenotfounderror: no module named 'cv2 aruco‘
The evolution of mobile cross platform technology
What is digital existence? Digital transformation starts with digital existence
abap查表程序
mysql拆分字符串做条件查询
Reading notes of growth hacker
How to clear floating?
About cache exceptions: solutions for cache avalanche, breakdown, and penetration
ABAP table lookup program
随机推荐
Seven polymorphisms
Conversion du format de données GPS [facile à comprendre]
codeforces每日5题(均1700)-第五天
GPS data format conversion [easy to understand]
Take you two minutes to quickly master the route and navigation of flutter
Redis master-slave mode
Wireless WiFi learning 8-channel transmitting remote control module
7月华清学习-1
Video networkstate property
Use and install RkNN toolkit Lite2 on itop-3568 development board NPU
July Huaqing learning-1
POJ-2499 Binary Tree
[hdu 2096] Xiaoming a+b
How does MySQL execute an SQL statement?
MySQL transaction
Acid transaction theory
Matlab boundarymask function (find the boundary of the divided area)
How to clear floating?
16 channel water lamp experiment based on Proteus (assembly language)
Differences between IPv6 and IPv4 three departments including the office of network information technology promote IPv6 scale deployment