cacti监控Disk(磁盘)I/O

今天需要监控几个服务器的磁盘IO状态,,在网上查了下资料,,千篇一律,,搞了半天也没搞成功,于是不知道看了多少资料,,终于整合网上的资料,摸索出来了,不容易额,

需要的软件:snmpdiskio-0.9.6.zip

监控机上操作:

1.将下载的snmpdiskio-0.9.6.zip上传到cacit服务器上,解压缩,将partition.xml拷贝resource/snmp_queries下.

  
  
  
  
  1. unzip snmpdiskio-0.9.6.zip 
  2. cp snmpdiskio-0.9.6/partition.xml /var/www/html/cacti/resource/snmp_queries/  



2.在cacti服务器的web界面下cacti-->console--->Import/Export--->Import Templates
  "cacti_data_query_snmp_disk_statistics.xml
   cacti_graph_template_disk_io_bytessec.xml"

导入cacti_data_query_snmp_disk_statistics.xml和cacti_graph_template_disk_io_bytessec.xml两个模版

被监控机操作:

3.将下载的snmpdiskio-0.9.6.zip上传到被监控机上,解压缩,将目录下可执行文件snmpdisk拷贝/usr/local/bin/下

  
  
  
  
  1. unzip snmpdiskio-0.9.6.zip 
  2. cp snmpdiskio-0.9.6/snmpdiskio /usr/local/bin 



4.修改被监控机的snmpd.conf,在文件的结尾添加如下:

  
  
  
  
  1. exec .1.3.6.1.4.1.2021.54 hdNum /bin/sh /usr/local/bin/snmpdiskio hdNum 
  2. exec .1.3.6.1.4.1.2021.55 hdIndex /bin/sh /usr/local/bin/snmpdiskio hdIndex 
  3. exec .1.3.6.1.4.1.2021.56 hdDescr /bin/sh /usr/local/bin/snmpdiskio hdDescr 
  4. exec .1.3.6.1.4.1.2021.57 hdInBlocks /bin/sh /usr/local/bin/snmpdiskio hdInBlocks 
  5. exec .1.3.6.1.4.1.2021.58 hdOutBlocks /bin/sh /usr/local/bin/snmpdiskio hdOutBlocks 



重启snmp

Service snmpd restart

5.测试

  
  
  
  
  1. [root@web-Server bin]# snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.58 
  2. UCD-SNMP-MIB::ucdavis.58.1.1 = INTEGER: 1 
  3. UCD-SNMP-MIB::ucdavis.58.2.1 = STRING: "hdOutBlocks" 
  4. UCD-SNMP-MIB::ucdavis.58.3.1 = STRING: "/bin/sh /usr/local/bin/snmpdiskio hdOutBlocks" 
  5. UCD-SNMP-MIB::ucdavis.58.100.1 = INTEGER: 0 
  6. UCD-SNMP-MIB::ucdavis.58.101.1 = STRING: "0" 
  7. UCD-SNMP-MIB::ucdavis.58.101.2 = STRING: "0" 
  8. UCD-SNMP-MIB::ucdavis.58.101.3 = STRING: "0" 
  9. UCD-SNMP-MIB::ucdavis.58.101.4 = STRING: "0" 
  10. UCD-SNMP-MIB::ucdavis.58.101.5 = STRING: "0" 
  11. UCD-SNMP-MIB::ucdavis.58.101.6 = STRING: "0" 
  12. UCD-SNMP-MIB::ucdavis.58.101.7 = STRING: "0" 
  13. UCD-SNMP-MIB::ucdavis.58.101.8 = STRING: "0" 
  14. UCD-SNMP-MIB::ucdavis.58.101.9 = STRING: "0" 
  15. UCD-SNMP-MIB::ucdavis.58.101.10 = STRING: "0" 
  16. UCD-SNMP-MIB::ucdavis.58.101.11 = STRING: "0" 
  17. UCD-SNMP-MIB::ucdavis.58.101.12 = STRING: "0" 
  18. UCD-SNMP-MIB::ucdavis.58.101.13 = STRING: "0" 
  19. UCD-SNMP-MIB::ucdavis.58.101.14 = STRING: "0" 
  20. UCD-SNMP-MIB::ucdavis.58.101.15 = STRING: "0" 
  21. UCD-SNMP-MIB::ucdavis.58.101.16 = STRING: "0" 
  22. UCD-SNMP-MIB::ucdavis.58.101.17 = STRING: "6394314752" 
  23. UCD-SNMP-MIB::ucdavis.58.101.18 = STRING: "6394183680" 
  24. UCD-SNMP-MIB::ucdavis.58.101.19 = STRING: "11841024" 
  25. UCD-SNMP-MIB::ucdavis.58.101.20 = STRING: "1313280" 
  26. UCD-SNMP-MIB::ucdavis.58.101.21 = STRING: "10392576" 
  27. UCD-SNMP-MIB::ucdavis.58.101.22 = STRING: "6403810304" 
  28. UCD-SNMP-MIB::ucdavis.58.101.23 = STRING: "471040" 
  29. UCD-SNMP-MIB::ucdavis.58.101.24 = STRING: "0" 
  30. UCD-SNMP-MIB::ucdavis.58.102.1 = INTEGER: 0 
  31. UCD-SNMP-MIB::ucdavis.58.103.1 = "" 

出现如上数据,表示正常.

6.在cacti的devicesà Associated Data Queries添加SNMP – Disk Statistics

Create Graphs for this Host选择

选择你要监控的分区即可。

效果图如下:

排错

如果出现

snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.58
UCD-SNMP-MIB::ucdavis.58 = No Such Object available on this agent at this OID

先执行snmpwalk -v 2c -c public localhost,看看是否正常,如不正常,说明snmpd.conf其他配置有问题,如正常,说明刚才添加exec有问题,请检查.

Snmp.conf提前设置

  
  
  
  
  1. 40 #       sec.name  source          community 
  2. 41 com2sec notConfigUser  default       mynetsnmp 
  3. 61 #       group          context sec.model sec.level prefix read   write  notif 
  4. 62 access  notConfigGroup “”      any       noauth    exact  all    none none 
  5. 77 ##     group.name sec.model  sec.name 
  6. 78 group MyRWGroup  v1        local 
  7. 79 group MyRWGroup  v2c        local 
  8. 80 group MyRWGroup  usm        local 
  9. 86 ##           incl/excl subtree                          mask 
  10. 87 view all    included  .1                               80 

你可能感兴趣的:(监控,I/O,cacti,休闲,磁盘)