In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you how to install and configure Zabbix Agent on the Linux platform, the content is easy to understand, I hope you can learn, after learning, there will be a harvest, the following let the editor take you to take a look at it.
Here is a brief summary of the installation and configuration of the Linux platform Zabbix Agent. The Zabbix version tested in the experiment is relatively old (Zabbix 3.0.9), but although the version is a bit old, there is little difference in the installation steps and process between the old and new versions. The summary here is only used as an operation manual, which will be updated or added later.
There are many versions of Linux, and the following documents have only been tested in RHEL and CentOS. Different versions may be installed differently, which will be supplemented and improved later.
1: check the version of zabbix_server first
# zabbix_server-versionzabbix_server (Zabbix) 3.0.9Revision 67444 19 April 2017, compilation time: Apr 23 2017 18:05:43 Copyright (C) 2017 Zabbix SIALicense GPLv2+: GNU GPL version 2 or later. This is free software: you are free to change and redistribute it according tothe license. There is NO WARRANTY, to the extent permitted by law
Undefined
2: check the Linux distribution of the monitored server
Such as RHEL or CentOS
# more / etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
# more / etc/issue
Oracle Linux Server release 5.7
Kernel\ r on an\ m
3: choose to download the corresponding Zabbix Agent installation package according to the version of Zabbix Server and the Linux distribution
In this test environment, we choose to download the RMP package zabbix-agent-3.0.9-1.el5.x86_64.rpm at http://repo.zabbix.com/zabbix/3.0/rhel/5/x86_64/
# rpm-ivh zabbix-agent-3.0.9-1.el5.x86_64.rpmwarning: zabbix-agent-3.0.9-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 79ea5ed4signing. # [100%] 1:zabbix-agent #
Undefined
Of course, if the server can access the public network, it can also be installed directly using the following command.
# rpm-ivh http://repo.zabbix.com/zabbix/3.0/rhel/5/x86_64/zabbix-agent-3.0.9-1.el5.x86_64.rpm
Or if you configure the yum source, it will be more simple and convenient.
# yum-y install zabbix-agent
We know that by default, Zabbix Server generally takes the initiative to obtain data from the client, of course, the client can also actively push the data to the server, and the client can actively push the data to the server through zabbix_sender instructions. The installation and configuration of zabbix_sender are not introduced here. I intend to introduce it separately in the future.
4: modify the configuration file of Zabbix-Agent
First find the location of zabbix_agentd.conf. You can use rpm-ql zabbix-agent or rpm-ql zabbix-agent | grep zabbix_agentd.conf
Undefined
# rpm-ql zabbix-agent/etc/init.d/zabbix-agent/etc/logrotate.d/zabbix-agent/etc/zabbix/zabbix_agentd.conf/etc/zabbix/zabbix_agentd.d/etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf/usr/sbin/zabbix_agentd/usr/share/doc/zabbix-agent-3.0.9/usr/share/doc/zabbix-agent-3.0.9/AUTHORS/usr/share/doc/zabbix-agent-3.0. 9/COPYING/usr/share/doc/zabbix-agent-3.0.9/ChangeLog/usr/share/doc/zabbix-agent-3.0.9/NEWS/usr/share/doc/zabbix-agent-3.0.9/README/usr/share/man/man8/zabbix_agentd.8.gz/var/log/zabbix/var/run/zabbix# rpm-ql zabbix-agent | grep zabbix_agentd.conf/etc/zabbix/zabbix_agentd.conf
Edit the parameter file zabbix_agentd.conf
# Option: Server
# List of comma delimited IP addresses (or hostnames) of Zabbix servers.
# Incoming connections will be accepted only from the hosts listed here.
# If IPv6 support is enabled then '127.0.0.1,':: 127.0.0.1,': ffff:127.0.0.1' are treated equally.
#
# Mandatory: no
# Default:
# Server=
Server=127.0.0.1 # replace 127.0.0.1 with the IP address of Zabbix_Server
# Option: ServerActive
# List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks.
# If port is not specified, default port is used.
# IPv6 addresses must be enclosed in square brackets if port for that host is specified.
# If port is not specified, square brackets for IPv6 addresses are optional.
# If this parameter is not specified, active checks are disabled.
# Example: ServerActive=127.0.0.1:20051,zabbix.domain, [:: 1]: 30051,::1, [12fc::1]
#
# Mandatory: no
# Default:
# ServerActive=
ServerActive=127.0.0.1 # replace 127.0.0.1 with the IP address of Zabbix_Server
# Option: Hostname
# Unique, case sensitive hostname.
# Required for active checks and must match hostname as configured on the server.
# Value is acquired from HostnameItem if undefined.
#
# Mandatory: no
# Default:
# Hostname=
Hostname=Zabbix server # Zabbix client hostname replaces Zabbix server
5: start the Zabbix-agent service
There are several ways to start Zabbix-Agent, pay attention to the actual environment, some Linux versions do not support some of the following ways.
Method 1:
Undefined
# service zabbix-agent startStarting Zabbix agent: [OK] # service zabbix-agent stopShutting down Zabbix agent: [OK] # service zabbix-agent statuszabbix_agentd (pid 8120) is running...
Mode 2:
Systemctl start zabbix-agent.servicesystemctl stop zabbix-agent.service
Mode 3:
/ etc/init.d/zabbix-agent start / etc/init.d/zabbix-agent stop / etc/init.d/zabbix-agent status
6: set the zabbix-agent service to boot automatically
# chkconfig-- add zabbix-agent# chkconfig-- list | grep zabbix-agentzabbix-agent 0:off 1:off 2:off 3:off 4:off 5:off 6:off
7: check whether the firewall of the monitored Linux server opens the tcp 10050 port.
This is very simple and does not elaborate too much. But it must be checked and confirmed, otherwise Zabbix Server cannot get the data.
If you use iptables management to manage firewalls, for example (CentOS 5 and 6)
Modify the configuration file, firewall configuration file / etc/sysconfig/iptables, and add the following configuration
-A RH-Firewall-1-INPUT-p tcp-- dport 10050-j ACCEPT
Restart Firewall service iptables restart
If you use firewalld to manage the firewall (for example, CentOS 7.x)
Firewall-cmd-- zone=public-- add-port=10050/tcp-- permanent add port
Firewall-cmd-- reload restarts firewall service
Firewall-cmd-- query-port=10050/tcp, which queries whether a port is open
Version problem:
Note: on the issue of whether the versions of Zabbix Server and Zabbix Agent should be consistent, this should be as consistent as possible, which can avoid miscellaneous problems. The official documentation also states that Zabbix Server is backward compatible with Zabbix Agent. Note, however, that some parameters need to be modified. Note that Zabbix agents higher than 3.0 cannot be used with Zabbix Server 3.0. The details are as follows:
12 Version compatibility
Supported agents
Zabbix agents from previous Zabbix versions are compatible with Zabbix 3.0. However, you may need to review the configuration of older agents as some parameters have changed, for example, parameters related to logging for versions before 3.0.
To take full advantage of new and improved items, improved performance and reduced memory usage, use the latest 3.0 agent.
Note that Zabbix agent newer than 3.0 cannot be used with Zabbix server 3.0.
Although the official documentation indicates that Zabbix agents higher than 3.0 cannot be used with Zabbix server 3.0, it is not clear whether it refers to a large version or a small version, for a small version. For example, my test environment Zabbix Server is 3.0.9, the client can also install this version of zabbix-agent-3.0.28, the test has not found a problem.
The above is about how to install and configure Zabbix Agent on the Linux platform. If you have learned knowledge or skills, you can share it for more people to see.
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.