cacti监控linux和windows磁盘IO

2021-02-09 04:18

阅读:439

标签:ext   view   windows磁盘   fun   key   ice   9.1   chown   gpo   

cacti监控linux和windows磁盘IO

标签:cacti linux磁盘IO windows磁盘IO
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://charlie928.blog.51cto.com/3741218/1331780

一,环境

1
2
3
cacti版本:0.8.8b
# uname -a
Linux 10-6-8-200 2.6.32-279.22.1.el6.x86_64 #1 SMP Wed Feb 6 03:10:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

二,操作步骤

首先监控linux磁盘IO

1.下载snmpdiskio-0.9.6
2.解压后并拷贝命令
1
# cp snmpdiskio /usr/local/bin/
3.编辑partition.xml文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
vi /var/www/html/cacti/resource/snmp_queries/partition.xml
        Get SNMP Partitions/name>
        Queries a host for a list of monitorable partitions/description>
        .1.3.6.1.4.1.2021.13.15/oid_index>
        hdDescr:hdIndex/index_order>
        numeric/index_order_type>
        |chosen_order_field|/index_title_format>
        
                
                        Index/name>
                        walk/method>
                        source>value/source>
                        input/direction>
                        .1.3.6.1.4.1.2021.13.15.1.1.1/oid>
                /hdIndex>
                
                        Description/name>
                        walk/method>
                        source>value/source>
                        input/direction>
                        .1.3.6.1.4.1.2021.13.15.1.1.2/oid>
                /hdDescr>
                
                        Bytes Written/name>
                        walk/method>
                        source>value/source>
                        output/direction>
                        .1.3.6.1.4.1.2021.13.15.1.1.3/oid>
                /hdInBlocks>
                
                        Bytes Read/name>
                        walk/method>
                        source>value/source>
                        output/direction>
                        .1.3.6.1.4.1.2021.13.15.1.1.4/oid>
                /hdOutBlocks>
        /fields>
/interface>
4.修改文件属性
1
# chown apache. partition.xml
5.修改snmpd.conf配置,添加以下内容
1
2
3
4
5
6
# vi /etc/snmp/snmpd.conf
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
6.重启snmpd服务,并测试
1
2
3
4
5
6
7
8
9
10
11
12
13
# service snmpd restart
# snmpwalk -v 2c -c meihua 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
7.解压后模板导入到cacti中

技术分享图片

8.在主机中选择此模板,是否能获取数据

技术分享图片

技术分享图片

技术分享图片

 

然后是监控windows磁盘IO操作步骤:

1.windows客户端安装informant-std-16.exe

下载地址:http://www.wtcs.org/informant/download.htm

2.下载模板文件
下载地址:http://forums.cacti.net/viewtopic.php?f=12&t=29832&hilit=Cacti_SNMP_INFORMANT_STD_W32_Metrics

技术分享图片

以上模板文件导入到cacti中

 

技术分享图片

以上模板拷贝到/var/www/html/cacti/resource/snmp_queries/中

并更改权限。

3.查看windows磁盘IO是否有数据

技术分享图片

本文出自 “charlie_cen” 博客,请务必保留此出处http://charlie928.blog.51cto.com/3741218/1331780

cacti监控linux和windows磁盘IO

标签:ext   view   windows磁盘   fun   key   ice   9.1   chown   gpo   

原文地址:https://www.cnblogs.com/diyunpeng/p/8629514.html


评论


亲,登录后才可以留言!