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

Fabian Linzberger e at lefant.net
Mon Dec 22 08:50:19 CET 2008


sorry for the radio silence. somehow i was always planning to follow
this up, but other things got in the way.

On 13:02 Tue 09 Dec     , Sebastian Harl wrote:
> 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).

really, i had little plan going on there. i just noted that an
percentage aggregate fuction would be a great thing to have when i was
configuring nagios tests and so i quickly threw something together
that compiled.

> > > +   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.

i am very happy this got merged! also thanks a lot for fixing all the rough

i have finally got around to testing it, and it works completely fine
in my setup. the only thing i had to change was the order of data
sources specified with the -d flag - but i fully agree that allowing
an arbitrary number of arguments is much better!

btw, tokkee: i was using a checkout of your pkg-collectd repository to
build my own debian package of the current git snapshot, this also
worked great!

looking forward to fresh packages after the next release (i see
you are keeping up to date in experimental ;)

i also did a talk for debienna, the local debian user group in
vienna about collectd and nagios integration. you can find the slides
at http://lefant.net/slides/collectd_and_nagios.html (click the
empty-set button for a more web-friendly version). i plan to update it
as soon as there is a release including the above stuff, so it will
work with an actual released version - maybe then it could be linked
as a tutorial from the website.

kind regards and many thanks again,


fabian linzberger -- http://lefant.net/ -- http://debienna.at/
       - do yourself a favour: use and support free software!

More information about the collectd mailing list