diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-03-23 06:20:50 (GMT) |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-03-23 06:20:50 (GMT) |
commit | c9d73535b59fef3056c65c3be6e1e18e4509629a (patch) | |
tree | a3b297a0716e876c83f0daf3896c8c35eaf379b6 /plugins | |
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')
-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 3e9fa46..a7dd5cc 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c | |||
@@ -115,6 +115,8 @@ static struct name_list *fs_select_list; | |||
115 | 115 | ||
116 | static struct name_list *fs_exclude_list; | 116 | static struct name_list *fs_exclude_list; |
117 | 117 | ||
118 | static struct name_list *dp_exclude_list; | ||
119 | |||
118 | static struct name_list *path_select_list; | 120 | static struct name_list *path_select_list; |
119 | 121 | ||
120 | static struct name_list *dev_select_list; | 122 | static struct name_list *dev_select_list; |
@@ -191,6 +193,10 @@ main (int argc, char **argv) | |||
191 | continue; | 193 | continue; |
192 | else if (fs_exclude_list && walk_name_list (fs_exclude_list, me->me_type)) | 194 | else if (fs_exclude_list && walk_name_list (fs_exclude_list, me->me_type)) |
193 | continue; | 195 | continue; |
196 | else if (dp_exclude_list && | ||
197 | walk_name_list (dp_exclude_list, me->me_devname) || | ||
198 | walk_name_list (dp_exclude_list, me->me_mountdir)) | ||
199 | continue; | ||
194 | else | 200 | else |
195 | get_fs_usage (me->me_mountdir, me->me_devname, &fsp); | 201 | get_fs_usage (me->me_mountdir, me->me_devname, &fsp); |
196 | 202 | ||
@@ -237,6 +243,7 @@ process_arguments (int argc, char **argv) | |||
237 | struct name_list **pathtail = &path_select_list; | 243 | struct name_list **pathtail = &path_select_list; |
238 | struct name_list **devtail = &dev_select_list; | 244 | struct name_list **devtail = &dev_select_list; |
239 | struct name_list **fstail = &fs_exclude_list; | 245 | struct name_list **fstail = &fs_exclude_list; |
246 | struct name_list **dptail = &dp_exclude_list; | ||
240 | 247 | ||
241 | int option_index = 0; | 248 | int option_index = 0; |
242 | static struct option long_options[] = { | 249 | static struct option long_options[] = { |
@@ -311,21 +318,29 @@ process_arguments (int argc, char **argv) | |||
311 | else { | 318 | else { |
312 | usage ("Timeout Interval must be an integer!\n"); | 319 | usage ("Timeout Interval must be an integer!\n"); |
313 | } | 320 | } |
314 | case 'p': /* path or partition */ | 321 | case 'p': /* selec path */ |
315 | se = (struct name_list *) malloc (sizeof (struct name_list)); | 322 | se = (struct name_list *) malloc (sizeof (struct name_list)); |
316 | se->name = strdup (optarg); | 323 | se->name = strdup (optarg); |
317 | se->name_next = NULL; | 324 | se->name_next = NULL; |
318 | *pathtail = se; | 325 | *pathtail = se; |
319 | pathtail = &se->name_next; | 326 | pathtail = &se->name_next; |
320 | break; | 327 | break; |
321 | case 'd': /* path or partition */ | 328 | case 'd': /* select partition/device */ |
322 | se = (struct name_list *) malloc (sizeof (struct name_list)); | 329 | se = (struct name_list *) malloc (sizeof (struct name_list)); |
323 | se->name = strdup (optarg); | 330 | se->name = strdup (optarg); |
324 | se->name_next = NULL; | 331 | se->name_next = NULL; |
325 | *devtail = se; | 332 | *devtail = se; |
326 | devtail = &se->name_next; | 333 | devtail = &se->name_next; |
327 | break; | 334 | break; |
328 | case 'X': /* path or partition */ | 335 | case 'x': /* exclude path or partition */ |
336 | se = (struct name_list *) malloc (sizeof (struct name_list)); | ||
337 | se->name = strdup (optarg); | ||
338 | se->name_next = NULL; | ||
339 | *dptail = se; | ||
340 | dptail = &se->name_next; | ||
341 | break; | ||
342 | break; | ||
343 | case 'X': /* exclude file system type */ | ||
329 | se = (struct name_list *) malloc (sizeof (struct name_list)); | 344 | se = (struct name_list *) malloc (sizeof (struct name_list)); |
330 | se->name = strdup (optarg); | 345 | se->name = strdup (optarg); |
331 | se->name_next = NULL; | 346 | se->name_next = NULL; |
@@ -344,9 +359,6 @@ process_arguments (int argc, char **argv) | |||
344 | case 'm': /* display mountpoint */ | 359 | case 'm': /* display mountpoint */ |
345 | display_mntp = TRUE; | 360 | display_mntp = TRUE; |
346 | break; | 361 | break; |
347 | case 'x': /* exclude path or partition */ | ||
348 | exclude_device = optarg; | ||
349 | break; | ||
350 | case 'V': /* version */ | 362 | case 'V': /* version */ |
351 | print_revision (progname, revision); | 363 | print_revision (progname, revision); |
352 | exit (STATE_OK); | 364 | exit (STATE_OK); |