summaryrefslogtreecommitdiffstats
path: root/glances/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'glances/plugins')
-rw-r--r--glances/plugins/glances_diskio.py6
-rw-r--r--glances/plugins/glances_fs.py15
-rw-r--r--glances/plugins/glances_gpu.py3
-rw-r--r--glances/plugins/glances_load.py8
-rw-r--r--glances/plugins/glances_network.py1
-rw-r--r--glances/plugins/glances_now.py1
6 files changed, 24 insertions, 10 deletions
diff --git a/glances/plugins/glances_diskio.py b/glances/plugins/glances_diskio.py
index eb339d2d..52ddfebc 100644
--- a/glances/plugins/glances_diskio.py
+++ b/glances/plugins/glances_diskio.py
@@ -162,7 +162,7 @@ class Plugin(GlancesPlugin):
return ret
# Max size for the interface name
- name_max_width = max_width - 12
+ name_max_width = max_width - 13
# Header
msg = '{:{width}}'.format('DISK I/O', width=name_max_width)
@@ -188,9 +188,9 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_new_line())
if len(disk_name) > name_max_width:
# Cut disk name if it is too long
- disk_name = '_' + disk_name[-name_max_width:]
+ disk_name = '_' + disk_name[-name_max_width+1:]
msg = '{:{width}}'.format(nativestr(disk_name),
- width=name_max_width)
+ width=name_max_width+1)
ret.append(self.curse_add_line(msg))
if args.diskio_iops:
# count
diff --git a/glances/plugins/glances_fs.py b/glances/plugins/glances_fs.py
index 37a125d6..bc0a981d 100644
--- a/glances/plugins/glances_fs.py
+++ b/glances/plugins/glances_fs.py
@@ -114,7 +114,8 @@ class Plugin(GlancesPlugin):
# Loop over fs
for fs in fs_stat:
# Do not take hidden file system into account
- if self.is_hide(fs.mountpoint):
+ # Also check device name (see issue #1606)
+ if self.is_hide(fs.mountpoint) or self.is_hide(fs.device):
continue
# Grab the disk usage
try:
@@ -163,7 +164,11 @@ class Plugin(GlancesPlugin):
'used': used,
'percent': percent,
'key': self.get_key()}
- stats.append(fs_current)
+ # Do not take hidden file system into account
+ if self.is_hide(fs_current['mnt_point']):
+ continue
+ else:
+ stats.append(fs_current)
else:
# Default behavior
for fs in fs_stat:
@@ -174,7 +179,11 @@ class Plugin(GlancesPlugin):
'used': int(fs_stat[fs]['used']) * 1024,
'percent': float(fs_stat[fs]['percent']),
'key': self.get_key()}
- stats.append(fs_current)
+ # Do not take hidden file system into account
+ if self.is_hide(fs_current['mnt_point']) or self.is_hide(fs_current['device_name']):
+ continue
+ else:
+ stats.append(fs_current)
# Update the stats
self.stats = stats
diff --git a/glances/plugins/glances_gpu.py b/glances/plugins/glances_gpu.py
index cf588216..9fd1c292 100644
--- a/glances/plugins/glances_gpu.py
+++ b/glances/plugins/glances_gpu.py
@@ -292,7 +292,8 @@ def get_device_name(device_handle):
def get_mem(device_handle):
"""Get GPU device memory consumption in percent."""
try:
- return pynvml.nvmlDeviceGetUtilizationRates(device_handle).memory
+ memory_info = pynvml.nvmlDeviceGetMemoryInfo(device_handle)
+ return memory_info.used * 100.0 / memory_info.total
except pynvml.NVMLError:
return None
diff --git a/glances/plugins/glances_load.py b/glances/plugins/glances_load.py
index 891a7eb9..e3e2cc13 100644
--- a/glances/plugins/glances_load.py
+++ b/glances/plugins/glances_load.py
@@ -25,6 +25,7 @@ import psutil
from glances.compat import iteritems
from glances.plugins.glances_core import Plugin as CorePlugin
from glances.plugins.glances_plugin import GlancesPlugin
+from glances.logger import logger
# SNMP OID
# 1 minute Load: .1.3.6.1.4.1.2021.10.1.3.1
@@ -62,7 +63,8 @@ class Plugin(GlancesPlugin):
# Call CorePlugin in order to display the core number
try:
self.nb_log_core = CorePlugin(args=self.args).update()["log"]
- except Exception:
+ except Exception as e:
+ logger.debug('Error: Can not retrieve the CPU core number (set it to 1) ({})'.format(e))
self.nb_log_core = 1
def _getloadavg(self):
@@ -142,11 +144,11 @@ class Plugin(GlancesPlugin):
# Build the string message
# Header
- msg = '{:8}'.format('LOAD%' if (args.disable_irix and self.nb_log_core != 0) else 'LOAD')
+ msg = '{:6}'.format('LOAD%' if (args.disable_irix and self.nb_log_core != 0) else 'LOAD')
ret.append(self.curse_add_line(msg, "TITLE"))
# Core number
if 'cpucore' in self.stats and self.stats['cpucore'] > 0:
- msg = '{}-core'.format(int(self.stats['cpucore']))
+ msg = '{:3}-core'.format(int(self.stats['cpucore']))
ret.append(self.curse_add_line(msg))
# Loop over 1min, 5min and 15min load
for load_time in ['1', '5', '15']:
diff --git a/glances/plugins/glances_network.py b/glances/plugins/glances_network.py
index 90b41090..00fc88b0 100644
--- a/glances/plugins/glances_network.py
+++ b/glances/plugins/glances_network.py
@@ -26,6 +26,7 @@ import operator
from glances.timer import getTimeSinceLastUpdate
from glances.plugins.glances_plugin import GlancesPlugin
from glances.compat import n, u, b, nativestr
+from glances.logger import logger
import psutil
diff --git a/glances/plugins/glances_now.py b/glances/plugins/glances_now.py
index b1a3fc82..59f62af8 100644
--- a/glances/plugins/glances_now.py
+++ b/glances/plugins/glances_now.py
@@ -21,6 +21,7 @@
from time import tzname, localtime, strftime
+from glances.globals import WINDOWS
from glances.plugins.glances_plugin import GlancesPlugin