diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-03-23 06:20:50 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-03-23 06:20:50 +0000 |
commit | c9d73535b59fef3056c65c3be6e1e18e4509629a (patch) | |
tree | a3b297a0716e876c83f0daf3896c8c35eaf379b6 /plugins/check_disk.c | |
parent | e7b6c3bd69f4e1bb65103023c8f18f291c33707e (diff) | |
download | monitoring-plugins-c9d73535b59fef3056c65c3be6e1e18e4509629a.tar.gz |
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
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r-- | plugins/check_disk.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c index 3e9fa46e..a7dd5cce 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); |