[Nagiosplug-devel] Re: Patch for check_disk (was: post-1.3.0 features)

Karl DeBisschop karl at debisschop.net
Mon Mar 10 23:03:12 CET 2003


On Fri, 2003-03-07 at 04:17, Voon, Ton wrote:
> Can't really argue with the project administrator!
> 
> For (3), we have a patch to check_disk, written by my colleague Andy Brown,
> which we've been using here but I haven't committed to CVS because I wanted
> someone else to have a look through. The patch allows different filesystems
> to be monitored with different thresholds, eg:
> 
> ./check_disk -w 10% -c 5% -p /tmp -p /var -w 5% -c 2% -p /
> 
> This will also fulfill feature request 607885 re check_disk and quoting in
> -p. check_disk will not work any differently if only one -p is passed.
> 
> One gotcha about the way the patch is coded is that if you mix absolute
> thresholds with percentage thresholds, then it will not check quite what you
> expect:
> 
> ./check_disk -w 10% -c 5% -p /tmp -w 1000 -c 500 -p /
> 
> This will alert on / being < 10% OR 1000 free, when it looks like it should
> check < 1000 free. My "fix" to this is a -C to clear current threshold
> levels, so it should be:
> 
> ./check_disk -w 10% -c 5% -p /tmp -C -w 1000 -c 500 -p /
> 
> Is this a decent way to go? We use it here because then we can have a single
> DISK_UNIX service which checks different thresholds.

I find the -C a little distasteful. And I would like to be able to
specify both absolutes and percentages for each partition. 

I my thinking about it, I assumed I would keep the general idea, but
accommodate percents and absuloutes. For implementaion, it seemed lik
ethe easiest way to do that was to increment a partition counter with
each '-p'. So the values following would apply to that partition until
the next '-p'

By that logic, thresholds before the first '-p' would apply to all
partitions. (It's not clear to me if they should apply as defaults or
overrides, but I sort of think as defaults).

so:

./check_disk -w 10% -c 5% -p / -w 1000 -c 500 -p /usr -w 5000 -c 3000

would warn if any partition had less than 10% free. And would warn if /
had less that 1000 kB free or if /usr had less than 5000 kB free.

This seems more intuitve to me. But that could be my own bias.

And it gets rid of the -C because each partition has a chace to override
the defaults.

Comments?

BTW - my patches to use statfs instaed of parsing df should be more or
less independent of this set of patches, which makes things a little
easier.

Another item - somewhere in there, we should make it possible to
specifiy units for absolutes (B, kB, MB, GB, TB, PB should be a fairly
complete set - antbody monitoring filesystems in sizes greater than
petabytes?)

--
Karl





More information about the Devel mailing list