安裝 zabbix agent 4.4 - 初體驗

關閉防火牆
CentOS7
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl stop iptables.service
systemctl disable iptables.service


vi /etc/selinux/config
SELINUX=disabled
setenforce 0
reboot

netstat  -auntlp

配置zabbix 4.4 YUM  源
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum list zabbix*

yum install zabbix-agent -y 
systemctl start zabbix-agent
systemctl status zabbix-agent

cat  /etc/zabbix/zabbix_agentd.conf | grep -vE "^$|^#"

vi /etc/zabbix/zabbix_agentd.conf 

LogFileSize=5
Server=192.168.80.112
ServerActive=192.168.80.112
Hostname=linux-001

systemctl restart zabbix-agent
systemctl enable zabbix-agent
systemctl status zabbix-agent


参数说明:

PidFile=/run/zabbix/zabbix_agentd.pid 
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=5 (设置zabbix日志当到达5M时自动回滚,0表示disabled)
Server=<zbx-server的ip>
ListenPort=10050
ServerActive=<zbx-server的ip> 在这里可以改变端口号
Hostname=<本机的名字>
Timeout=30
AllowRoot=1 (设置是否允许以root用户启动,值有1和0,0表示禁止以root用户启动)
UnsafeUserParameters=1 (设置是否允许自定义监控,值有1和0,0表示disable)
EnableRemoteCommands=1 (设置是否允许来自zabbix server端的远程命令,值有1和0,0表示不允许)
LogRemoteCommands=1 (设置是否允许日志文件以warning级别记录来自zabbix server端的远程命令,值有1和0,


3,登陆zabbix-server Web界面

点击 配置——主机——创建主机,填写主机名称,选择群组Linux servers,填写主机的IP地址

点击模板,在链接指示器中选择Template OS Linux,点击添加,单击添加


on server
zabbix_get -s 192.168.11.232  -p 10050 -k "system.hostname"

##

tail -100f /var/log/zabbix/zabbix_agentd.log
Get value from agent failed: cannot connect to [[192.168.11.231]:10050]: [113] No route to host





service iptable status 
iptables -L

參考  https://cloud.tencent.com/developer/article/1615088
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容