diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index c823925011cd4cffa089357be374da46dd8de930..669a1cd6b1fd62d9488b887a3e748f08a9288da1 100644 (file)
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
*****************************************************************************/
const char *progname = "check_disk";
const char *program_name = "check_disk"; // Required for coreutils libs
const char *revision = "$Revision$";
-const char *copyright = "1999-2003";
+const char *copyright = "1999-2004";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
static struct mount_entry *mount_list;
-\f
+
int
main (int argc, char **argv)
{
mount_list = read_filesystem_list (0);
- if (process_arguments (argc, argv) != OK)
- usage (_("Could not parse arguments\n"));
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
for (me = mount_list; me; me = me->me_next) {
-\f
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
break;
}
else {
- usage (_("Warning threshold must be integer or percentage!\n"));
+ usage4 (_("Warning threshold must be integer or percentage!"));
}
case 'c': /* critical threshold */
if (is_intnonneg (optarg)) {
break;
}
else {
- usage (_("Critical threshold must be integer or percentage!\n"));
+ usage4 (_("Critical threshold must be integer or percentage!"));
}
case 'u':
if (units)
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage (_("Unknow argument\n"));
- break;
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
}
+
void
print_path (const char *mypath)
{
return;
}
+
+
int
validate_arguments (uintmax_t w, uintmax_t c, double wp, double cp, char *mypath)
{
@@ -523,7 +528,6 @@ INPUT ERROR: C_DF (%lu) should be less than W_DF (%lu) and both should be greate
-\f
int
check_disk (double usp, double free_disk)
{
-
-
void
print_help (void)
{
printf (_("\
This plugin checks the amount of used disk space on a mounted file system\n\
-and generates an alert if free space is less than one of the threshold values."));
+and generates an alert if free space is less than one of the threshold values.\n\n"));
print_usage ();
@@ -631,14 +633,10 @@ and generates an alert if free space is less than one of the threshold values.")
-
void
print_usage (void)
{
- printf (_("\
+ printf ("\
Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e]\n\
- [-v] [-q]\n\
- %s (-h|--help)\n\
- %s (-V|--version)\n"),
- progname, progname, progname);
+ [-v] [-q]\n", progname);
}