[root@zbx-target etc]# tree /etc/zabbix/
/etc/zabbix/
├── zabbix_agentd.conf
└── zabbix_agentd.d
└── userparameter_mysql.conf
1 directory, 2 files
[root@zbx-target etc]#
其中 zabbix_agentd.conf 是agent的配置文件, userparameter_mysql.conf 是用户自定义监控插件的地方
只要定义在 zabbix_agentd.d 目录下都有效,所以习惯上,一种应用使用一个独立的配置
这个机制非常强大,可以灵活地集成本地脚本,收集任何脚本可以收集到的信息
原本的配置
[root@zbx-target etc]# grep -v "^#" /etc/zabbix/zabbix_agentd.conf | grep -v "^$"
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
Include=/etc/zabbix/zabbix_agentd.d/
[root@zbx-target etc]#
我们需要在 Server 中加入zabbix server的IP地址
[root@zbx-target zabbix]# vim zabbix_agentd.conf
[root@zbx-target zabbix]# grep -v "^#" /etc/zabbix/zabbix_agentd.conf | grep -v "^$"
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.66.123,127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
Include=/etc/zabbix/zabbix_agentd.d/
[root@zbx-target zabbix]#
[root@zbx-target script]# vim /etc/sysconfig/iptables
[root@zbx-target script]# grep 10050 /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT
[root@zbx-target script]# /etc/init.d/iptables reload
iptables: Trying to reload firewall rules: [ OK ]
[root@zbx-target script]# iptables -L -nv | grep 10050
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:10050
[root@zbx-target script]#
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有