summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Kent <mattkent@users.sourceforge.net>2004-11-23 05:49:11 (GMT)
committerMatthew Kent <mattkent@users.sourceforge.net>2004-11-23 05:49:11 (GMT)
commit189004f85a8d66cdbc66f77c73827b7e725268c9 (patch)
tree7089cfc693dec8b8f2f2becb9c2d4ff913ef2aed
parentcaf9ce72ff6e708dadd85ee1677439f41694f287 (diff)
downloadmonitoring-plugins-189004f85a8d66cdbc66f77c73827b7e725268c9.tar.gz
Fix integer warning and critical options. Take values from current unit instead of always KB.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@925 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_disk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 7841c14..8759619 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -112,7 +112,7 @@ enum
112int process_arguments (int, char **); 112int process_arguments (int, char **);
113void print_path (const char *mypath); 113void print_path (const char *mypath);
114int validate_arguments (uintmax_t, uintmax_t, double, double, char *); 114int validate_arguments (uintmax_t, uintmax_t, double, double, char *);
115int check_disk (double usp, uintmax_t free_disk); 115int check_disk (double usp, double free_disk);
116int walk_name_list (struct name_list *list, const char *name); 116int walk_name_list (struct name_list *list, const char *name);
117void print_help (void); 117void print_help (void);
118void print_usage (void); 118void print_usage (void);
@@ -187,7 +187,7 @@ main (int argc, char **argv)
187 187
188 if (fsp.fsu_blocks && strcmp ("none", me->me_mountdir)) { 188 if (fsp.fsu_blocks && strcmp ("none", me->me_mountdir)) {
189 usp = (double)(fsp.fsu_blocks - fsp.fsu_bavail) * 100 / fsp.fsu_blocks; 189 usp = (double)(fsp.fsu_blocks - fsp.fsu_bavail) * 100 / fsp.fsu_blocks;
190 disk_result = check_disk (usp, fsp.fsu_bavail * fsp.fsu_blocksize); 190 disk_result = check_disk (usp, (double)(fsp.fsu_bavail * fsp.fsu_blocksize / mult));
191 result = max_state (disk_result, result); 191 result = max_state (disk_result, result);
192 psize = fsp.fsu_blocks*fsp.fsu_blocksize/mult; 192 psize = fsp.fsu_blocks*fsp.fsu_blocksize/mult;
193 asprintf (&perf, "%s %s", perf, 193 asprintf (&perf, "%s %s", perf,
@@ -525,7 +525,7 @@ INPUT ERROR: C_DF (%lu) should be less than W_DF (%lu) and both should be greate
525 525
526 526
527int 527int
528check_disk (double usp, uintmax_t free_disk) 528check_disk (double usp, double free_disk)
529{ 529{
530 int result = STATE_UNKNOWN; 530 int result = STATE_UNKNOWN;
531 /* check the percent used space against thresholds */ 531 /* check the percent used space against thresholds */
@@ -585,11 +585,11 @@ and generates an alert if free space is less than one of the threshold values.")
585 585
586 printf (_("\ 586 printf (_("\
587 -w, --warning=INTEGER\n\ 587 -w, --warning=INTEGER\n\
588 Exit with WARNING status if less than INTEGER kilobytes of disk are free\n\ 588 Exit with WARNING status if less than INTEGER --units of disk are free\n\
589 -w, --warning=PERCENT%%\n\ 589 -w, --warning=PERCENT%%\n\
590 Exit with WARNING status if less than PERCENT of disk space is free\n\ 590 Exit with WARNING status if less than PERCENT of disk space is free\n\
591 -c, --critical=INTEGER\n\ 591 -c, --critical=INTEGER\n\
592 Exit with CRITICAL status if less than INTEGER kilobytes of disk are free\n\ 592 Exit with CRITICAL status if less than INTEGER --units of disk are free\n\
593 -c, --critical=PERCENT%%\n\ 593 -c, --critical=PERCENT%%\n\
594 Exit with CRITCAL status if less than PERCENT of disk space is free\n\ 594 Exit with CRITCAL status if less than PERCENT of disk space is free\n\
595 -C, --clear\n\ 595 -C, --clear\n\