cacti 使用snmp自定义抓取数据
----------------------------------
cat /etc/snmp/snmpd.conf
exec .1.3.6.1.2.1.2.2021.18 whouse195_443_3 /etc/whouse195_443_3.sh
exec .1.3.6.1.2.1.2.2021.19 whouse195_443_5 /etc/whouse195_443_5.sh
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
view systemview included .1.3.6.1.2.1.2
access notConfigGroup "" any noauth exact mib2 none none
view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <> (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
[root@localhost ~]# snmpwalk -c public -v 2c 172.17.167.2 .1.3.6.1.2.1.2.2021.18
IF-MIB::interfaces.2021.18.1.1 = INTEGER: 1
IF-MIB::interfaces.2021.18.2.1 = STRING: "whouse195_443_3"
IF-MIB::interfaces.2021.18.3.1 = STRING: "/etc/whouse195_443_3.sh"
IF-MIB::interfaces.2021.18.100.1 = INTEGER: 0
IF-MIB::interfaces.2021.18.101.1 = STRING: "184"
IF-MIB::interfaces.2021.18.102.1 = INTEGER: 0
IF-MIB::interfaces.2021.18.103.1 = ""
[root@localhost ~]# snmpwalk -c public -v 2c 172.17.167.2 .1.3.6.1.2.1.2.2021.19
IF-MIB::interfaces.2021.19.1.1 = INTEGER: 1
IF-MIB::interfaces.2021.19.2.1 = STRING: "whouse195_443_5"
IF-MIB::interfaces.2021.19.3.1 = STRING: "/etc/whouse195_443_5.sh"
IF-MIB::interfaces.2021.19.100.1 = INTEGER: 0
IF-MIB::interfaces.2021.19.101.1 = STRING: "184"
IF-MIB::interfaces.2021.19.102.1 = INTEGER: 0
IF-MIB::interfaces.2021.19.103.1 = ""
我们想要的就是
.2021.18.101.1
.2021.19.101.1
在编辑cacti数据模板时写入OID分别为
.1.3.6.1.2.1.2.2021.18.101.1
.1.3.6.1.2.1.2.2021.19.101.1
阅读(2001) | 评论(0) | 转发(0) |