需要的软件:snmpdiskio.rar
监控机上操作:
1.将下载的snmpdiskio.rar上传到cacit服务器上,解压缩,将partition.xml拷贝resource/snmp_queries下
cp snmpdiskio/partition.xml /var/www/html/cacti/resource/snmp_queries/
cp snmpdiskio/snmpdiskio /usr/local/bin
在snmpd.conf文件中加入:
exec .1.3.6.1.4.1.2021.54 hdNum /bin/sh /usr/local/bin/snmpdiskio hdNum
exec .1.3.6.1.4.1.2021.55 hdIndex /bin/sh /usr/local/bin/snmpdiskio hdIndex
exec .1.3.6.1.4.1.2021.56 hdDescr /bin/sh /usr/local/bin/snmpdiskio hdDescr
exec .1.3.6.1.4.1.2021.57 hdInBlocks /bin/sh /usr/local/bin/snmpdiskio hdInBlocks
exec .1.3.6.1.4.1.2021.58 hdOutBlocks /bin/sh /usr/local/bin/snmpdiskio hdOutBlocks
导入模版:cacti_data_query_snmp_disk_statistics.xml,cacti_graph_template_disk_io_bytessec.xml两个模版
被控机操作:
cp snmpdiskio/snmpdiskio /usr/local/bin
在snmpd.conf文件中加入:
exec .1.3.6.1.4.1.2021.54 hdNum /bin/sh /usr/local/bin/snmpdiskio hdNum
exec .1.3.6.1.4.1.2021.55 hdIndex /bin/sh /usr/local/bin/snmpdiskio hdIndex
exec .1.3.6.1.4.1.2021.56 hdDescr /bin/sh /usr/local/bin/snmpdiskio hdDescr
exec .1.3.6.1.4.1.2021.57 hdInBlocks /bin/sh /usr/local/bin/snmpdiskio hdInBlocks
exec .1.3.6.1.4.1.2021.58 hdOutBlocks /bin/sh /usr/local/bin/snmpdiskio hdOutBlocks
重启snmpd服务:service snmpd restart
在主控端测试:
snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.58
UCD-SNMP-MIB::ucdavis.58.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.58.2.1 = STRING: "hdOutBlocks"
UCD-SNMP-MIB::ucdavis.58.3.1 = STRING: "/bin/sh /usr/local/bin/snmpdiskio hdOutBlocks"
UCD-SNMP-MIB::ucdavis.58.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.58.101.1 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.2 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.3 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.4 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.5 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.6 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.7 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.8 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.9 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.10 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.11 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.12 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.13 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.14 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.15 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.16 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.17 = STRING: "79060299264"
UCD-SNMP-MIB::ucdavis.58.101.18 = STRING: "1237504"
UCD-SNMP-MIB::ucdavis.58.101.19 = STRING: "753664"
UCD-SNMP-MIB::ucdavis.58.101.20 = STRING: "79058068480"
UCD-SNMP-MIB::ucdavis.58.101.21 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.22 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.23 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.24 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.25 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.26 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.27 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.28 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.29 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.101.30 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.58.103.1 = ""
出现以上结果表示正常:
监控端添加主机模版,设备图像:
设备模版---->添加---->