ubuntu 12.04 监控磁盘I/O

软件版本 snmpdiskio 0.9.6

监控端

1、解压软件包

把解压之后文件夹下的 partition.xml上传到监控服务器cacti安装目录下的

/resource/snmp_queries/目录下,并修改权限

chown nagios:nagios partition.xml

2、分别导入2个模板:

cacti_graph_template_disk_io_bytessec.xml

cacti_data_query_snmp_disk_statistics.xml

3、修改partition.xml文件为以下

        Get SNMP Partitions

        Queries a host for a list of monitorable partitions

        .1.3.6.1.4.1.2021.55.4

        .1.3.6.1.4.1.2021.54.4

        hdDescr:hdIndex

        numeric

        |chosen_order_field|

 

       

               

                        Index

                        walk

                        value

                        input

                        .1.3.6.1.4.1.2021.55.4

               

               

                        Description

                        walk

                        value

                        input

                        .1.3.6.1.4.1.2021.56.4

               

               

                        Bytes Written

                        walk

                        value

                        output

                        .1.3.6.1.4.1.2021.57.4.1.2.10.104.100.73.110.66.108.111.99.107.115

               

                

                        Bytes Read

                        walk

                        value

                        output

                        .1.3.6.1.4.1.2021.58.4.1.2.11.104.100.79.117.116.66.108.111.99.107.115

               

       

被监控端

1、  将解压包中得snmpdiskio 上传到被监控服务器的/usr/local/bin/目录下 并修改相应的权限  chmod 755 snmpdiskio

2、  修改snmp配置文件 /etc/snmp/snmpd.conf  在文件末尾添加以下行

extend .1.3.6.1.4.1.2021.54 hdNum /bin/bash /usr/local/bin/snmpdiskio hdNum

extend .1.3.6.1.4.1.2021.55 hdIndex /bin/bash /usr/local/bin/snmpdiskio hdIndex

extend .1.3.6.1.4.1.2021.56 hdDescr /bin/bash /usr/local/bin/snmpdiskio hdDescr

extend .1.3.6.1.4.1.2021.57 hdInBlocks /bin/bash /usr/local/bin/snmpdiskio hdInBlocks

extend .1.3.6.1.4.1.2021.58 hdOutBlocks /bin/bash /usr/local/bin/snmpdiskio hdOutBlocks

3、  重启 snmpd服务器

/etc/init.d/snmpd     restart

4、  被监控端自己测试 (有以下返回值为正常)

#snmpwalk -v 2c -c public localhost .1.3.6.1.4.1.2021.54

 

iso.3.6.1.4.1.2021.54.1.0 = INTEGER: 1

iso.3.6.1.4.1.2021.54.2.1.2.5.104.100.78.117.109 = STRING: "/bin/bash"

iso.3.6.1.4.1.2021.54.2.1.3.5.104.100.78.117.109 = STRING: "/usr/local/bin/snmpdiskio hdNum"

iso.3.6.1.4.1.2021.54.2.1.4.5.104.100.78.117.109 = ""

iso.3.6.1.4.1.2021.54.2.1.5.5.104.100.78.117.109 = INTEGER: 5

iso.3.6.1.4.1.2021.54.2.1.6.5.104.100.78.117.109 = INTEGER: 1

iso.3.6.1.4.1.2021.54.2.1.7.5.104.100.78.117.109 = INTEGER: 1

iso.3.6.1.4.1.2021.54.2.1.20.5.104.100.78.117.109 = INTEGER: 4

iso.3.6.1.4.1.2021.54.2.1.21.5.104.100.78.117.109 = INTEGER: 1

iso.3.6.1.4.1.2021.54.3.1.1.5.104.100.78.117.109 = STRING: "29"

iso.3.6.1.4.1.2021.54.3.1.2.5.104.100.78.117.109 = STRING: "29"

iso.3.6.1.4.1.2021.54.3.1.3.5.104.100.78.117.109 = INTEGER: 1

iso.3.6.1.4.1.2021.54.3.1.4.5.104.100.78.117.109 = INTEGER: 0

iso.3.6.1.4.1.2021.54.4.1.2.5.104.100.78.117.109.1 = STRING: "29"

5、  在监控端进行测试 (有以下返回值为正常)

#snmpwalk -v 2c -c public  172.16.1.15  .1.3.6.1.4.1.2021.54

 

iso.3.6.1.4.1.2021.54.1.0 = INTEGER: 1

iso.3.6.1.4.1.2021.54.2.1.2.5.104.100.78.117.109 = STRING: "/bin/bash"

iso.3.6.1.4.1.2021.54.2.1.3.5.104.100.78.117.109 = STRING: "/usr/local/bin/snmpdiskio hdNum"

iso.3.6.1.4.1.2021.54.2.1.4.5.104.100.78.117.109 = ""

iso.3.6.1.4.1.2021.54.2.1.5.5.104.100.78.117.109 = INTEGER: 5

iso.3.6.1.4.1.2021.54.2.1.6.5.104.100.78.117.109 = INTEGER: 1

iso.3.6.1.4.1.2021.54.2.1.7.5.104.100.78.117.109 = INTEGER: 1

iso.3.6.1.4.1.2021.54.2.1.20.5.104.100.78.117.109 = INTEGER: 4

iso.3.6.1.4.1.2021.54.2.1.21.5.104.100.78.117.109 = INTEGER: 1

iso.3.6.1.4.1.2021.54.3.1.1.5.104.100.78.117.109 = STRING: "29"

iso.3.6.1.4.1.2021.54.3.1.2.5.104.100.78.117.109 = STRING: "29"

iso.3.6.1.4.1.2021.54.3.1.3.5.104.100.78.117.109 = INTEGER: 1

iso.3.6.1.4.1.2021.54.3.1.4.5.104.100.78.117.109 = INTEGER: 0

iso.3.6.1.4.1.2021.54.4.1.2.5.104.100.78.117.109.1 = STRING: "29"

6、  在监控端进行添加I/O监控