Page 1 of 1

Re: [Nagios-devel] Bug + patch: check_disk.c

Posted: Fri Nov 07, 2003 10:23 am
by Guest
Try looking at the help for check_disk --- number without percentage means
kilobytes and not percentage....

-sg


On Fri, 7 Nov 2003, Sergey Dorokhov wrote:

> 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 + else if (c_df >= 0 && free_disk result = STATE_CRITICAL;
> - else if (usp >= 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 + else if (w_df >= 0 && free_disk result = STATE_WARNING;
> else if (usp >= 0.0)
> result = STATE_OK;
>
> ----------------------------------------------------------------------------
> ---------------------------------------
>
> --
> Sergey Dorokhov
>
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: ApacheCon 2003,
> 16-19 November in Las Vegas. Learn firsthand the latest
> developments in Apache, PHP, Perl, XML, Java, MySQL,
> WebDAV, and more! http://www.apachecon.com/
> _______________________________________________
> Nagios-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/lis ... gios-devel
>

--







This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]