From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/56028-check_disk.patch | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 web/attachments/56028-check_disk.patch (limited to 'web/attachments/56028-check_disk.patch') diff --git a/web/attachments/56028-check_disk.patch b/web/attachments/56028-check_disk.patch new file mode 100644 index 0000000..a29ebea --- /dev/null +++ b/web/attachments/56028-check_disk.patch @@ -0,0 +1,53 @@ +Index: check_disk.c +=================================================================== +RCS file: /usr/local/cvs/root/nagios-plugins/plugins/check_disk.c,v +retrieving revision 1.1 +diff -u -u -r1.1 check_disk.c +--- check_disk.c 3 Jul 2003 23:27:44 -0000 1.1 ++++ check_disk.c 17 Jul 2003 02:29:24 -0000 +@@ -307,13 +310,18 @@ + { + int result = STATE_UNKNOWN; + /* check the percent used space against thresholds */ +- if (usp >= 0 && usp >= (100.0 - c_dfp)) ++ /* Need to check the percent && the free space against thresholds */ ++ if (c_dfp >= 0 && c_df >= 0 && usp >= 0 && usp >= (100.0 - c_dfp) && c_df >= 0 && free_disk <= c_df) + result = STATE_CRITICAL; +- else if (c_df >= 0 && free_disk <= c_df) ++ else if (c_df < 0 && usp >= 0 && usp >= (100.0 - c_dfp)) + result = STATE_CRITICAL; +- else if (usp >= 0 && usp >= (100.0 - w_dfp)) ++ else if (c_dfp < 0 && free_disk <= c_df) ++ result = STATE_CRITICAL; ++ else if (w_dfp >= 0 && w_df >= 0 && usp >= 0 && usp >= (100.0 - w_dfp) && w_df >= 0 && free_disk <= w_df) ++ result = STATE_WARNING; ++ else if (w_df < 0 && usp >= 0 && usp >= (100.0 - w_dfp)) + result = STATE_WARNING; +- else if (w_df >= 0 && free_disk <= w_df) ++ else if (w_dfp < 0 && free_disk <= w_df) + result = STATE_WARNING; + else if (usp >= 0.0) + result = STATE_OK; +@@ -328,7 +336,9 @@ + ("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n" + "This plugin will check the percent of used disk space on a mounted\n" + "file system and generate an alert if percentage is above one of the\n" +- "threshold values.\n\n"); ++ "threshold values. You can also pass a percent and size thresholds\n" ++ "separated by a : or , and both values will have to be met before a\n" ++ "failure occurs\n\n"); + print_usage (); + printf + ("\nOptions:\n" +@@ -352,7 +362,10 @@ + " Show details for command-line debugging (do not use with nagios server)\n" + " -h, --help\n" + " Print detailed help screen\n" +- " -V, --version\n" " Print version information\n\n"); ++ " -V, --version\n" " Print version information\n" ++ "Examples:\n" ++ "./check_disk -w10%%:100000 -c5%%:50000 -p /\n" ++ "Will require that the / partition have less than 10%% free space AND less than 100mb free\n\n"); + support (); + } + -- cgit v1.2.3-74-g34f1