使用 cacti 监控 windows 服务器硬盘的 I/O 状况

环境: cacti 0.8.7e

 

看了 11 页的帖子(http://forums.cacti.net/viewtopic.php?f=12&t=29832 ), 居然发现最新的 SNMP Informant 1.6 版本不支持 Windows 2008 SP2。

尝试用 Python 的 WMI 模块自己写, 然后用 cacti 调用这个 Python 脚本:

 

import wmi

if __name__ == '__main__':
    _wmi = wmi.WMI()
    disk_info = _wmi.Win32_PerfFormattedData_PerfDisk_PhysicalDisk(Name="3 D:")[0]
    M = 1024 * 1024
    print 'DiskMsPersec:%s DiskReadMsPersec:%s DiskWriteMsPersec:%s' % (
        int(disk_info.DiskBytesPersec) / M,
        int(disk_info.DiskReadBytesPersec) / M,
        int(disk_info.DiskWriteBytesPersec) / M
        )

 

# =========== 以下为悲剧的 SNMP Informant 方式, 留念 ===========

1.

在要监控的机器上启动 SNMP 服务, 安装 SNMP Informant.

可能需要重启 SNMP 服务。(参见, 第7页 的回复)

下载地址:

http://www.wtcs.org/informant/download.htm

补充:

启用 SNMP 的方法:

a. Go to add/remove program. click add/remove window components
b. Select "management & monitoring tools" Click details,select "Simple Network Management protocol"

 

2. 下载第8页最后一帖中的附件。

http://forums.cacti.net/viewtopic.php?f=12&t=29832&start=105

 

3.

Copy the snmp_informant_*.xml files to your <cacti_path>/resource/snmp_queries directory on your cacti box.
Import the cacti_data_query_w32_*.xml files into the cacti web interface.

 

参考:

第7页的第一个帖子,作者是

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值