Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
30c5890a
G
glances
项目概览
蜕变的菜鸟
/
glances
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glances
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
30c5890a
编写于
10月 30, 2016
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'issue948' into develop
上级
2e3f4565
634f8fb2
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
83 addition
and
141 deletion
+83
-141
NEWS
NEWS
+1
-0
glances/main.py
glances/main.py
+35
-35
glances/outputs/glances_curses.py
glances/outputs/glances_curses.py
+10
-10
glances/plugins/glances_alert.py
glances/plugins/glances_alert.py
+1
-1
glances/plugins/glances_amps.py
glances/plugins/glances_amps.py
+1
-1
glances/plugins/glances_cpu.py
glances/plugins/glances_cpu.py
+1
-6
glances/plugins/glances_diskio.py
glances/plugins/glances_diskio.py
+1
-6
glances/plugins/glances_docker.py
glances/plugins/glances_docker.py
+4
-2
glances/plugins/glances_folders.py
glances/plugins/glances_folders.py
+1
-6
glances/plugins/glances_fs.py
glances/plugins/glances_fs.py
+1
-6
glances/plugins/glances_hddtemp.py
glances/plugins/glances_hddtemp.py
+0
-4
glances/plugins/glances_ip.py
glances/plugins/glances_ip.py
+1
-6
glances/plugins/glances_irq.py
glances/plugins/glances_irq.py
+1
-4
glances/plugins/glances_load.py
glances/plugins/glances_load.py
+1
-6
glances/plugins/glances_mem.py
glances/plugins/glances_mem.py
+1
-6
glances/plugins/glances_memswap.py
glances/plugins/glances_memswap.py
+1
-6
glances/plugins/glances_network.py
glances/plugins/glances_network.py
+1
-6
glances/plugins/glances_percpu.py
glances/plugins/glances_percpu.py
+0
-9
glances/plugins/glances_plugin.py
glances/plugins/glances_plugin.py
+5
-1
glances/plugins/glances_ports.py
glances/plugins/glances_ports.py
+0
-3
glances/plugins/glances_quicklook.py
glances/plugins/glances_quicklook.py
+1
-1
glances/plugins/glances_raid.py
glances/plugins/glances_raid.py
+2
-7
glances/plugins/glances_sensors.py
glances/plugins/glances_sensors.py
+0
-5
glances/plugins/glances_wifi.py
glances/plugins/glances_wifi.py
+1
-3
glances/stats.py
glances/stats.py
+5
-1
glances/stats_client_snmp.py
glances/stats_client_snmp.py
+7
-0
未找到文件。
NEWS
浏览文件 @
30c5890a
...
...
@@ -22,6 +22,7 @@ Enhancements and news features:
* Make the log logger configurable (issue #900)
* System uptime in export (issue #890)
* Deprecated platform method in Python 3.7 (issue #945)
* Refactor the --disable-* options (issue #948)
Bugs corrected:
...
...
glances/main.py
浏览文件 @
30c5890a
...
...
@@ -99,54 +99,54 @@ Start the client browser (browser mode):\n\
parser
.
add_argument
(
'-C'
,
'--config'
,
dest
=
'conf_file'
,
help
=
'path to the configuration file'
)
# Enable or disable option on startup
parser
.
add_argument
(
'-
3'
,
'--disable-quicklook
'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_
quicklook'
,
help
=
'disable quick look
module'
)
parser
.
add_argument
(
'-
4'
,
'--full-quicklook
'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'
full_quicklook'
,
help
=
'disable all but quick look and load
'
)
parser
.
add_argument
(
'-
-disable-alert
'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_
alert'
,
help
=
'disable alert
module'
)
parser
.
add_argument
(
'-
-disable-amps
'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'
disable_amps'
,
help
=
'disable applications monitoring process (AMP) module
'
)
parser
.
add_argument
(
'--disable-cpu'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_cpu'
,
help
=
'disable CPU module'
)
parser
.
add_argument
(
'--disable-mem'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_mem'
,
help
=
'disable memory module'
)
parser
.
add_argument
(
'--disable-swap'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_swap'
,
help
=
'disable swap module'
)
parser
.
add_argument
(
'--disable-load'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_load'
,
help
=
'disable load module'
)
parser
.
add_argument
(
'--disable-network'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_network'
,
help
=
'disable network module'
)
parser
.
add_argument
(
'--disable-wifi'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_wifi'
,
help
=
'disable wifi module'
)
parser
.
add_argument
(
'--disable-ports'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_ports'
,
help
=
'disable ports scanner module'
)
parser
.
add_argument
(
'--disable-ip'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_ip'
,
help
=
'disable IP module'
)
parser
.
add_argument
(
'--disable-diskio'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_diskio'
,
help
=
'disable disk I/O module'
)
parser
.
add_argument
(
'--disable-irq'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_irq'
,
help
=
'disable IRQ module'
),
parser
.
add_argument
(
'--disable-docker'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_docker'
,
help
=
'disable Docker module'
)
parser
.
add_argument
(
'--disable-folders'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_folders'
,
help
=
'disable folder module'
)
parser
.
add_argument
(
'--disable-fs'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_fs'
,
help
=
'disable filesystem module'
)
parser
.
add_argument
(
'--disable-folder'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_folder'
,
help
=
'disable folder module'
)
parser
.
add_argument
(
'--disable-sensors'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_sensors'
,
help
=
'disable sensors module'
)
parser
.
add_argument
(
'--disable-hddtemp'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_hddtemp'
,
help
=
'disable HD temperature module'
)
parser
.
add_argument
(
'--disable-ip'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_ip'
,
help
=
'disable IP module'
)
parser
.
add_argument
(
'--disable-irq'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_irq'
,
help
=
'disable IRQ module'
),
parser
.
add_argument
(
'--disable-load'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_load'
,
help
=
'disable load module'
)
parser
.
add_argument
(
'--disable-mem'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_mem'
,
help
=
'disable memory module'
)
parser
.
add_argument
(
'--disable-memswap'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_memswap'
,
help
=
'disable memory swap module'
)
parser
.
add_argument
(
'--disable-network'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_network'
,
help
=
'disable network module'
)
parser
.
add_argument
(
'--disable-ports'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_ports'
,
help
=
'disable ports scanner module'
)
parser
.
add_argument
(
'--disable-process'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_process'
,
help
=
'disable process module'
)
parser
.
add_argument
(
'--disable-raid'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_raid'
,
help
=
'disable RAID module'
)
parser
.
add_argument
(
'--disable-docker'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_docker'
,
help
=
'disable Docker module'
)
parser
.
add_argument
(
'-5'
,
'--disable-top'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_top'
,
help
=
'disable top menu (QL, CPU, MEM, SWAP and LOAD)'
)
parser
.
add_argument
(
'--disable-sensors'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_sensors'
,
help
=
'disable sensors module'
)
parser
.
add_argument
(
'--disable-wifi'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_wifi'
,
help
=
'disable wifi module'
)
parser
.
add_argument
(
'-2'
,
'--disable-left-sidebar'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_left_sidebar'
,
help
=
'disable network, disk I/O, FS and sensors modules'
)
parser
.
add_argument
(
'--disable-process'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_process'
,
help
=
'disable process module'
)
parser
.
add_argument
(
'--disable-amps'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_amps'
,
help
=
'disable applications monitoring process (AMP) module'
)
parser
.
add_argument
(
'--disable-log'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_log'
,
help
=
'disable log module'
)
parser
.
add_argument
(
'-3'
,
'--disable-quicklook'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_quicklook'
,
help
=
'disable quick look module'
)
parser
.
add_argument
(
'-4'
,
'--full-quicklook'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'full_quicklook'
,
help
=
'disable all but quick look and load'
)
parser
.
add_argument
(
'-5'
,
'--disable-top'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_top'
,
help
=
'disable top menu (QL, CPU, MEM, SWAP and LOAD)'
)
parser
.
add_argument
(
'--disable-history'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_history'
,
help
=
'disable stats history'
)
parser
.
add_argument
(
'--disable-bold'
,
action
=
'store_true'
,
default
=
False
,
...
...
glances/outputs/glances_curses.py
浏览文件 @
30c5890a
...
...
@@ -317,12 +317,12 @@ class _GlancesCurses(object):
self
.
args
.
disable_quicklook
=
False
self
.
args
.
disable_cpu
=
True
self
.
args
.
disable_mem
=
True
self
.
args
.
disable_swap
=
True
self
.
args
.
disable_
mem
swap
=
True
else
:
self
.
args
.
disable_quicklook
=
False
self
.
args
.
disable_cpu
=
False
self
.
args
.
disable_mem
=
False
self
.
args
.
disable_swap
=
False
self
.
args
.
disable_
mem
swap
=
False
elif
self
.
pressedkey
==
ord
(
'5'
):
# '5' > Enable/disable top menu
logger
.
info
(
self
.
args
.
disable_top
)
...
...
@@ -331,13 +331,13 @@ class _GlancesCurses(object):
self
.
args
.
disable_quicklook
=
True
self
.
args
.
disable_cpu
=
True
self
.
args
.
disable_mem
=
True
self
.
args
.
disable_swap
=
True
self
.
args
.
disable_
mem
swap
=
True
self
.
args
.
disable_load
=
True
else
:
self
.
args
.
disable_quicklook
=
False
self
.
args
.
disable_cpu
=
False
self
.
args
.
disable_mem
=
False
self
.
args
.
disable_swap
=
False
self
.
args
.
disable_
mem
swap
=
False
self
.
args
.
disable_load
=
False
elif
self
.
pressedkey
==
ord
(
'/'
):
# '/' > Switch between short/long name for processes
...
...
@@ -382,7 +382,7 @@ class _GlancesCurses(object):
elif
self
.
pressedkey
==
ord
(
'f'
):
# 'f' > Show/hide fs / folder stats
self
.
args
.
disable_fs
=
not
self
.
args
.
disable_fs
self
.
args
.
disable_folder
=
not
self
.
args
.
disable_folder
self
.
args
.
disable_folder
s
=
not
self
.
args
.
disable_folders
elif
self
.
pressedkey
==
ord
(
'g'
):
# 'g' > Export graphs to file
self
.
graph_tag
=
not
self
.
graph_tag
...
...
@@ -397,8 +397,8 @@ class _GlancesCurses(object):
# 'I' > Show/hide IP module
self
.
args
.
disable_ip
=
not
self
.
args
.
disable_ip
elif
self
.
pressedkey
==
ord
(
'l'
):
# 'l' > Show/hide log messages
self
.
args
.
disable_
log
=
not
self
.
args
.
disable_log
# 'l' > Show/hide
alert/
log messages
self
.
args
.
disable_
alert
=
not
self
.
args
.
disable_alert
elif
self
.
pressedkey
==
ord
(
'm'
):
# 'm' > Sort processes by MEM usage
glances_processes
.
auto_sort
=
False
...
...
@@ -639,7 +639,7 @@ class _GlancesCurses(object):
mem_width
=
0
else
:
mem_width
=
self
.
get_stats_display_width
(
stats_mem
)
if
self
.
args
.
disable_swap
:
if
self
.
args
.
disable_
mem
swap
:
swap_width
=
0
else
:
swap_width
=
self
.
get_stats_display_width
(
stats_memswap
)
...
...
@@ -655,7 +655,7 @@ class _GlancesCurses(object):
stats_number
=
(
int
(
not
self
.
args
.
disable_cpu
and
stats_cpu
[
'msgdict'
]
!=
[])
+
int
(
not
self
.
args
.
disable_mem
and
stats_mem
[
'msgdict'
]
!=
[])
+
int
(
not
self
.
args
.
disable_swap
and
stats_memswap
[
'msgdict'
]
!=
[])
+
int
(
not
self
.
args
.
disable_
mem
swap
and
stats_memswap
[
'msgdict'
]
!=
[])
+
int
(
not
self
.
args
.
disable_load
and
stats_load
[
'msgdict'
]
!=
[]))
if
not
self
.
args
.
disable_quicklook
:
...
...
@@ -728,7 +728,7 @@ class _GlancesCurses(object):
self
.
args
.
disable_diskio
and
self
.
args
.
disable_fs
and
self
.
args
.
disable_irq
and
self
.
args
.
disable_folder
and
self
.
args
.
disable_folder
s
and
self
.
args
.
disable_raid
and
self
.
args
.
disable_sensors
)
and
not
self
.
args
.
disable_left_sidebar
:
for
s
in
(
stats_network
,
stats_wifi
,
stats_ports
,
stats_diskio
,
stats_fs
,
stats_irq
,
stats_folders
,
stats_raid
,
stats_sensors
,
stats_now
):
...
...
glances/plugins/glances_alert.py
浏览文件 @
30c5890a
...
...
@@ -60,7 +60,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if display plugin enable...
if
args
.
disable_log
:
if
not
self
.
stats
and
self
.
is_disable
()
:
return
ret
# Build the string message
...
...
glances/plugins/glances_amps.py
浏览文件 @
30c5890a
...
...
@@ -97,7 +97,7 @@ class Plugin(GlancesPlugin):
# Only process if stats exist and display plugin enable...
ret
=
[]
if
not
self
.
stats
or
args
.
disable_process
or
args
.
disable_amps
:
if
not
self
.
stats
or
args
.
disable_process
or
self
.
is_disable
()
:
return
ret
# Build the string message
...
...
glances/plugins/glances_cpu.py
浏览文件 @
30c5890a
...
...
@@ -68,8 +68,6 @@ class Plugin(GlancesPlugin):
"""Init the CPU plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
,
items_history_list
=
items_history_list
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -94,9 +92,6 @@ class Plugin(GlancesPlugin):
# Reset stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_cpu
:
return
self
.
stats
# Grab stats into self.stats
if
self
.
input_method
==
'local'
:
self
.
update_local
()
...
...
@@ -230,7 +225,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist and plugin not disable
if
not
self
.
stats
or
args
.
disable_cpu
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
# Build the string message
...
...
glances/plugins/glances_diskio.py
浏览文件 @
30c5890a
...
...
@@ -51,8 +51,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
,
items_history_list
=
items_history_list
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -74,9 +72,6 @@ class Plugin(GlancesPlugin):
# Reset stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_diskio
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Update stats using the standard system lib
# Grab the stat using the PsUtil disk_io_counters method
...
...
@@ -175,7 +170,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist and display plugin enable...
if
not
self
.
stats
or
args
.
disable_diskio
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
# Build the string message
...
...
glances/plugins/glances_docker.py
浏览文件 @
30c5890a
...
...
@@ -160,7 +160,7 @@ class Plugin(GlancesPlugin):
docker_tag
=
False
# The Docker-py lib is mandatory
if
not
docker_tag
or
(
self
.
args
is
not
None
and
self
.
args
.
disable_docker
)
:
if
not
docker_tag
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
...
...
@@ -491,7 +491,9 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist (and non null) and display plugin enable...
if
not
self
.
stats
or
args
.
disable_docker
or
len
(
self
.
stats
[
'containers'
])
==
0
:
if
not
self
.
stats
\
or
len
(
self
.
stats
[
'containers'
])
==
0
\
or
self
.
is_disable
():
return
ret
# Build the string message
...
...
glances/plugins/glances_folders.py
浏览文件 @
30c5890a
...
...
@@ -33,8 +33,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -61,9 +59,6 @@ class Plugin(GlancesPlugin):
# Reset the list
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_folder
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Folder list only available in a full Glances environment
# Check if the glances_folder instance is init
...
...
@@ -103,7 +98,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist and display plugin enable...
if
not
self
.
stats
or
args
.
disable_folder
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
# Build the string message
...
...
glances/plugins/glances_fs.py
浏览文件 @
30c5890a
...
...
@@ -75,8 +75,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
,
items_history_list
=
items_history_list
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -98,9 +96,6 @@ class Plugin(GlancesPlugin):
# Reset the list
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_fs
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Update stats using the standard system lib
...
...
@@ -210,7 +205,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist and display plugin enable...
if
not
self
.
stats
or
args
.
disable_fs
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
# Max size for the fsname name
...
...
glances/plugins/glances_hddtemp.py
浏览文件 @
30c5890a
...
...
@@ -92,10 +92,6 @@ class GlancesGrabHDDTemp(object):
# Reset the list
self
.
reset
()
# Only update if --disable-hddtemp is not set
if
self
.
args
is
None
or
self
.
args
.
disable_hddtemp
:
return
# Fetch the data
# data = ("|/dev/sda|WDC WD2500JS-75MHB0|44|C|"
# "|/dev/sdb|WDC WD2500JS-75MHB0|35|C|"
...
...
glances/plugins/glances_ip.py
浏览文件 @
30c5890a
...
...
@@ -62,8 +62,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -87,9 +85,6 @@ class Plugin(GlancesPlugin):
# Reset stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_ip
:
return
self
.
stats
if
self
.
input_method
==
'local'
and
netifaces_tag
:
# Update stats using the netifaces lib
try
:
...
...
@@ -131,7 +126,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist and display plugin enable...
if
not
self
.
stats
or
args
.
disable_ip
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
# Build the string message
...
...
glances/plugins/glances_irq.py
浏览文件 @
30c5890a
...
...
@@ -40,8 +40,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -69,7 +67,6 @@ class Plugin(GlancesPlugin):
# IRQ plugin only available on GNU/Linux
# Correct issue #947: IRQ file do not exist on OpenVZ container
if
not
LINUX
\
or
(
self
.
args
is
not
None
and
self
.
args
.
disable_irq
)
\
or
not
os
.
path
.
exists
(
self
.
IRQ_FILE
):
return
self
.
stats
...
...
@@ -120,7 +117,7 @@ class Plugin(GlancesPlugin):
return
ret
# Only process if stats exist and display plugin enable...
if
not
self
.
stats
or
args
.
disable_irq
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
if
max_width
is
not
None
and
max_width
>=
23
:
...
...
glances/plugins/glances_load.py
浏览文件 @
30c5890a
...
...
@@ -58,8 +58,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
,
items_history_list
=
items_history_list
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -83,9 +81,6 @@ class Plugin(GlancesPlugin):
# Reset stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_load
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Update stats using the standard system lib
...
...
@@ -143,7 +138,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist, not empty (issue #871) and plugin not disabled
if
not
self
.
stats
or
(
self
.
stats
==
{})
or
args
.
disable_load
:
if
not
self
.
stats
or
(
self
.
stats
==
{})
or
self
.
is_disable
()
:
return
ret
# Build the string message
...
...
glances/plugins/glances_mem.py
浏览文件 @
30c5890a
...
...
@@ -66,8 +66,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
,
items_history_list
=
items_history_list
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -85,9 +83,6 @@ class Plugin(GlancesPlugin):
# Reset stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_mem
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Update stats using the standard system lib
# Grab MEM using the PSUtil virtual_memory method
...
...
@@ -189,7 +184,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist and plugin not disabled
if
not
self
.
stats
or
args
.
disable_mem
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
# Build the string message
...
...
glances/plugins/glances_memswap.py
浏览文件 @
30c5890a
...
...
@@ -54,8 +54,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
,
items_history_list
=
items_history_list
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -73,9 +71,6 @@ class Plugin(GlancesPlugin):
# Reset stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_swap
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Update stats using the standard system lib
# Grab SWAP using the PSUtil swap_memory method
...
...
@@ -160,7 +155,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist and plugin not disabled
if
not
self
.
stats
or
args
.
disable_swap
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
# Build the string message
...
...
glances/plugins/glances_network.py
浏览文件 @
30c5890a
...
...
@@ -59,8 +59,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
,
items_history_list
=
items_history_list
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -85,9 +83,6 @@ class Plugin(GlancesPlugin):
# Reset stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_network
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Update stats using the standard system lib
...
...
@@ -272,7 +267,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist and display plugin enable...
if
not
self
.
stats
or
args
.
disable_network
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
# Max size for the interface name
...
...
glances/plugins/glances_percpu.py
浏览文件 @
30c5890a
...
...
@@ -35,8 +35,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -58,9 +56,6 @@ class Plugin(GlancesPlugin):
# Reset stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_cpu
:
return
self
.
stats
# Grab per-CPU stats using psutil's cpu_percent(percpu=True) and
# cpu_times_percent(percpu=True) methods
if
self
.
input_method
==
'local'
:
...
...
@@ -76,10 +71,6 @@ class Plugin(GlancesPlugin):
# Init the return message
ret
=
[]
# Only process if plugin not disable
if
args
.
disable_cpu
:
return
ret
# No per CPU stat ? Exit...
if
not
self
.
stats
:
msg
=
'PER CPU not available'
...
...
glances/plugins/glances_plugin.py
浏览文件 @
30c5890a
...
...
@@ -87,7 +87,7 @@ class GlancesPlugin(object):
return
None
def
is_enable
(
self
):
"""Return true if plugin is enable"""
"""Return true if plugin is enable
d
"""
try
:
d
=
getattr
(
self
.
args
,
'disable_'
+
self
.
plugin_name
)
except
AttributeError
:
...
...
@@ -95,6 +95,10 @@ class GlancesPlugin(object):
else
:
return
d
is
False
def
is_disable
(
self
):
"""Return true if plugin is disabled"""
return
not
self
.
is_enable
()
def
_json_dumps
(
self
,
d
):
"""Return the object 'd' in a JSON format
Manage the issue #815 for Windows OS"""
...
...
glances/plugins/glances_ports.py
浏览文件 @
30c5890a
...
...
@@ -66,9 +66,6 @@ class Plugin(GlancesPlugin):
def
update
(
self
):
"""Update the ports list."""
if
self
.
args
is
not
None
and
self
.
args
.
disable_ports
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Only refresh:
# * if there is not other scanning thread
...
...
glances/plugins/glances_quicklook.py
浏览文件 @
30c5890a
...
...
@@ -108,7 +108,7 @@ class Plugin(GlancesPlugin):
ret
=
[]
# Only process if stats exist...
if
not
self
.
stats
or
args
.
disable_quicklook
:
if
not
self
.
stats
or
self
.
is_disable
()
:
return
ret
# Define the bar
...
...
glances/plugins/glances_raid.py
浏览文件 @
30c5890a
...
...
@@ -41,8 +41,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -60,9 +58,6 @@ class Plugin(GlancesPlugin):
# Reset stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_raid
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Update stats using the PyMDstat lib (https://github.com/nicolargo/pymdstat)
try
:
...
...
@@ -87,8 +82,8 @@ class Plugin(GlancesPlugin):
# Init the return message
ret
=
[]
# Only process if stats exist
and display plugin enable
...
if
not
self
.
stats
or
args
.
disable_raid
:
# Only process if stats exist...
if
not
self
.
stats
:
return
ret
# Build the string message
...
...
glances/plugins/glances_sensors.py
浏览文件 @
30c5890a
...
...
@@ -53,8 +53,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
)
self
.
args
=
args
# Init the sensor class
self
.
glancesgrabsensors
=
GlancesGrabSensors
()
...
...
@@ -87,9 +85,6 @@ class Plugin(GlancesPlugin):
# Reset the stats
self
.
reset
()
if
self
.
args
is
not
None
and
self
.
args
.
disable_sensors
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
# Update stats using the dedicated lib
self
.
stats
=
[]
...
...
glances/plugins/glances_wifi.py
浏览文件 @
30c5890a
...
...
@@ -49,8 +49,6 @@ class Plugin(GlancesPlugin):
"""Init the plugin."""
super
(
Plugin
,
self
).
__init__
(
args
=
args
)
self
.
args
=
args
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -84,7 +82,7 @@ class Plugin(GlancesPlugin):
self
.
reset
()
# Exist if we can not grab the stats
if
not
wifi_tag
or
(
self
.
args
is
not
None
and
self
.
args
.
disable_wifi
)
:
if
not
wifi_tag
:
return
self
.
stats
if
self
.
input_method
==
'local'
:
...
...
glances/stats.py
浏览文件 @
30c5890a
...
...
@@ -150,7 +150,11 @@ class GlancesStats(object):
# For standalone and server modes
# For each plugins, call the update method
for
p
in
self
.
_plugins
:
# logger.debug("Update %s stats" % p)
if
self
.
_plugins
[
p
].
is_disable
():
# If current plugin is disable
# then continue to next plugin
continue
# Update the stats
self
.
_plugins
[
p
].
update
()
def
export
(
self
,
input_stats
=
None
):
...
...
glances/stats_client_snmp.py
浏览文件 @
30c5890a
...
...
@@ -100,9 +100,16 @@ class GlancesStatsClientSNMP(GlancesStats):
"""Update the stats using SNMP."""
# For each plugins, call the update method
for
p
in
self
.
_plugins
:
if
self
.
_plugins
[
p
].
is_disable
():
# If current plugin is disable
# then continue to next plugin
continue
# Set the input method to SNMP
self
.
_plugins
[
p
].
input_method
=
'snmp'
self
.
_plugins
[
p
].
short_system_name
=
self
.
system_name
# Update the stats
try
:
self
.
_plugins
[
p
].
update
()
except
Exception
as
e
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录