cacti+thold插件实现监控硬盘分区使用百分率情况

老大说要监控机器的硬盘分区的使用情况
大于一定比率要报警
知道cacti + thold插件可以做这个
于是就装plug architecture、settings(plugin)
(这两个是thold插件所依赖的,所以要先装)
然后再装thold插件
这都简单
关键是算使用百分比的CDEFs
准确算法应该是:CURRENT_DATA_SOURCE * 100 / hdd_total
但现在的问题是这里不能得到hdd_total的值
于是看了看thold3.8的代码
发现其实在plugin thold 3.8的版本里
已经取好了data source item “hdd_total”的值为special data source:VALUE_OF_HDD_TOTAL
所以只要在定义CDEFs的时候,把最后的字串等于

CURRENT_DATA_SOURCE,VALUE_OF_HDD_TOTAL,/,100,*

于是具体方法就简单了
直接用custom string即可
或者更王道一点的办法是改global_arrays.php
在$custom_data_source_types加上对”VALUE_OF_HDD_TOTAL”的描述
这样设CDEFs的时候就可以在下拉列表框里选择了

Discussion Area - Leave a Comment




*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word