Centos 7安装zabbix agent

Centos 7安装zabbix agent

[BEGIN] 2018/3/14 16:01:56
Last login: Thu Mar 15 00:01:12 2018
--------------------------以下是一个朋友给我的案例

## 安装zabbix agent
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.7-1.el7.x86_64.rpm

## 修改配置文件zabbix_agent.conf
##注意IP需更改
sed -i "s/Server=127.0.0.1/Server=10.2.1.236/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/ServerActive=127.0.0.1/ServerActive=10.2.1.236/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/Hostname=Zabbix server/# Hostname=10.2.1.236/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/# HostnameItem=system.hostname/HostnameItem=system.hostname/g" /etc/zabbix/zabbix_agentd.conf

## 修改防火墙添加 tcp-10050
firewall-cmd --permanent --zone=public --add-port=10050/tcp;
firewall-cmd --reload;

## 重启agent服务
systemctl enable zabbix-agent.service
systemctl restart zabbix-agent.service






----------------------------以下是快速更改配置值
03、关闭 SELinux:
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
#04、关闭防火墙:
#systemctl stop firewalld.service && systemctl disable firewalld.service
-------------------------以下是我操作记录
#关闭防火墙:
[root@localhost opt]# firewall-cmd --state 
running
[root@localhost opt]# systemctl stop firewalld.service
[root@localhost opt]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
#
#下载并上传 rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.7-1.el7.x86_64.rpm

[root@localhost ~]# cd /opt


[root@localhost opt]# rpm -ivh zabbix-agent-3.4.7-1.el7.x86_64.rpm 
warning: zabbix-agent-3.4.7-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:zabbix-agent-3.4.7-1.el7         ################################# [100%]
[root@localhost opt]# vim /etc/zabbix/zabbix_agentd.conf


#结束agent服务
[root@localhost opt]# systemctl enable zabbix-agent.service
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
#重启agent服务
[root@localhost opt]# systemctl restart zabbix-agent.service
Job for zabbix-agent.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-agent.service" and "journalctl -xe" for details.
#报错 未关闭 SELinux:
#查询状态
[root@localhost opt]# getenforce
Enforcing
[root@localhost opt]# vi /etc/selinux/config
SELINUX=disabled

#重启生效
[root@localhost opt]# reboot

Connection closed by foreign host.

[END] 2018/3/14 16:07:23

猜你喜欢

转载自my.oschina.net/ch66880/blog/1634677