1.zabbix服务端添加监控
给zabbix-server机器安装上agent进程,改配置,启动即可
1.目标机器安装zabbix-agent
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-agent-4.0.11-1.el7.x86_64.rpm
ntpdate -u ntp.aliyun.com
2.修改zabbix-agent配置文件
官网资料,关于配置文件的解释
https://www.zabbix.com/documentation/4.0/zh/manual/appendix/config/zabbix_agentd
修改配置如下,保证和我一样先
[root@web-7 ~]
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=10.0.0.200
Include=/etc/zabbix/zabbix_agentd.d/*.conf
3.启动agent
[root@web-7 ~]
[root@web-7 ~]
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
4.检查,agent的端口是10050
[root@web-7 ~]
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 1644/zabbix_agentd
tcp6 0 0 :::10050 :::* LISTEN 1644/zabbix_agentd
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-agent-4.0.11-1.el7.x86_64.rpm
ntpdate -u ntp.aliyun.com
cat > /etc/zabbix/zabbix_agentd.conf <<'EOF'
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=10.0.0.200
Include=/etc/zabbix/zabbix_agentd.d/*.conf
EOF
systemctl start zabbix-agent && systemctl enable zabbix-agent
5. 小结
zabbix-server 地址是 10.0.0.200::10051
zabbix-agent 地址是 10.0.0.200:10050
安装zabbix-get检查连接情况
1. 去服务端安装
2. 试试和agent连得通吗?通就可以去管理了
1
进入zabbix-ui添加机器

添加主机
可以填写主机名,以及可见名称
只要监控agent的接口 10.0.0.7:10050 填对了就好

添加一个模板

最终结果

2.更细节的添加操作
在安装完毕zabbix-agent之后,我们想对某台机器进行监控,采集各种数据
还得进去zabbix-UI 进行主机添加,流程是
创建主机群组
创建主机
添加监控项
配置触发器
创建图形
告警配置
创建主机群组

添加一个web组,用于管理一组都属于web组的机器,如web7 web8 web9
接下来就是添加主机了
添加主机


关联模板

主机添加好之后,你就得定义要监考哪些内容了,是监控内存?CPU、磁盘、服务、还是其他?
问题是,你一台机器要添加这些、给你一百台机器,都手动反复的添加?
因此zabbix给了你模板的功能,这一堆需要监控的内容,被制作成了统一的模板,拿来即用,效率很高。
你只需要将主机和模板关联即可。
具体流程
1. 选择主机,进入主机详细
2. 进入模板选项,配置模板
3. 自己选择一个模板添加,一般直接加 template os linux即可
4. 注意要点击添加按钮。


1.经过上述添加之后,web7机器的信息就已经被监控中了
执行如下命令,给cpu来点压力
[root@web-7 ~]#while true;do echo "加油";done
2.通过图形功能,进行cpu的监控图示
cpu图示

内存图示

【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性