In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
First, compile and install Zabbix client under Linux
# abbix Agent compile and install yum install-y gcc gcc-c++ make pcre-develuseradd-s / sbin/nologin zabbixcd / usr/local/src/wget 'https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.0.3/zabbix-4.0.3.tar.gz'tar-zxvf zabbix-4.0.3.tar.gzcd zabbix-4.0.3./configure-- prefix=/usr/local/zabbix-- enable-agentmake & & make installchown zabbix:zabbix -R / usr/local/zabbix/# environment variable configuration vim / etc/profileexport PATH=$PATH:/usr/local/zabbix/sbin/:/usr/local/zabbix/bin/#zabbix agent configuration The ivrpPidFile=/usr/local/zabbix/zabbix_agentd.pidLogFile=/usr/local/zabbix/zabbix_agentd.logHostname=xxx configured on Server and ServerActive is zabbix server's ivrpPidFile=/usr/local/zabbix/zabbix_agentd.pidLogFile=/usr/local/zabbix/zabbix_agentd.logHostname=xxx # fill in the hostname or the hostname in zabbix Server=xxx # # zabbix server address ServerActive=xxx # # zabbix server address is equivalent to access whitelist UnsafeUserParameters=1Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/*.confzabbix agent startup / usr/local/zabbix/sbin/zabbix_agentd
Second, zabbix_agent monitors cpu disk traffic, etc.
Zabbix_get
Zabbix provides a zabbix_get tool that can communicate with zabbix agent to obtain monitoring information.
Usage: zabbix_get-s xxx-k xxx
Zabbix agent view all items that can be monitored: zabbix_agentd-p
Add through templat
Monitor cpu load
Key: system.cpu.load [all,avg1] float type
Key: system.cpu.load [all,avg5] float type
Key: system.cpu.load [all,avg15] float type
Monitor cpu usage and Idle
System.cpu.util [, iowait,] float type
System.cpu.util [, system,] float type
System.cpu.util [, user,] float type
System.cpu.util [, idle,] float type idle
Monitor the remaining memory (buffers\ cached is actually remaining)
Vm.memory.size [available] integer
Monitoring disk
Name: Disk pfree on $1
Name: inode pfree on $1
Vfs.fs.size [/, pfree] float type
Vfs.fs.inode [/, pfree] float type
Monitoring traffic
The net.if.in [eth0] integer (rate per second) returns bytes by default, which requires 8.
The net.if.out [eth0] integer (rate per second) returns bytes by default, which requires 8.
Monitoring traffic needs preprocessing
Third, zabbix active and passive mode
Active active:agent requests server to obtain a list of active monitoring items, and actively submits the data to be detected in the monitoring items to server/proxy
Server is less stressful, but some types do not support it.
Server has a timeout limit for retrieving data. The maximum timeout time is 30 seconds. If data retrieval is often more than 30 seconds, it is not recommended to use agent in active mode. You can use the following types of agent active
Passive: server requests agent to obtain data of monitoring items, and agent returns data
Passive mode:
Supported items communication process
Server opens a TCP connection
Server sends request agent.ping\ n
Agent receives the request and responds to 1
Server processes received data 1
Close the TCP connection
Not supported items communication process (type not supported)
Server opens a TCP connection
Server sends request vfs.fs.size [/ nono]\ n
Agent receives the request and returns the response data ZBX_NOTSUPPORTED\ 0Cannot obtain filesystem information: [2] No such file or directory
Server receives and processes data, changing the status of item to "not supported"
Active mode
Agent opens TCP connection (active detection becomes Agent open)
Agent request items check list
Server returns the items list
Agent handles the response
Close the TCP connection
Agent starts collecting data
Use templates to monitor linux
Use the template linux os template in the template to monitor linux-related system information (pay attention to clear the relevant useless monitoring items, because the database writing pressure is very high with the increase of monitoring)
Automatic discovery in template linux os requires both hostname and computer name to be found automatically by check now immediately.
If not, you may report Cannot send request: host is not monitored. Error
Four: zabbix custom key monitoring linux server
Custom key description
All languages, as long as you can run the returned results
Common languages of operation and maintenance: Shell, Python
Custom key is divided into parameter script and no parameter script.
No parameter script
For example:
Free-m | grep 'Mem:' | awk' {print $NF}'# in the agent machine, vim / usr/local/zabbix/etc/zabbix_agentd.conf.d/mem.confUserParameter=mem.available,sh / tmp/memavailable.sh # # UserParameter name is key name chmod astatx memavailable.sh # # restart agent, test zabbix_get-s 192.168.0.102-k mem.available## if not soupout is displayed, check script firewall port, etc.
Adding a custom key is similar to adding an item for a template. Note that adding a trigger tigers is based on the value returned by the script.
The key name is the name in the configuration file
Script with parameters
Compared with no parameter script, parameter script can follow parameters when writing item.
# shell script / tmp/mem.shcase "$1" in "available") free-m | grep 'Mem:' | awk' {print $NF}';; "total") free-m | grep 'Mem:' | awk' {print $2}';; "used") free-m | grep 'Mem:' | awk' {print $3}';; *) echo "not supported" EsacUserParameter=mem.check [*], sh / tmp/mem.sh $1 million # Test zabbix_get-s 192.168.0.101-k mem.check [availabl]
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.