aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r--plugins/check_disk.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 4d6156f7..47dc0adc 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -91,9 +91,12 @@ static int stat_remote_fs = 0;
/* Linked list of filesystem types to omit.
If the list is empty, don't exclude any types. */
-
static struct name_list *fs_exclude_list;
+/* Linked list of filesystem types to check.
+ If the list is empty, include all types. */
+static struct name_list *fs_include_list;
+
static struct name_list *dp_exclude_list;
static struct parameter_list *path_select_list = NULL;
@@ -256,6 +259,9 @@ main (int argc, char **argv)
(np_find_name (dp_exclude_list, me->me_devname) ||
np_find_name (dp_exclude_list, me->me_mountdir))) {
continue;
+ /* Skip not included fstypes */
+ } else if (fs_include_list && !np_find_name (fs_include_list, me->me_type)) {
+ continue;
}
stat_path(path);
@@ -420,6 +426,7 @@ process_arguments (int argc, char **argv)
{"partition", required_argument, 0, 'p'},
{"exclude_device", required_argument, 0, 'x'},
{"exclude-type", required_argument, 0, 'X'},
+ {"include-type", required_argument, 0, 'N'},
{"group", required_argument, 0, 'g'},
{"eregi-path", required_argument, 0, 'R'},
{"eregi-partition", required_argument, 0, 'R'},
@@ -454,7 +461,7 @@ process_arguments (int argc, char **argv)
strcpy (argv[c], "-t");
while (1) {
- c = getopt_long (argc, argv, "+?VqhvefCt:c:w:K:W:u:p:x:X:mklLg:R:r:i:I:MEA", longopts, &option);
+ c = getopt_long (argc, argv, "+?VqhvefCt:c:w:K:W:u:p:x:X:N:mklLg:R:r:i:I:MEA", longopts, &option);
if (c == -1 || c == EOF)
break;
@@ -593,6 +600,9 @@ process_arguments (int argc, char **argv)
case 'X': /* exclude file system type */
np_add_name(&fs_exclude_list, optarg);
break;
+ case 'N': /* include file system type */
+ np_add_name(&fs_include_list, optarg);
+ break;
case 'v': /* verbose */
verbose++;
break;
@@ -907,6 +917,8 @@ print_help (void)
printf (UT_VERBOSE);
printf (" %s\n", "-X, --exclude-type=TYPE");
printf (" %s\n", _("Ignore all filesystems of indicated type (may be repeated)"));
+ printf (" %s\n", "-N, --include-type=TYPE");
+ printf (" %s\n", _("Check only filesystems of indicated type (may be repeated)"));
printf ("\n");
printf ("%s\n", _("Examples:"));
@@ -929,7 +941,7 @@ print_usage (void)
printf ("%s\n", _("Usage:"));
printf (" %s -w limit -c limit [-W limit] [-K limit] {-p path | -x device}\n", progname);
printf ("[-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]\n");
- printf ("[-t timeout] [-u unit] [-v] [-X type]\n");
+ printf ("[-t timeout] [-u unit] [-v] [-X type] [-N type]\n");
}
void