邯城往事 邯城往事

来自邯郸社畜的呐喊

目录
zabbix添加监控Sangfor AC监控
/  

zabbix添加监控Sangfor AC监控

因为 zabbix 自带的 snmp 模板只是标准的,没能监控自己想要的数据,所以从 Sangfor 设备导出 mib 文件,进行转换成 zabbix 识别的模板。

将 mib 文件导入 zabbix 服务器:

[root@monitor /usr/share/snmp/mibs]# snmptranslate -IR -On SANGFOR-GENERAL-MIB::cpuLoadAvg
.1.3.6.1.4.1.35047.1.6
[root@monitor /usr/share/snmp/mibs]# snmpwalk -v 2c -c limi@2018 10.200.101.1 .1.3.6.1.4.1.35047.1.6
SNMPv2-SMI::enterprises.35047.1.6.1.0 = STRING: "1.63"
SNMPv2-SMI::enterprises.35047.1.6.2.0 = STRING: "2.06"
SNMPv2-SMI::enterprises.35047.1.6.3.0 = STRING: "2.00"
[root@monitor /usr/share/snmp/mibs]# snmpget -v 2c -c limi@2018 10.200.101.1 .1.3.6.1.4.1.35047.1.6.1.0
SNMPv2-SMI::enterprises.35047.1.6.1.0 = STRING: "1.85"

至于上面的取值对象,从 mib 文件里面找

操作如下:

  1. 安装依赖
yum -y install net-snmp-utils net-snmp-libs
yum -y install "perl(SNMP)" "perl(XML::Simple)"
  1. 下载转换脚本:
curl https://raw.githubusercontent.com/cavaliercoder/mib2zabbix/master/mib2zabbix.pl > mib2zabbix
chmod a+x mib2zabbix
  1. 查看 mib 信息:
    snmptranslate -Tz -m ./SANGFOR-GENERAL-MIB.mib

image.png

  1. 转换
snmptranslate -Tz -m ./SANGFOR-GENERAL-MIB.mib | ./mibszabbix -e -o .1.3.6.1.4.1 -f Template_Sangfor_AC.xml -N Template_Sangfor_AC

最后,导入模板文件

参考:
https://www.zabbix.com/documentation/4.0/zh/manual/config/items/itemtypes/snmp/mib_files


标题:zabbix添加监控Sangfor AC监控
作者:cuijianzhe
地址:https://www.cjzshilong.cn/articles/2021/05/18/1621325983655.html