[collectd] PATCH: add support for percentage computation to collectd-nagios
sh at tokkee.org
Wed Nov 5 11:16:17 CET 2008
On Tue, Nov 04, 2008 at 10:58:57PM +0100, Fabian Linzberger wrote:
> the attached patch allows to compute the percentage of the second
> checked value against the sum of the first and the second.
Thanks for your patch!
Is there any reason why you've limited the sum to two values? I'd change
that to allow an arbitrary number of data sources and then calculate the
percentage using the _first_ value (that makes more sense imho) and the
sum of all values. This would allow to e.g. calculate the percentage of
CPU usage as well (however, this would also require support for multiple
> sudo collectd-nagios -s /var/run/collectd-unixsock -H localhost -n df/df-root
> -d used -d free -g percentage -w 20: -c 10:
... would then become:
collectd-nagios ... -d free -d used -g percentage ...
> + if (isnan (values) || isnan (values))
> + return (RET_WARNING);
I'm not sure if it would make sense to use zeros in that case - what do
Also, it would be nice if your patch would update the documentation as
well. Besides that your patch looks fine to me and I like that idea :-)
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/
Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20081105/fc986777/attachment.pgp
More information about the collectd