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

如cat /var/log/zabbix/zabbix_agentd.log
日志出现:cannot disable core dump, exiting...
原因是selinux开启导致的,关闭以后就正常了。 
关闭办法:
setenforce 0 

 

转载于:https://my.oschina.net/ch66880/blog/1634677

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值