[collectd] Patch: Swap usage percentage

Scott Severtson ssevertson at digitalmeasures.com
Wed Jun 6 21:16:19 CEST 2012


All,

 From a threshold/notification perspective, we find it useful to set 
values based on percentages. Specifically, we'd like to set thresholds 
on the percent of swap space in use, rather than on absolute kilobyte 
values.

I've attached a patch that adds a "percent" metric to swap.c for all 
currently enabled code paths. I've only verified functionality on 
Solaris 10, but the changes were pretty straight forward for all 
supported data sources. I did attempt to make my changes in the style of 
the surrounding function

Ironically, I didn't touch the disabled Solaris 10 libkstat code, as the 
comments indicated it belonged in vmem.c in the long term...

Please let me know if anyone tries out this patch and experiences 
compilation or operational problems.

Thanks,
--Scott Severtson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swap-percent-used.patch
Type: text/x-patch
Size: 3655 bytes
Desc: not available
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20120606/5c942234/attachment.bin>


More information about the collectd mailing list