提交 c69e965d 编写于 作者: N Nicolargo

Disable CPU, MEM, SWAP and LOAD done. Had to change the glances_curses module...

Disable CPU, MEM, SWAP and LOAD done. Had to change the glances_curses module to compute the QL size
上级 49c3c6c6
......@@ -100,6 +100,14 @@ 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('--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-ip', action='store_true', default=False,
......
......@@ -439,12 +439,12 @@ class _GlancesCurses(object):
'system').get_stats_display(args=self.args)
stats_uptime = stats.get_plugin('uptime').get_stats_display()
if self.args.percpu:
stats_percpu = stats.get_plugin('percpu').get_stats_display()
stats_percpu = stats.get_plugin('percpu').get_stats_display(args=self.args)
else:
stats_cpu = stats.get_plugin('cpu').get_stats_display()
stats_load = stats.get_plugin('load').get_stats_display()
stats_mem = stats.get_plugin('mem').get_stats_display()
stats_memswap = stats.get_plugin('memswap').get_stats_display()
stats_cpu = stats.get_plugin('cpu').get_stats_display(args=self.args)
stats_load = stats.get_plugin('load').get_stats_display(args=self.args)
stats_mem = stats.get_plugin('mem').get_stats_display(args=self.args)
stats_memswap = stats.get_plugin('memswap').get_stats_display(args=self.args)
stats_network = stats.get_plugin('network').get_stats_display(
args=self.args, max_width=plugin_max_width)
try:
......
......@@ -163,8 +163,8 @@ class Plugin(GlancesPlugin):
# Init the return message
ret = []
# Only process if stats exist...
if not self.stats:
# Only process if stats exist and plugin not disable
if not self.stats or args.disable_cpu:
return ret
# Build the string message
......
......@@ -136,8 +136,8 @@ class Plugin(GlancesPlugin):
# Init the return message
ret = []
# Only process if stats exist...
if not self.stats:
# Only process if stats exist and plugin not disabled
if not self.stats or args.disable_load:
return ret
# Build the string message
......
......@@ -178,8 +178,8 @@ class Plugin(GlancesPlugin):
# Init the return message
ret = []
# Only process if stats exist...
if not self.stats:
# Only process if stats exist and plugin not disabled
if not self.stats or args.disable_mem:
return ret
# Build the string message
......
......@@ -150,8 +150,8 @@ class Plugin(GlancesPlugin):
# Init the return message
ret = []
# Only process if stats exist...
if not self.stats:
# Only process if stats exist and plugin not disabled
if not self.stats or args.disable_swap:
return ret
# Build the string message
......
......@@ -93,6 +93,10 @@ 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'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册