@@ -47,6 +47,8 @@ def __init__(self, name, init_config, instances):
4747 self ._all_partitions = is_affirmative (instance .get ('all_partitions' , False ))
4848 self ._file_system_whitelist = instance .get ('file_system_whitelist' , [])
4949 self ._file_system_blacklist = instance .get ('file_system_blacklist' , [])
50+ # FIXME (8.X): Exclude special file systems by default
51+ self ._include_all_devices = is_affirmative (instance .get ('include_all_devices' , True ))
5052 self ._device_whitelist = instance .get ('device_whitelist' , [])
5153 self ._device_blacklist = instance .get ('device_blacklist' , [])
5254 self ._mount_point_whitelist = instance .get ('mount_point_whitelist' , [])
@@ -71,7 +73,7 @@ def check(self, instance):
7173 self .devices_label = self ._get_devices_label ()
7274
7375 self ._valid_disks = {}
74- for part in psutil .disk_partitions (all = True ):
76+ for part in psutil .disk_partitions (all = self . _include_all_devices ):
7577 # we check all exclude conditions
7678 if self .exclude_disk (part ):
7779 continue
@@ -88,7 +90,12 @@ def check(self, instance):
8890 )
8991 continue
9092 except Exception as e :
91- self .log .warning ('Unable to get disk metrics for %s: %s' , part .mountpoint , e )
93+ self .log .warning (
94+ u'Unable to get disk metrics for %s: %s. '
95+ u'You can exclude this mountpoint in the settings if it is invalid.' ,
96+ part .mountpoint ,
97+ e ,
98+ )
9299 continue
93100
94101 # Exclude disks with size less than min_disk_size
@@ -147,7 +154,6 @@ def _exclude_disk(self, device, file_system, mount_point):
147154 """
148155 Return True for disks we don't want or that match regex in the config file
149156 """
150- self .log .debug ('_exclude_disk: %s, %s, %s' , device , file_system , mount_point )
151157
152158 if not device or device == 'none' :
153159 device = None
@@ -245,7 +251,12 @@ def _collect_inodes_metrics(self, mountpoint):
245251 )
246252 return metrics
247253 except Exception as e :
248- self .log .warning ('Unable to get disk metrics for %s: %s' , mountpoint , e )
254+ self .log .warning (
255+ u'Unable to get disk metrics for %s: %s. '
256+ u'You can exclude this mountpoint in the settings if it is invalid.' ,
257+ mountpoint ,
258+ e ,
259+ )
249260 return metrics
250261
251262 if inodes .f_files != 0 :
0 commit comments