summaryrefslogtreecommitdiffstats
path: root/plugins/check_disk.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-09 00:41:06 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-09 00:41:06 (GMT)
commit41158497e887d2d9cd925574f349fd3e65402644 (patch)
tree947605c94adb74ae12cc83440fb22ab6f90c8b08 /plugins/check_disk.c
parent8aee8dd8b4e64a9b023334e0c36761bf75f99306 (diff)
downloadmonitoring-plugins-41158497e887d2d9cd925574f349fd3e65402644.tar.gz
more pedantic compiler warnings
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@668 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r--plugins/check_disk.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index bd06021..7974d14 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -109,7 +109,7 @@ enum
109#endif 109#endif
110 110
111int process_arguments (int, char **); 111int process_arguments (int, char **);
112void print_path (char *mypath); 112void print_path (const char *mypath);
113int validate_arguments (uintmax_t, uintmax_t, double, double, char *); 113int validate_arguments (uintmax_t, uintmax_t, double, double, char *);
114int check_disk (double usp, uintmax_t free_disk); 114int check_disk (double usp, uintmax_t free_disk);
115int walk_name_list (struct name_list *list, const char *name); 115int walk_name_list (struct name_list *list, const char *name);
@@ -216,7 +216,7 @@ main (int argc, char **argv)
216 temp_list = temp_list->name_next; 216 temp_list = temp_list->name_next;
217 } 217 }
218 218
219 die (result, "DISK %s%s\n", state_text (result), output, details); 219 die (result, "DISK %s%s%s\n", state_text (result), output, details);
220 return STATE_UNKNOWN; 220 return STATE_UNKNOWN;
221} 221}
222 222
@@ -453,11 +453,15 @@ process_arguments (int argc, char **argv)
453} 453}
454 454
455 455
456void print_path (char *mypath) 456void
457print_path (const char *mypath)
457{ 458{
458 if (mypath) 459 if (mypath == NULL)
459 printf (" for %s", mypath); 460 printf ("\n");
460 printf ("\n"); 461 else
462 printf (" for %s\n", mypath);
463
464 return;
461} 465}
462 466
463int 467int
@@ -473,14 +477,14 @@ validate_arguments (uintmax_t w, uintmax_t c, double wp, double cp, char *mypath
473 printf (_("\ 477 printf (_("\
474INPUT ERROR: C_DFP (%f) should be less than W_DFP (%.1f) and both should be between zero and 100 percent, inclusive"), 478INPUT ERROR: C_DFP (%f) should be less than W_DFP (%.1f) and both should be between zero and 100 percent, inclusive"),
475 cp, wp); 479 cp, wp);
476 print_path (path); 480 print_path (mypath);
477 return ERROR; 481 return ERROR;
478 } 482 }
479 else if ((w > 0 || c > 0) && (w == 0 || c == 0 || c > w)) { 483 else if ((w > 0 || c > 0) && (w == 0 || c == 0 || c > w)) {
480 printf (_("\ 484 printf (_("\
481INPUT ERROR: C_DF (%lu) should be less than W_DF (%lu) and both should be greater than zero"), 485INPUT ERROR: C_DF (%lu) should be less than W_DF (%lu) and both should be greater than zero"),
482 (unsigned long)c, (unsigned long)w); 486 (unsigned long)c, (unsigned long)w);
483 print_path (path); 487 print_path (mypath);
484 return ERROR; 488 return ERROR;
485 } 489 }
486 490
@@ -542,6 +546,7 @@ print_help (void)
542{ 546{
543 print_revision (progname, revision); 547 print_revision (progname, revision);
544 548
549 printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
545 printf (_(COPYRIGHT), copyright, email); 550 printf (_(COPYRIGHT), copyright, email);
546 551
547 printf (_("\ 552 printf (_("\
@@ -596,7 +601,7 @@ and generates an alert if free space is less than one of the threshold values.")
596 check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /\n\ 601 check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /\n\
597 Checks /tmp and /var at 10%,5% and / at 100MB, 50MB\n")); 602 Checks /tmp and /var at 10%,5% and / at 100MB, 50MB\n"));
598 603
599 support (); 604 printf (_(UT_SUPPORT));
600} 605}
601 606
602 607