diff options
author | Nicolargo <nicolas@nicolargo.com> | 2014-04-27 17:54:29 +0200 |
---|---|---|
committer | Nicolargo <nicolas@nicolargo.com> | 2014-04-27 17:54:29 +0200 |
commit | 0a615b95f6f9e9dee66028b66fddf4c375dd1c40 (patch) | |
tree | fe766b3fc7e20211da24a5c6d607ed5bdaaaddfe | |
parent | 8fcc70049d4d4860f644fe9f9a3bee3e2093d5c9 (diff) |
Correct issue #346 if drive is removed during the FS grab
-rw-r--r-- | conf/glances-monitor.conf | 2 | ||||
-rw-r--r-- | glances/plugins/glances_fs.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/conf/glances-monitor.conf b/conf/glances-monitor.conf index a19b8c99..ef9ad2cd 100644 --- a/conf/glances-monitor.conf +++ b/conf/glances-monitor.conf @@ -106,7 +106,7 @@ mem_critical=90 list_1_description=Dropbox list_1_regex=.*dropbox.* list_1_countmin=1 -list_1_command=dropbox status +list_1_command=dropbox status | head -1 list_2_description=Python programs list_2_regex=.*python.* list_3_description=Famous Xeyes diff --git a/glances/plugins/glances_fs.py b/glances/plugins/glances_fs.py index 038951ed..072ea727 100644 --- a/glances/plugins/glances_fs.py +++ b/glances/plugins/glances_fs.py @@ -59,7 +59,12 @@ class glancesGrabFs: fs_current['fs_type'] = fs_stat[fs].fstype fs_current['mnt_point'] = fs_stat[fs].mountpoint # Grab the disk usage - fs_usage = psutil.disk_usage(fs_current['mnt_point']) + try: + fs_usage = psutil.disk_usage(fs_current['mnt_point']) + except OSError: + # Correct issue #346 + # Disk is ejected during the command + continue fs_current['size'] = fs_usage.total fs_current['used'] = fs_usage.used fs_current['avail'] = fs_usage.free |