summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee748cd)
raw | patch | inline | side by side (parent: ee748cd)
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Sat, 8 Dec 2007 16:34:05 +0000 (16:34 +0000) | ||
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Sat, 8 Dec 2007 16:34:05 +0000 (16:34 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1848 f882894a-f735-0410-b71e-b25c423dba1c
NEWS | patch | blob | history | |
plugins/check_disk.c | patch | blob | history |
index f2de1538dbb231912d56bdf966302f4341a1f0e3..6473ec892fd3e7f8d62ef0cdfe763add4f9ba672 100644 (file)
--- a/NEWS
+++ b/NEWS
Merge two new checks that deprecates check_ntp: check_ntp_peer and check_ntp_time.
You should read the --help output so see which one is suitable for you. check_ntp_peer
implement stratum thresholds support (feature request #1703823).
+ Fix check_disk reporting OK if disk usage grows over 100% (bug #1348746).
+ The problem happens to be in Gnulib but a workaround have been implemented in check_disk.c
1.4.10 28th September 2007
Fix check_http buffer overflow vulnerability when following HTTP redirects
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 4c6886e46f59bd229fc2b4f2ada633d5a0a10bc8..b8bbdbda3acf04568194284cb4fe03605c1f4167 100644 (file)
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
if (fsp.fsu_blocks && strcmp ("none", me->me_mountdir)) {
total = fsp.fsu_blocks;
- available = fsp.fsu_bavail;
+ /* 2007-12-08 - Workaround for Gnulib reporting insanely high available
+ * space on BSD (the actual value should be negative but fsp.fsu_bavail
+ * is unsigned) */
+ available = fsp.fsu_bavail > fsp.fsu_bfree ? 0 : fsp.fsu_bavail;
available_to_root = fsp.fsu_bfree;
used = total - available_to_root;
+ if (verbose >= 3)
+ printf ("For %s, total=%llu, available=%llu, available_to_root=%llu, used=%llu, fsp.fsu_files=%llu, fsp.fsu_ffree=%llu\n",
+ me->me_mountdir, total, available, available_to_root, used, fsp.fsu_files, fsp.fsu_ffree);
+
dused_pct = calculate_percent( used, used + available ); /* used + available can never be > uintmax */
dfree_pct = 100 - dused_pct;