summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-11-19 05:59:22 +0000
committerThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-11-19 05:59:22 +0000
commit53058522125ef86a65c241ad0a5f56df01d55d6a (patch)
treef9a2b4a51626b5660bf867c5ffd9388bd3e90638 /plugins
parente77ddaf6db1621001634fb5602ea42a59cf0660c (diff)
downloadmonitoring-plugins-53058522125ef86a65c241ad0a5f56df01d55d6a.tar.gz
check_disk: rerpopulate the mount list after doing a stat() on paths specified with -p for better automount support.
NB: There's a memory leak here - properly freeing the mount list would invlove much more work - there's many other places where leaks can happen so it should be a project on its own. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2085 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_disk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 2f8afa6c..f0950c95 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -118,9 +118,6 @@ enum
118 #pragma alloca 118 #pragma alloca
119#endif 119#endif
120 120
121/* Linked list of mounted filesystems. */
122static struct mount_entry *mount_list;
123
124int process_arguments (int, char **); 121int process_arguments (int, char **);
125void print_path (const char *mypath); 122void print_path (const char *mypath);
126void set_all_thresholds (struct parameter_list *path); 123void set_all_thresholds (struct parameter_list *path);
@@ -639,8 +636,12 @@ process_arguments (int argc, char **argv)
639 } 636 }
640 se->group = group; 637 se->group = group;
641 set_all_thresholds(se); 638 set_all_thresholds(se);
642 np_set_best_match(se, mount_list, exact_match); 639
640 /* With autofs, it is required to stat() the path before populating the mount_list */
643 stat_path(se); 641 stat_path(se);
642 mount_list = read_file_system_list (0);
643 np_set_best_match(se, mount_list, exact_match);
644
644 path_selected = TRUE; 645 path_selected = TRUE;
645 break; 646 break;
646 case 'x': /* exclude path or partition */ 647 case 'x': /* exclude path or partition */
@@ -757,7 +758,6 @@ process_arguments (int argc, char **argv)
757 case 'C': 758 case 'C':
758 /* add all mount entries to path_select list if no partitions have been explicitly defined using -p */ 759 /* add all mount entries to path_select list if no partitions have been explicitly defined using -p */
759 if (path_selected == FALSE) { 760 if (path_selected == FALSE) {
760 struct mount_entry *me;
761 struct parameter_list *path; 761 struct parameter_list *path;
762 for (me = mount_list; me; me = me->me_next) { 762 for (me = mount_list; me; me = me->me_next) {
763 if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) 763 if (! (path = np_find_parameter(path_select_list, me->me_mountdir)))