日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

cacti添加I/O监控

發布時間:2025/3/8 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 cacti添加I/O监控 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首先下載snmpdiskio-0.9.6.zip,文件不好找,我已經放在本文章的附件里面。

解壓snmpdiskio-0.9.6.zip復制partition.xml到cacti/resource/snmp_queries/下面

[root@test]#?cp partition.xml /home/wwwroot/default/cacti/resource/snmp_queries/

分別導入模板文件:

cacti_data_query_snmp_disk_statistics.xml

cacti_graph_template_disk_io_bytessec.xml

?

Cacti has imported the following items:

GPRINT Preset

[success]?Normal?[update]

Data Input Method

[success]?Get SNMP Data (Indexed)?[update]

Data Template

[success]?Disk - I/O?[update]

Graph Template

[success]?Disk - I/O (bytes/sec)?[update]

在被監控端的/etc/snmp/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

安裝snmpdiskio到usr/local/bin下面并且給予執行權限

[root@node7]# install -m 0755 -o root -g root -p -v snmpdiskio /usr/local/bin/
`snmpdiskio’ -> `/usr/local/bin/snmpdiskio’

重啟snmpd服務

[root@node7 bin]# service snmpd restart
Stopping snmpd:??????????????????????????????????????????? [? OK? ]
Starting snmpd:??????????????????????????????????????????? [? OK? ]

查看日志

[root@node7 log]# pwd
/var/log

[root@node7 log]# cat messages

如果報錯:

Dec 18 14:54:39 node7 snmpd[6887]: /etc/snmp/snmpd.conf: line 462: Error: ERROR: This output format has been deprecated - Please use the ’extend’ directive instead
Dec 18 14:54:39 node7 snmpd[6887]: /etc/snmp/snmpd.conf: line 463: Error: ERROR: This output format has been deprecated - Please use the ’extend’ directive instead
Dec 18 14:54:39 node7 snmpd[6887]: /etc/snmp/snmpd.conf: line 464: Error: ERROR: This output format has been deprecated - Please use the ’extend’ directive instead
Dec 18 14:54:39 node7 snmpd[6887]: /etc/snmp/snmpd.conf: line 465: Error: ERROR: This output format has been deprecated - Please use the ’extend’ directive instead
Dec 18 14:54:39 node7 snmpd[6887]: /etc/snmp/snmpd.conf: line 466: Error: ERROR: This output format has been deprecated - Please use the ’extend’ directive instead

因為snmp V5版本不支持exec所以要把exec改為extend

extend .1.3.6.1.4.1.2021.54 hdNum /bin/sh /usr/local/bin/snmpdiskio hdNum
extend .1.3.6.1.4.1.2021.55 hdIndex /bin/sh /usr/local/bin/snmpdiskio hdIndex
extend .1.3.6.1.4.1.2021.56 hdDescr /bin/sh /usr/local/bin/snmpdiskio hdDescr
extend .1.3.6.1.4.1.2021.57 hdInBlocks /bin/sh /usr/local/bin/snmpdiskio hdInBlocks
extend .1.3.6.1.4.1.2021.58 hdOutBlocks /bin/sh /usr/local/bin/snmpdiskio hdOutBlocks

測試是否出數據:

[root@node7 log]# snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.58
UCD-SNMP-MIB::ucdavis.58.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.58.2.1.2.11.104.100.79.117.116.66.108.111.99.107.115 = STRING: "/bin/sh"
UCD-SNMP-MIB::ucdavis.58.2.1.3.11.104.100.79.117.116.66.108.111.99.107.115 = STRING: "/usr/local/bin/snmpdiskio hdOutBlocks"
UCD-SNMP-MIB::ucdavis.58.2.1.4.11.104.100.79.117.116.66.108.111.99.107.115 = ""
UCD-SNMP-MIB::ucdavis.58.2.1.5.11.104.100.79.117.116.66.108.111.99.107.115 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.58.2.1.6.11.104.100.79.117.116.66.108.111.99.107.115 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.58.2.1.7.11.104.100.79.117.116.66.108.111.99.107.115 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.58.2.1.20.11.104.100.79.117.116.66.108.111.99.107.115 = INTEGER: 4
UCD-SNMP-MIB::ucdavis.58.2.1.21.11.104.100.79.117.116.66.108.111.99.107.115 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.58.3.1.1.11.104.100.79.117.116.66.108.111.99.107.115 = STRING: "0"
UCD-SNMP-MIB::ucdavis.58.3.1.2.11.104.100.79.117.116.66.108.111.99.107.115 = STRING: "0

完全沒有問題,下面就可以在cacti上面添加監控:

?

  • Created graph: 10.1.60.155 - Disk I/O (bytes/sec) - sda


  • Created graph: 10.1.60.155 - Disk I/O (bytes/sec) - sda1


  • Created graph: 10.1.60.155 - Disk I/O (bytes/sec) - sda2

?

?

?snmpdiskio-0.9.6.rar


?


轉載于:https://blog.51cto.com/fccwcom/1577343

總結

以上是生活随笔為你收集整理的cacti添加I/O监控的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。