How to install zabbix_agent 4.0 on centos7

Notice: This article is come from https://computingforgeeks.com/how-to-install-and-configure-zabbix-agent-4-0-on-ubuntu-18-04-and-centos-7/

Below steps are used to install Zabbix agent on CentOS 7

Step 1 Add Zabbix repositories

Add Zabbix 4.0 repositories using the commands below:

rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

Once the repo has been added, install Zabbix agent by executing the following command on your terminal.

yum install -y zabbix-agent zabbix-sender 
Step 2: Configuring Zabbix Agent

Zabbix agent configuration is /etc/zabbix/zabbix_agentd.conf. Edit

# cat /etc/zabbix/zabbix_agentd.conf
# On line 97 - Specify Zabbix server IP Address
Server=192.168.10.2
# On line 138 - Specify Zabbix server ( For active checks)
ServerActive=192.168.10.2
# On line 150 - Set server hostname reported by Zabbix agent
Hostname=server1.example.com

Start zabbix-agent after making the change, also enable the service to start on boot:

sudo systemctl start zabbix-agent
sudo systemctl enable zabbix-agent

You can check service status using the command:

$ sudo systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2018-10-16 22:30:00 UTC; 50s ago
Main PID: 28026 (zabbix_agentd)
CGroup: /system.slice/zabbix-agent.service
├─28026 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
├─28027 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
├─28028 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
├─28029 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
├─28030 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
└─28031 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

If you have firewalld enabled, allow port 10050/tcp on the firewall. This is used by Zabbix agent daemon.

For CentOS 7:

sudo firewall-cmd --permanent --add-port=10050/tcp
sudo firewall-cmd --reload

after installing zabbix-agent and zabbix-server you can test the connection between them by this command below on zabbix-server:
192.168.152.1 is the zabbix-agent

[root@localhost ~]# zabbix_get -s 192.168.152.1 -p 10050 -k "system.cpu.load[all,avg1]"
0.000000
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值