[Nagios-devel] Bug + patch: check_disk.c
Posted: Fri Nov 07, 2003 9:47 am
Hello!
I recently have discovered problem with check_disk module.
It always shows "OK" even if your free space less than critical.
Example:
# df -k /var
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/vinum/var 33646567 28453984 2500858 92% /var
# ./check_disk -w 20 -c 10 /var
DISK OK [2500849 kB (8%) free on /dev/vinum/var]
I did some research and here is the patch.
----------------------------------------------------------------------------
---------------------------------------
--- check_disk.c Thu Jul 10 23:03:47 2003
+++ /home/svd/check_disk.c Fri Nov 7 09:46:19 2003
@@ -321,13 +321,13 @@ check_disk (int usp, float free_disk)
{
int result = STATE_UNKNOWN;
/* check the percent used space against thresholds */
- if (usp >= 0 && usp >= (100.0 - c_dfp))
+ if (usp >= 0 && usp >= (100.0 - c_df))
result = STATE_CRITICAL;
- else if (c_df >= 0 && free_disk = 0 && free_disk = 0 && usp >= (100.0 - w_dfp))
+ else if (usp >= 0 && usp >= (100.0 - w_df))
result = STATE_WARNING;
- else if (w_df >= 0 && free_disk = 0 && free_disk = 0.0)
result = STATE_OK;
----------------------------------------------------------------------------
---------------------------------------
--
Sergey Dorokhov
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
I recently have discovered problem with check_disk module.
It always shows "OK" even if your free space less than critical.
Example:
# df -k /var
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/vinum/var 33646567 28453984 2500858 92% /var
# ./check_disk -w 20 -c 10 /var
DISK OK [2500849 kB (8%) free on /dev/vinum/var]
I did some research and here is the patch.
----------------------------------------------------------------------------
---------------------------------------
--- check_disk.c Thu Jul 10 23:03:47 2003
+++ /home/svd/check_disk.c Fri Nov 7 09:46:19 2003
@@ -321,13 +321,13 @@ check_disk (int usp, float free_disk)
{
int result = STATE_UNKNOWN;
/* check the percent used space against thresholds */
- if (usp >= 0 && usp >= (100.0 - c_dfp))
+ if (usp >= 0 && usp >= (100.0 - c_df))
result = STATE_CRITICAL;
- else if (c_df >= 0 && free_disk = 0 && free_disk = 0 && usp >= (100.0 - w_dfp))
+ else if (usp >= 0 && usp >= (100.0 - w_df))
result = STATE_WARNING;
- else if (w_df >= 0 && free_disk = 0 && free_disk = 0.0)
result = STATE_OK;
----------------------------------------------------------------------------
---------------------------------------
--
Sergey Dorokhov
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]