当前位置:网站首页>ZABBIX proxy, sender (without agent monitoring), performance optimization
ZABBIX proxy, sender (without agent monitoring), performance optimization
2022-06-13 05:11:00 【I love Qianxi】
zabbix And proxy
One 、proxy Export and configuration of
1、zabbix-proxy The introduction of
zabbix The computer room is in Beijing , But there are also machines in Shanghai and other areas , How to communicate between Beijing and Shanghai ? Shanghai's zabbix-server Change the address to... In Beijing zabbix-server Address , But by default, Shanghai's zabbix-agent The machine will not be equipped with a public network IP, Intranet only IP, Shanghai agent To Beijing server There is no problem , But Beijing server To Shanghai agent It will be blocked by the router when sending
terms of settlement : Configure the public network for the Shanghai machine IP, But if you configure the public network for all the machines IP, Then the security problem is very serious , This method is not feasible
This time can lead to proxy,proxy All of the mobile phones agent data , Cache it for a while before handing it over to zabbix-server.
proxy It is suitable for the configuration of multiple machine rooms , The graph is as follows :
2、 to proxy Two network cards should be configured during configuration , An Internet connection , An intranet connection
(1). install zabbix-proxy
yum install zabbix-proxy-mysql -y
(2). To configure zabbix-proxy
a. Install and start mariadb
b. Chuangku Authorization , And import data
create database zabbix_proxy;
grant all on zabbix_proxy.* to [email protected]'proxy host IP' identified by '123456';
zcat /usr/share/doc/zabbix-proxy-mysql-4.0.11/schema.sql \.gz|mysql -uzabbix -p123456 -h 10.0.0.61 zabbix_proxy Import data
c. modify zabbix-proxy The configuration file
vim /etc/zabbix/zabbix_proxy.conf
Server=10.0.0.61 (zabbix-server The address of )
Hostname=sh-proxy( Look at the area , This is Shanghai )
DBHost=10.0.0.61
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=123456
(3) start-up zabbix-proxy
systemctl start zabbix-proxy
3、 The configuration of the virtual machine has been completed , Now in zabbix-web Configure the above settings on the interface proxy name 
4、 take agent Modify the configuration file of
vim /etc/zabbix/zabbix_agent.conf
Server=172.16.1.100
Server Active=172.16.1.100(proxy Of IP)
Hostname=172.16.1.7( This is a agent Intranet address )
systemctl restart agent
5、 Refresh the page to see sh-proxy And corresponding agentIP Address 
6、 You can see available The word log represents proxy Configuration is successful
vim /var/log/zabbix/zabbix_proxy.log
Two 、zabbix-sender( nothing agent monitor )
Some banking systems do not allow you to install software on the server, but you still have to do zabbix monitor , At this point, you can lead to zabbix-sender
First installation sender
rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-sender-3.0.25-1.e17.x86_64.rpm
And then in zabbix-web Inside 10.0.0.7 Configure and add monitoring items in the host , The following collector is sender, Here we check the memory capacity 
Then send data on the command line ,-z Specify the server IP,-s Appoint sender Their own IP,-k It is the name of the above figure ,-o Represents the data sent 
stay zabbix-web Refresh in the interface , You can see the newly added in the latest data 430 This value 
Of course, the value sent should not be fake , So I have to write a script to get the value , And write in the sent command
vim /server/scripts/avaimem.sh
#!/bin/bash
MEM=`free -m|awk '/^Mem/{print $NF}'`
zabbix_sender -z 10.0.0.61 -s 10.0.0.7 -k avaiMEM -o $MEM
But I just said that the banking system is not allowed to install software , So this one sender It's still a software ? Here we can use nc Instead of , Almost all servers support nc, First installation nc, The two scripts are as follows
yum install nc -y &> /dev/null
vim /server/scripts/zabbix_sender.sh
#!/bin/bash
host=$1
item=$2
value=$3
echo '{"request" :"sender data","data":[{"host":'\"$host\"',"key":\"$item\"',"value":'\"$value"\"'}]}'|nc 10.0.0.61 10051 && echo ""
10.0.0.61 yes zabbix-server The address of
vim /server/scripts/avaimem.sh
#!/bin/bash
MEM=`free -m|awk '/^Mem/{print $NF}'`
/bin/bash /server/scripts/zabbix_sender.sh 10.0.0.7 avaiMEM -o $MEM
sh avaimem.sh
You can see that the execution was successful 
stay web Interface view , The current memory available value is 712MB
nothing agent Monitoring succeeded ,sender Than agent Efficient , However, if the data to be monitored has multiple values, it is very complicated , Want to take top You don't know how to get the dynamic value , Not as good as agent Simple
3、 ... and 、zabbix performance optimization ( monitor )
(1) in the light of mysql, Write less and read less. , hand dba
(2) Remove useless monitoring items , Increase the value interval of monitoring items , Reduce the storage cycle of historical data , Historical data saved in 5 Zhang biaoli
(3) Change passive mode to active mode , increase zabbix-proxy
(4) in the light of zabbix-server Process tuning , Who's busy , Just increase the number of processes
(5) in the light of zabbix-server Cache tuning , Who has less memory left , Just increase its cache value
(6) in the light of zabbix A table of historical data and trend charts , Periodic sub table
边栏推荐
- [multi thread programming] the future interface obtains thread execution result data
- Luogu p3654 fisrt step
- C language learning log 10.4
- Case -- the HashSet set stores the student object and traverses
- Introduction to QT XML
- 详解OpenCV的函数cv::add(),并附各种情况的示例代码和运行结果
- 17.6 unique_ Lock details
- Must know must know -c language keywords
- 语音信号分帧的理解
- Section 8 - Practical commissioning techniques
猜你喜欢

OpenCV中的saturate操作(饱和操作)究竟是怎么回事

QT direction key to move focus

Bm1z002fj-evk-001 startup evaluation

C language learning log 11.7

Section 5 - Operator details

安装harbor(在线|离线)

Explain the opencv function cv:: add() in detail, and attach sample code and running results of various cases

Chapter 2 process management

PostgreSQL Guide: Insider exploration (Chapter 7 heap tuples and index only scanning) - Notes

Shell built-in string substitution
随机推荐
C language learning log 11.7
The games that you've tasted
OpenCV中的saturate操作(饱和操作)究竟是怎么回事
Logical point
Pycharm错误解决:Process finished with exit code -1073741819 (0xC0000005)
Section 4 - arrays
Sub paragraph of Chapter 16
Case - count the number of occurrences of each string in the string
【多线程】线程池核心类-ThreadPoolExecutor
C language learning log 12.25
System file interface open
C language learning log 1.17
Time display of the 12th Blue Bridge Cup
Luogu p3654 fisrt step
Case - the list set stores student objects and traverses them in three ways
C language learning log 1.19
Article 29: assuming that the mobile operation does not exist, is expensive, and is not used
C language learning log 1.22
Clause 33: decltype is used for auto & type formal parameters, with std:: forward
Must know must know -c language keywords