Installation and configuration method of Zabbix Agent on Linux platform

Installation and configuration method of Zabbix Agent on Linux platform

Here is a brief summary of the installation and configuration of Zabbix Agent on the Linux platform. The Zabbix version tested in the experiment is relatively old (Zabbix 3.0.9). Although the version is a bit old, the installation steps and processes of the new and old versions are basically the same. The summary here is just an operation manual, and some content will be updated or added later.

There are many Linux versions, and the following document has only been tested on RHEL and CentOS versions. Different versions may have different installation procedures, which will be supplemented and improved later.

1: First check the version of zabbix_server

# zabbix_server --version
zabbix_server (Zabbix) 3.0.9
Revision 67444 19 April 2017, compilation time: Apr 23 2017 18:05:43
 
Copyright (C) 2017 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law

2: Check the Linux distribution version of the monitored server

For example, 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 Zabbix Server version and Linux distribution version

For this test environment, we choose to download the RMP package zabbix-agent-3.0.9-1.el5.x86_64.rpm. The download address is http://repo.zabbix.com/zabbix/3.0/rhel/5/x86_64/

# rpm -ivh zabbix-agent-3.0.9-1.el5.x86_64.rpm
warning: zabbix-agent-3.0.9-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 79ea5ed4
Preparing... ############################################# [100%]
 1:zabbix-agent ############################################## [100%]

Of course, if the server can access the external network, you can also use the following command to install it directly.

#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 easier and more convenient.

#yum -y install zabbix-agent

We know that by default, Zabbix Server generally actively obtains data from the client. Of course, the client can also actively push data to the server. The client uses the zabbix_sender instruction to actively push data to the server. The installation and configuration of zabbix_sender are not introduced here. I plan to introduce it separately later.

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

# 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 host name replaces Zabbix server

5: Start 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 methods.

Method 1:

# service zabbix-agent start
Starting Zabbix agent: [ OK ]
# service zabbix-agent stop
Shutting down Zabbix agent: [ OK ]
# service zabbix-agent status
zabbix_agentd (pid 8120) is running...

Method 2:

systemctl start zabbix-agent.service

systemctl stop zabbix-agent.service

Method 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 start automatically at boot

# chkconfig --add zabbix-agent
# chkconfig --list | grep zabbix-agent
zabbix-agent 0:off 1:off 2:off 3:off 4:off 5:off 6:off

7: Check whether the monitored Linux server firewall has TCP port 10050 open

This is very simple and I won’t elaborate on it in detail. But it must be checked and confirmed, otherwise Zabbix Server will not be able to obtain data.

If you use iptables to manage your firewall, for example (CentOS 5,6)

Modify the configuration file, firewall configuration file /etc/sysconfig/iptables, add the following configuration

-A RH-Firewall-1-INPUT -p tcp --dport 10050 -j ACCEPT

Restart the firewall service iptables restart

If you use firewalld to manage your firewall (for example, CentOS 7.x)

firewall-cmd --zone=public --add-port=10050/tcp --permanent Add port

firewall-cmd --reload Restart the firewall service

firewall-cmd --query-port=10050/tcp, check whether a port is open

Version issue:

Note: Regarding the issue of whether the versions of Zabbix Server and Zabbix Agent should be consistent, try to keep them consistent. Consistent versions can avoid various problems. The official documentation also states: Zabbix Server is backward compatible with Zabbix Agent. But please note that some parameters need to be modified. Please note that Zabbix agent 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 suggests that Zabbix agents higher than 3.0 cannot be used with Zabbix server 3.0, it is unclear whether it refers to major or minor versions. For example, the Zabbix Server in my test environment is 3.0.9, and the client can also install the zabbix-agent-3.0.28 version. No problems have been found in the test.

Summarize

This is the end of this article about the installation and configuration methods of Zabbix Agent on Linux platform. For more relevant Zabbix Agent installation and configuration content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to monitor oracle database using zabbix agent2
  • How to deploy zabbix_agent in docker
  • Install and configure Zabbix Agentd on Windows
  • Zabbix implements batch monitoring of port status
  • How to monitor multiple JVM processes in Zabbix
  • Detailed process of zabbix monitoring process and port through agent

<<:  Detailed explanation of the knowledge points of using TEXT/BLOB types in MySQL

>>:  js uses the reduce method to make your code more elegant

Recommend

Sample code for JS album image shaking and enlarging display effect

The previous article introduced how to achieve a ...

MySQL 5.7.20 free installation version configuration method graphic tutorial

I have seen many relevant tutorials on the Intern...

Detailed explanation of Linux host name modification command

Linux change hostname command 1. If you only need...

Website Color Schemes Choosing the Right Colors for Your Website

Does color influence website visitors? A few year...

Vue.js uses Element-ui to implement the navigation menu

This article shares the specific code for impleme...

JavaScript canvas realizes dynamic point and line effect

This article shares the specific code for JavaScr...

Vue implements login jump

This article example shares the specific code of ...

HTML table tag tutorial (13): internal border style attributes RULES

RULES can be used to control the style of the int...

Chrome monitors cookie changes and assigns values

The following code introduces Chrome's monito...

MySQL installation and configuration methods and precautions under Windows platform

2.1、msi installation package 2.1.1、Installation I...

Solution to the problem that MySQL commands cannot be entered in Chinese

Find the problem Recently, when I connected to th...

How to change apt-get source in Ubuntu 18.04

When using apt-get to install, it will be very sl...