提交 0003e0e5 编写于 作者: N nicolargo

Allow logical mounts points in the FS plugin (issue #448)

上级 e6c646c1
......@@ -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
===========
......
......@@ -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
......
......@@ -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
......
......@@ -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
-------
......
......@@ -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."""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册