From c9d73535b59fef3056c65c3be6e1e18e4509629a Mon Sep 17 00:00:00 2001 From: Karl DeBisschop Date: Sun, 23 Mar 2003 06:20:50 +0000 Subject: can once again exclude indiviual path/partitions git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@448 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/plugins/check_disk.c b/plugins/check_disk.c index 3e9fa46..a7dd5cc 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -115,6 +115,8 @@ static struct name_list *fs_select_list; static struct name_list *fs_exclude_list; +static struct name_list *dp_exclude_list; + static struct name_list *path_select_list; static struct name_list *dev_select_list; @@ -191,6 +193,10 @@ main (int argc, char **argv) continue; else if (fs_exclude_list && walk_name_list (fs_exclude_list, me->me_type)) continue; + else if (dp_exclude_list && + walk_name_list (dp_exclude_list, me->me_devname) || + walk_name_list (dp_exclude_list, me->me_mountdir)) + continue; else get_fs_usage (me->me_mountdir, me->me_devname, &fsp); @@ -237,6 +243,7 @@ process_arguments (int argc, char **argv) struct name_list **pathtail = &path_select_list; struct name_list **devtail = &dev_select_list; struct name_list **fstail = &fs_exclude_list; + struct name_list **dptail = &dp_exclude_list; int option_index = 0; static struct option long_options[] = { @@ -311,21 +318,29 @@ process_arguments (int argc, char **argv) else { usage ("Timeout Interval must be an integer!\n"); } - case 'p': /* path or partition */ + case 'p': /* selec path */ se = (struct name_list *) malloc (sizeof (struct name_list)); se->name = strdup (optarg); se->name_next = NULL; *pathtail = se; pathtail = &se->name_next; break; - case 'd': /* path or partition */ + case 'd': /* select partition/device */ se = (struct name_list *) malloc (sizeof (struct name_list)); se->name = strdup (optarg); se->name_next = NULL; *devtail = se; devtail = &se->name_next; break; - case 'X': /* path or partition */ + case 'x': /* exclude path or partition */ + se = (struct name_list *) malloc (sizeof (struct name_list)); + se->name = strdup (optarg); + se->name_next = NULL; + *dptail = se; + dptail = &se->name_next; + break; + break; + case 'X': /* exclude file system type */ se = (struct name_list *) malloc (sizeof (struct name_list)); se->name = strdup (optarg); se->name_next = NULL; @@ -344,9 +359,6 @@ process_arguments (int argc, char **argv) case 'm': /* display mountpoint */ display_mntp = TRUE; break; - case 'x': /* exclude path or partition */ - exclude_device = optarg; - break; case 'V': /* version */ print_revision (progname, revision); exit (STATE_OK); -- cgit v0.10-9-g596f