欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

centos7安装zabbix4.4(zabbix-agent)

程序员文章站 2024-03-19 17:03:46
...

1 centos7安装zabbix4.4(zabbix-server)

《centos7安装zabbix4.4(zabbix-server)》:https://clevercode.blog.****.net/article/details/104229415

2 更新源

# rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
# yum clean all

3 安装agent

# yum -y install zabbix-agent

4 配置agent

vim /etc/zabbix/zabbix_agentd.conf
172.16.159.131是zabbix-server端的ip,Hostname是zabbix-agent的hostname

Server=172.16.159.131
ServerActive=172.16.159.131
Hostname=php1.web

5 启动

# systemctl start zabbix-agent

6 开机启动

# systemctl enable zabbix-agent

7 查看日志

cat /var/log/zabbix/zabbix_agentd.log

[aaa@qq.com ~]# cat /var/log/zabbix/zabbix_agentd.log
  1426:20200210:033159.439 Starting Zabbix Agent [php1.web]. Zabbix 4.4.5 (revision b93f5c4fc0).
  1426:20200210:033159.440 **** Enabled features ****
  1426:20200210:033159.440 IPv6 support:          YES
  1426:20200210:033159.440 TLS support:           YES
  1426:20200210:033159.440 **************************
  1426:20200210:033159.440 using configuration file: /etc/zabbix/zabbix_agentd.conf
  1426:20200210:033159.442 agent #0 started [main process]
  1430:20200210:033159.451 agent #4 started [listener #3]
  1431:20200210:033159.453 agent #5 started [active checks #1]
  1427:20200210:033159.456 agent #1 started [collector]
  1428:20200210:033159.462 agent #2 started [listener #1]
  1429:20200210:033159.464 agent #3 started [listener #2]
  1431:20200210:033202.456 active check configuration update from [172.16.159.131:10051] started to fail (ZBX_TCP_READ() timed out)
  1431:20200210:033302.564 active check configuration update from [172.16.159.131:10051] is working again
  1431:20200210:033302.565 no active checks on server [172.16.159.131:10051]: host [php1.web] not found
[aaa@qq.com ~]#

8 在zabbix-server上添加agent主机

8.1 添加主机

centos7安装zabbix4.4(zabbix-agent)
刚添加的主机是没有应用集,监控项,触发器等都是空。
centos7安装zabbix4.4(zabbix-agent)

8.2 使用模板

选择主机
centos7安装zabbix4.4(zabbix-agent)
选择模板
centos7安装zabbix4.4(zabbix-agent)

主机列表发现,模板,监控项都有了
centos7安装zabbix4.4(zabbix-agent)

8.3 如果图形没有数据集

如果发现zabbix Get value from agent failed: cannot connect to [[10.2.72.132]:10050]: [113] No route to host 报错
centos7安装zabbix4.4(zabbix-agent)

在zabbix-agent机器上面开启10050端
[aaa@qq.com ~]# firewall-cmd --add-port=10050/tcp
success
[aaa@qq.com ~]# service iptables status

查看图形即可发现有数据了。
centos7安装zabbix4.4(zabbix-agent)

参考文档

《Zabbix使用agent监控》:
https://www.cnblogs.com/Jackie-Chen/articles/10824139.html
《zabbix server无法访问agent服务器的10050端口》:https://www.cnblogs.com/cq90/p/8985172.html

技术交流

CleverCode是一名架构师,技术交流,咨询问题,请加CleverCode创建的qq群(架构师俱乐部):517133582。加群和腾讯,阿里,百度,新浪等公司的架构师交流。【架构师俱乐部】宗旨:帮助你成长为架构师!
centos7安装zabbix4.4(zabbix-agent)

相关标签: 架构师