check_disk: option to ignore reserved space
commita6ff5d44895deb07c7978218eec6f7e1cbdfa94a
authorchl <dev+github@bugness.org>
Fri, 12 Oct 2012 12:43:04 +0000 (12 14:43 +0200)
committerchl <dev+github@bugness.org>
Fri, 12 Oct 2012 13:55:38 +0000 (12 15:55 +0200)
treee3f5909b729eab921b0ade3ff4022f0fef480ae4
parent831bb312a9c8a76f1e24d144952ed7c757a2d09c
check_disk: option to ignore reserved space

This commit add a runtime option to ignore the root-reserved space
when calculating perfdata.

Before / after:
./check_disk -w 2% -c 1% /home
./check_disk -w 2% -c 1% -f /home
DISK CRITICAL - free space: /home 272 MB (1% inode=83%);| /home=17551MB;18401;18589;0;18777
DISK CRITICAL - free space: /home 272 MB (1% inode=83%);| /home=17551MB;17466;17644;0;17823

Well, it doesn't really give me more space :) but the perfdata are a
little bit more coherent.

Note that there are still a rounding issue on the percent calculation
(cf calculate_percent() comments, taken from coreutils 'df' command).
272/17823 -> 1.526%

Since the warning/critical/min/max data are usually not saved in RRD DB,
you can activate the option without seeing landslides in the graphs.
plugins/check_disk.c