由于官方模板监控项较多,部分参数理解起来比较复杂,并不是适用于所有用户的使用场景,所以吴昊这里重新生成了一份Linux内存监控模板,下载后,直接导入即可。
Linux内存监控模板下载地址:https://github.com/whsir/zabbix7.0_templates/blob/main/Linux%20agent%20-%20Memory%20Monitoring.yaml
当前环境
系统:Anolis OS 8.9(理论适用于RockyLinux 8.x、AlmaLinux 8.x、OpenCloudOS 8.x)
Server:zabbix-server-7.0.7
Agent:zabbix-agent2-7.0.7
关闭selinux,关闭防火墙,或自行配置好规则,放行10050端口
1、配置Zabbix7.0源
官方源和阿里源任选其一
官方源
1 |
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rhel/8/x86_64/zabbix-release-latest-7.0.el8.noarch.rpm |
阿里云源
1 |
vi /etc/yum.repos.d/zabbix.repo |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
[zabbix] name=Zabbix Official Repository - $basearch baseurl=https://mirrors.aliyun.com/zabbix/zabbix/7.0/rhel/8/$basearch/ enabled=1 gpgcheck=1 gpgkey=https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-B5333005 [zabbix-non-supported] name=Zabbix Official Repository (non-supported) - $basearch baseurl=https://mirrors.aliyun.com/zabbix/zabbix/7.0/rhel/8/$basearch/ enabled=1 gpgkey=https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX gpgcheck=1 [zabbix-unstable] name=Zabbix Official Repository (unstable) - $basearch baseurl=https://mirrors.aliyun.com/zabbix/zabbix/7.0/rhel/8/$basearch/ enabled=0 gpgcheck=1 gpgkey=https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-A14FE591 [zabbix-sources] name=Zabbix Official Repository (source code) - $basearch baseurl=https://mirrors.aliyun.com/zabbix/zabbix/7.0/rhel/8/SRPMS enabled=0 gpgkey=https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-B5333005 gpgcheck=1 [zabbix-tools] name=Zabbix Official Repository (tools) - $basearch baseurl=https://mirrors.aliyun.com/zabbix/zabbix-tools/rhel/8/$basearch/ enabled=1 gpgkey=https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-TOOLS gpgcheck=1 |
2、安装Zabbix-agent2
1 |
dnf install zabbix-agent2 -y |
Agent和Agent 2对比参见官方文档:https://www.zabbix.com/documentation/7.0/zh/manual/appendix/agent_comparison
3、配置Zabbix-agent2
vi /etc/zabbix/zabbix_agent2.conf
Server=服务端IP,即Zabbix-server地址(如果有多个服务端可以用逗号分隔)
4、启动服务
1 2 |
systemctl enable zabbix-agent2 systemctl start zabbix-agent2 |
5、Zabbix-server配置
数据采集→模板→右上角导入→选择Linux内存监控模板导入即可
导入完成后,可结合实际需求更改内存模板
6、关联主机
数据采集→主机,在添加的主机中关联内存模板
补充一些注意事项
1、已用物理内存是根据available计算得来,不含缓存缓冲区等。
2、模板图形默认仅包含物理内存,如需swap图形,请自行添加。
3、默认触发器阈值90%,如需调整请在模板中修改宏的数值。
原文链接:Zabbix7.0配置Linux内存监控,转载请注明来源!