centos7 安装zabbix-agent

来源:互联网 发布:套打软件 编辑:程序博客网 时间:2024/06/10 01:05

1、操作系统版本

  • 安装详情
说明 详情 操作系统版本 Centos 7.0 zabbix-agent版本 2.4.6 安装方式 rpm 端口 tcp/10050 服务名称 zabbix-agent 配置文件 /etc/zabbix/zabbix_agentd.conf log日志 /var/log/zabbix/zabbix_agentd.log
  • 关闭selinux
  sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config  setenforce 0  
  • 防火墙设置
    允许zabbix-agent的10050端口通过
firewall-cmd --permanent --add-port=10050/tcpfirewall-cmd --reload 

2、安装zabbix 软件源

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

3、安装zabbix-agent

yum install zabbix-sender zabbix-agent zabbix

查看已安装的zabbix-agent版本
这里写图片描述

4、配置zabbix-agent

  • 如果zabbix-agent在zabbix-server上,zabbix_agentd.conf 默认即可
  • 若zabbix-agent不在zabbix-server上,则修改zabbix_agentd.conf
    修改server的指向和hostname
 sed -i "s/Server=127.0.0.1/Server=10.0.0.101/" /etc/zabbix/zabbix_agentd.conf sed -i "s/ServerActive=127.0.0.1/ServerActive=10.0.0.101/" /etc/zabbix/zabbix_agentd.conf      (主动模式) sed -i "s/Hostname=Zabbix server/Hostname=10.0.0.105/" /etc/zabbix/zabbix_agentd.conf 
  • 启动并设置开机自启
systemctl restart zabbix-agent.servicesystemctl enable zabbix-agent.service

5、zabbix界面添加agent主机

Host——create Host
这里写图片描述

这里写图片描述

链接模板,开始监控
这里写图片描述

0 0
原创粉丝点击