diff options
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r-- | plugins/check_disk.c | 18 |
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; | |||
91 | 91 | ||
92 | /* Linked list of filesystem types to omit. | 92 | /* Linked list of filesystem types to omit. |
93 | If the list is empty, don't exclude any types. */ | 93 | If the list is empty, don't exclude any types. */ |
94 | |||
95 | static struct name_list *fs_exclude_list; | 94 | static struct name_list *fs_exclude_list; |
96 | 95 | ||
96 | /* Linked list of filesystem types to check. | ||
97 | If the list is empty, include all types. */ | ||
98 | static struct name_list *fs_include_list; | ||
99 | |||
97 | static struct name_list *dp_exclude_list; | 100 | static struct name_list *dp_exclude_list; |
98 | 101 | ||
99 | static struct parameter_list *path_select_list = NULL; | 102 | static struct parameter_list *path_select_list = NULL; |
@@ -256,6 +259,9 @@ main (int argc, char **argv) | |||
256 | (np_find_name (dp_exclude_list, me->me_devname) || | 259 | (np_find_name (dp_exclude_list, me->me_devname) || |
257 | np_find_name (dp_exclude_list, me->me_mountdir))) { | 260 | np_find_name (dp_exclude_list, me->me_mountdir))) { |
258 | continue; | 261 | continue; |
262 | /* Skip not included fstypes */ | ||
263 | } else if (fs_include_list && !np_find_name (fs_include_list, me->me_type)) { | ||
264 | continue; | ||
259 | } | 265 | } |
260 | 266 | ||
261 | stat_path(path); | 267 | stat_path(path); |
@@ -420,6 +426,7 @@ process_arguments (int argc, char **argv) | |||
420 | {"partition", required_argument, 0, 'p'}, | 426 | {"partition", required_argument, 0, 'p'}, |
421 | {"exclude_device", required_argument, 0, 'x'}, | 427 | {"exclude_device", required_argument, 0, 'x'}, |
422 | {"exclude-type", required_argument, 0, 'X'}, | 428 | {"exclude-type", required_argument, 0, 'X'}, |
429 | {"include-type", required_argument, 0, 'N'}, | ||
423 | {"group", required_argument, 0, 'g'}, | 430 | {"group", required_argument, 0, 'g'}, |
424 | {"eregi-path", required_argument, 0, 'R'}, | 431 | {"eregi-path", required_argument, 0, 'R'}, |
425 | {"eregi-partition", required_argument, 0, 'R'}, | 432 | {"eregi-partition", required_argument, 0, 'R'}, |
@@ -454,7 +461,7 @@ process_arguments (int argc, char **argv) | |||
454 | strcpy (argv[c], "-t"); | 461 | strcpy (argv[c], "-t"); |
455 | 462 | ||
456 | while (1) { | 463 | while (1) { |
457 | c = getopt_long (argc, argv, "+?VqhvefCt:c:w:K:W:u:p:x:X:mklLg:R:r:i:I:MEA", longopts, &option); | 464 | c = getopt_long (argc, argv, "+?VqhvefCt:c:w:K:W:u:p:x:X:N:mklLg:R:r:i:I:MEA", longopts, &option); |
458 | 465 | ||
459 | if (c == -1 || c == EOF) | 466 | if (c == -1 || c == EOF) |
460 | break; | 467 | break; |
@@ -593,6 +600,9 @@ process_arguments (int argc, char **argv) | |||
593 | case 'X': /* exclude file system type */ | 600 | case 'X': /* exclude file system type */ |
594 | np_add_name(&fs_exclude_list, optarg); | 601 | np_add_name(&fs_exclude_list, optarg); |
595 | break; | 602 | break; |
603 | case 'N': /* include file system type */ | ||
604 | np_add_name(&fs_include_list, optarg); | ||
605 | break; | ||
596 | case 'v': /* verbose */ | 606 | case 'v': /* verbose */ |
597 | verbose++; | 607 | verbose++; |
598 | break; | 608 | break; |
@@ -907,6 +917,8 @@ print_help (void) | |||
907 | printf (UT_VERBOSE); | 917 | printf (UT_VERBOSE); |
908 | printf (" %s\n", "-X, --exclude-type=TYPE"); | 918 | printf (" %s\n", "-X, --exclude-type=TYPE"); |
909 | printf (" %s\n", _("Ignore all filesystems of indicated type (may be repeated)")); | 919 | printf (" %s\n", _("Ignore all filesystems of indicated type (may be repeated)")); |
920 | printf (" %s\n", "-N, --include-type=TYPE"); | ||
921 | printf (" %s\n", _("Check only filesystems of indicated type (may be repeated)")); | ||
910 | 922 | ||
911 | printf ("\n"); | 923 | printf ("\n"); |
912 | printf ("%s\n", _("Examples:")); | 924 | printf ("%s\n", _("Examples:")); |
@@ -929,7 +941,7 @@ print_usage (void) | |||
929 | printf ("%s\n", _("Usage:")); | 941 | printf ("%s\n", _("Usage:")); |
930 | printf (" %s -w limit -c limit [-W limit] [-K limit] {-p path | -x device}\n", progname); | 942 | printf (" %s -w limit -c limit [-W limit] [-K limit] {-p path | -x device}\n", progname); |
931 | printf ("[-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]\n"); | 943 | printf ("[-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]\n"); |
932 | printf ("[-t timeout] [-u unit] [-v] [-X type]\n"); | 944 | printf ("[-t timeout] [-u unit] [-v] [-X type] [-N type]\n"); |
933 | } | 945 | } |
934 | 946 | ||
935 | void | 947 | void |