Zabbix-1.2客户端安装

380 阅读1分钟

#前面服务器安装完了,后面就剩下客户端装机,主要介绍zabbix-agent装。

#关闭防火墙
systemctl stop firewalld.service
systemctl disable  firewalld.service

#关闭SElinux
vim /etc/selinux/config

#安装命令补齐
yum -y install bash-completion #防止最小化安装的服务器没有TAB补全

Centos 7 增加Zabbix镜像源
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
Centos 7 添加阿里云镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

#安装zabbix-agent
yum install -y zabbix-agent

#配置zabbix-agent
vim /etc/zabbix/zabbix_agentd.conf
98 Server=127.0.0.1(改成实际服务器ip)
139 ServerActive=127.0.0.1(改成实际服务器ip)
150 Hostname=(自定义)

#启动zabbix-agent服务
systemctl start zabbix-agent #启动
systemctl status zabbix-agent #查看状态
sysytemctl enable zabbix-agent #重启后开机自启动
查看日志
tailf /var/log/zabbix/zabbix_agentd.log #看看有啥错误没。 也可以不看
 28952:20191121:172139.822 using configuration file: /etc/zabbix/zabbix_agentd.conf
 28952:20191121:172139.823 agent #0 started [main process]
 28953:20191121:172139.825 agent #1 started [collector]
 28954:20191121:172139.826 agent #2 started [listener #1]
 28956:20191121:172139.828 agent #4 started [listener #3]
 28957:20191121:172139.829 agent #5 started [active checks #1]
 28955:20191121:172139.831 agent #3 started [listener #2]
 28957:20191121:172139.865 no active checks on server [34.80.20.81:10051]: host [xxx] not found
 28957:20191121:172339.932 no active checks on server [34.80.20.81:10051]: host [xxx] not found
看到```!not found~```! 就是对了。可以去web添加。

#到web上
配置-主机-创建主机:
主机名称:写在前面日志里面host [xxx]中的“xxx”,注意引号不输入。
Agent代理程序接口:填写本机IP 
端口默认;
选择模板-添加模板:(随意)
然后“确定”

看到

ZBX是亮的就好了