In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "how to use Docker to install Zabbix and configure custom monitoring items", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use Docker to install Zabbix and configure custom monitoring items" article.
A brief introduction to Zabbix
Zabbix can be used to monitor various network parameters to ensure the safe operation of the server and system. And Zabbix also provides a flexible notification mechanism to allow system administrators to quickly locate / solve various problems. Is an enterprise-level open source solution based on the distributed system monitoring and network monitoring functions provided by the Web interface.
1. Monitoring function
Host performance monitoring, network equipment performance monitoring, database performance monitoring, a variety of alarm methods, detailed report charts.
To monitor the host, we can use the Agent software provided by Zabbix to monitor Linux, Windows, FreeBSD and other systems.
Monitor network devices, which we can monitor through the SNMP protocol supported by Zabbix (SSH protocol is not commonly used)
1) Monitoring object
Equipment: server, router, switch.
Software: OS, network, application.
2) Host performance indicator monitoring
Fault monitoring: downtime, service unavailable, host unreachable.
How 2.Zabbix works
First of all, we need to install Agent software on the monitored host to collect the data information of the current server and send it to the monitoring end. When the monitoring end receives the information sent by Agent, it will store the data in the database, and then display and draw the data on the front-end page through the Web interface.
Here, Agent collects data in two modes: active and passive:
Initiative: the client actively pushes the collected information to the monitoring side by connecting port 10051 of the monitoring side.
Passive: the monitoring side communicates through port 10050 of the client at a fixed time to collect all the data and information of the client.
The default mode of Zabbix is passive mode, that is, when we need to monitor a large number of hosts, it may affect the performance of the monitor side. Because the monitoring end will collect data regularly through the port connecting to the client, we can selectively configure some hosts for active mode to reduce the performance pressure on the monitoring side.
The 3.Zabbix component functions as Zabbix Server to receive the information sent by Agent. All configuration, data statistics and data operations are organized by it. Database Storage is used to store all configuration information and collected data information Web InterfaceZabbix GUI interface, can be used for interface display (usually and Server runs on a host) Agent is used to collect local data information, that is, the so-called monitored side Proxy optional components Commonly used in distributed monitoring architecture Server, which is equivalent to an agent, is used to collect part of the Agent data and forward it to the 4.Zabbix process on the monitor side.
Sender: used to send data to Server or Proxy, usually for time-consuming checks
The Get:Zabbix command, mainly used for troubleshooting, can be executed on the monitoring side to obtain the information of the monitored side.
Agent: client daemon, which is used to collect data information of the current host, such as CPU load, memory usage, etc.
Proxy: the agent daemon, which acts as a relay station, can actively / passively submit the collected data to the monitoring end.
Server: the daemon on the monitoring side, which is used to receive data provided by Agent Get Sender Proxy Java_Gateway.
Because Zabbix can not monitor Java applications directly, Java_Gateway proxy process is introduced after Zabbix 2.0, which enables us to monitor Java applications.
Use Zabbix to configure custom monitoring items
What we use below is docker-compose installation. For physical installation, please see the article I wrote earlier: portal.
1. Install Zabbix
1) install Docker
[root@Zabbix ~] # wget-O / etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo[root@Zabbix ~] # yum- y install epel-release [root@Zabbix ~] # yum- y install yum-utils device-mapper-persistent-data lvm2 [root@Zabbix ~] # yum-config-manager\-- add-repo\ https://download.docker.com/linux/centos/docker-ce.repo[root@Zabbix ~ ] # yum-y install docker-ce-19.03.12 docker-ce-cli-19.03.12 [root@Zabbix ~] # systemctl enable docker--now
2) install Docker-Compose
[root@Zabbix] # wget "https://github.com/docker/compose/releases/download/v2.3.2/docker-compose-$(uname-s)-$(uname-m)"-O / usr/local/bin/docker-compose [root@Zabbix ~] # chmod + x / usr/local/bin/docker-compose [root@Zabbix ~] # docker-compose-- version
3) install Agent
[root@Zabbix ~] # rpm-ivh http://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/zabbix-agent-5.4.8-1.el7.x86_64.rpm[root@Zabbix ~] # egrep-v'^ $| # 'zabbix_agentd.conf PidFile=/var/run/zabbix/zabbix_agentd.pidLogFile=/var/log/zabbix/zabbix_agentd.logLogFileSize=0Server=127.0.0.1ServerActive=127.0.0.1Hostname=Zabbix serverInclude=/etc/zabbix/zabbix_agentd.d / * .conf [root@Zabbix ~] # systemctl enable zabbix-agent-- now
4) install Zabbix
[root@Zabbix] # mkdir-p / app/zabbix [root@Zabbix ~] # cd / app/zabbix/ [root@Zabbix zabbix] # cat > / etc/zabbix/zabbix_agentd.conf3. Write a Nginx custom monitoring script [root@Zabbix ~] # yum-y install nginx [root@Zabbix ~] # cat / dev/null | grep "Active" | awk'{print $NF}'} function Reading {/ usr/bin/curl "http://$HOST:$PORT/status" 2 > / dev/null | grep" Reading "| awk'{print $2}'} function Writing {/ usr/bin/curl" http://$HOST:$PORT/status" 2 > / dev/null | grep " Writing "| awk'{print $4}'} function Waiting {/ usr/bin/curl" http://$HOST:$PORT/status" 2 > / dev/null | grep "Waiting" | awk'{print $6}'} function Server {/ usr/bin/curl "http://$HOST:$PORT/status" 2 > / dev/null | awk NR==3 | awk'{print $1}'} function Accepts {/ usr/bin/curl" http://$HOST:$PORT/status" 2 > / dev/null | awk NR==3 | awk'{print $2}'} function Requests {/ usr/bin/curl "http://$HOST:$PORT/status" 2 > / dev/null | awk NR==3 | awk'{print $3}'} # execute function$1 [root@Zabbix ~] # chmod + x / etc/zabbix/scripts/nginx_status.sh
2) define the monitoring script
[root@Zabbix ~] # cat
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.