[collectd] PATCH: add support for percentage computation to collectd-nagios

Sebastian Harl sh at tokkee.org
Tue Dec 9 13:02:45 CET 2008


Hi Fabian,

On Wed, Nov 05, 2008 at 11:16:17AM +0100, Sebastian Harl wrote:
> 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.

> 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
> value_specs).

> > +   if (isnan (values[0]) || isnan (values[1]))
> > +       return (RET_WARNING);
> 
> I'm not sure if it would make sense to use zeros in that case - what do
> you think?
> 
> Also, it would be nice if your patch would update the documentation as
> well.

I've now included your patch and all of those changes in the sh/next
branch on git://git.tokkee.org/collectd.git. Further comments and feed-
back would be appreciated.

Also, I found out that the values passed to the consolidation function
implementations were not sorted according to the DSs specified on the
command line (which did not matter so far but is essential for the
"percentage" consolidation). This has been fixed as well.

Cheers,
Sebastian

-- 
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
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20081209/a29510d8/attachment.pgp 


More information about the collectd mailing list