diff options
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | conf/glances-test.conf | 2 | ||||
-rw-r--r-- | conf/glances.conf | 2 | ||||
-rw-r--r-- | docs/glances-doc.rst | 7 | ||||
-rw-r--r-- | glances/plugins/glances_fs.py | 14 |
5 files changed, 28 insertions, 4 deletions
@@ -7,12 +7,13 @@ Version 2.4 Enhancements and news features: - * Grab FAN speed in the Glances sensors plugin (issue #501) + * Grab FAN speed in the Glances sensors plugin (issue #501) + * Allow logical mounts points in the FS plugin (issue #448) Bugs corrected: - * Correct monitor list, all processes are take into account (issue #507) - * Correct duplicated --enable-history in the doc (issue #511) + * Correct monitor list, all processes are take into account (issue #507) + * Correct duplicated --enable-history in the doc (issue #511) Version 2.3 =========== diff --git a/conf/glances-test.conf b/conf/glances-test.conf index 0d82d4cc..ff740d5a 100644 --- a/conf/glances-test.conf +++ b/conf/glances-test.conf @@ -101,6 +101,8 @@ careful=50 careful_action=echo {{mnt_point}} {{used}}/{{size}} > /tmp/fs.alert warning=70 critical=90 +# Allow additionnals files types (comma-separated FS type) +allow=zfs [sensors] # Sensors core limits diff --git a/conf/glances.conf b/conf/glances.conf index 47a0722a..9a56d565 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -92,6 +92,8 @@ critical=90 careful=50 warning=70 critical=90 +# Allow additionnals files types (comma-separated FS type) +#allow=zfs [sensors] # Sensors core limits diff --git a/docs/glances-doc.rst b/docs/glances-doc.rst index 86d07740..656bc4bf 100644 --- a/docs/glances-doc.rst +++ b/docs/glances-doc.rst @@ -530,6 +530,13 @@ If a RAID controller is detected on you system, its status will be displayed: .. image:: images/raid.png +By default, the plugin only display physical devices only (hard disks, USB keys) and ignore all others. To allow others FS type, you had to use the following section in the configuration file: + +:: + + [fs] + allow=zfs,misc + Sensors ------- diff --git a/glances/plugins/glances_fs.py b/glances/plugins/glances_fs.py index 57719ced..d1b6c207 100644 --- a/glances/plugins/glances_fs.py +++ b/glances/plugins/glances_fs.py @@ -105,6 +105,17 @@ class Plugin(GlancesPlugin): except UnicodeDecodeError: return self.stats + # Optionnal hack to allow logicals mounts points (issue #448) + # Ex: Had to put 'allow=zfs' in the [fs] section of the conf file + # to allow zfs monitoring + for fstype in self.get_conf_value('allow'): + try: + fs_stat += [f for f in psutil.disk_partitions(all=True) if f.fstype.find(fstype) >= 0] + except UnicodeDecodeError: + return self.stats + + logger.info(fs_stat) + # Loop over fs for fs in fs_stat: fs_current = {} @@ -182,7 +193,8 @@ class Plugin(GlancesPlugin): # Add specifics informations # Alert for i in self.stats: - self.views[i[self.get_key()]]['used']['decoration'] = self.get_alert(i['used'], max=i['size'], header=i['mnt_point']) + self.views[i[self.get_key()]]['used']['decoration'] = self.get_alert( + i['used'], max=i['size'], header=i['mnt_point']) def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" |