Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
68a91140
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 搜索 >>
提交
68a91140
编写于
1月 10, 2015
作者:
N
Nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add example section in the -h tag
上级
e16f8953
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
6 deletion
+39
-6
glances/core/glances_main.py
glances/core/glances_main.py
+39
-6
未找到文件。
glances/core/glances_main.py
浏览文件 @
68a91140
...
...
@@ -51,6 +51,36 @@ class GlancesMain(object):
username
=
"glances"
password
=
""
# Exemple of use
example_of_use
=
"
\
Examples of use:
\n\
\n\
Monitor local machine (standalone mode):
\n\
$ glances
\n\
\n\
Monitor local machine with the Web interface (Web UI):
\n\
$ glances -w
\n\
Glances web server started on http://0.0.0.0:61208/
\n\
\n\
Monitor local machine and export stats to a CSV file (standalone mode):
\n\
$ glances --export-csv
\n\
\n\
Monitor local machine and export stats to a InfluxDB server with 5s refresh time (standalone mode):
\n\
$ glances -t 5 --export-influxdb -t 5
\n\
\n\
Start a Glances server (server mode):
\n\
$ glances -s
\n\
\n\
Connect Glances to a Glances server (client mode):
\n\
$ glances -c <ip_server>
\n\
\n\
Connect Glances to a Glances server and export stats to a StatsD server (client mode):
\n\
$ glances -c <ip_server> --export-statsd
\n\
\n\
Start the client browser (browser mode):
\n\
$ glances --browser
\n\
"
def
__init__
(
self
):
"""Manage the command line arguments."""
self
.
args
=
self
.
parse_args
()
...
...
@@ -59,7 +89,10 @@ class GlancesMain(object):
"""Init all the command line arguments."""
_version
=
"Glances v"
+
version
+
" with psutil v"
+
psutil_version
parser
=
argparse
.
ArgumentParser
(
prog
=
appname
,
conflict_handler
=
'resolve'
)
prog
=
appname
,
conflict_handler
=
'resolve'
,
formatter_class
=
argparse
.
RawDescriptionHelpFormatter
,
epilog
=
self
.
example_of_use
)
parser
.
add_argument
(
'-V'
,
'--version'
,
action
=
'version'
,
version
=
_version
)
parser
.
add_argument
(
'-d'
,
'--debug'
,
action
=
'store_true'
,
default
=
False
,
...
...
@@ -80,7 +113,7 @@ class GlancesMain(object):
parser
.
add_argument
(
'--disable-docker'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_docker'
,
help
=
_
(
'disable Docker module'
))
parser
.
add_argument
(
'--disable-left-sidebar'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_left_sidebar'
,
help
=
_
(
'disable network, disk io, FS and sensors modules'
))
dest
=
'disable_left_sidebar'
,
help
=
_
(
'disable network, disk io, FS and sensors modules
(need Py3Sensors lib)
'
))
parser
.
add_argument
(
'--disable-process'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_process'
,
help
=
_
(
'disable process module'
))
parser
.
add_argument
(
'--disable-log'
,
action
=
'store_true'
,
default
=
False
,
...
...
@@ -90,16 +123,16 @@ class GlancesMain(object):
parser
.
add_argument
(
'--enable-process-extended'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'enable_process_extended'
,
help
=
_
(
'enable extended stats on top process'
))
parser
.
add_argument
(
'--enable-history'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'enable_history'
,
help
=
_
(
'enable the history mode'
))
dest
=
'enable_history'
,
help
=
_
(
'enable the history mode
(need MatPlotLib lib)
'
))
parser
.
add_argument
(
'--path-history'
,
default
=
tempfile
.
gettempdir
(),
dest
=
'path_history'
,
help
=
_
(
'Set the export path for graph history'
))
# Export modules feature
parser
.
add_argument
(
'--export-csv'
,
default
=
None
,
dest
=
'export_csv'
,
help
=
_
(
'export stats to a CSV file'
))
parser
.
add_argument
(
'--export-influxdb'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'export_influxdb'
,
help
=
_
(
'export stats to an InfluxDB server'
))
dest
=
'export_influxdb'
,
help
=
_
(
'export stats to an InfluxDB server
(need InfluDB lib)
'
))
parser
.
add_argument
(
'--export-statsd'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'export_statsd'
,
help
=
_
(
'export stats to a Statsd server'
))
dest
=
'export_statsd'
,
help
=
_
(
'export stats to a Statsd server
(need StatsD lib)
'
))
# Client/Server option
parser
.
add_argument
(
'-c'
,
'--client'
,
dest
=
'client'
,
help
=
_
(
'connect to a Glances server by IPv4/IPv6 address or hostname'
))
...
...
@@ -132,7 +165,7 @@ class GlancesMain(object):
parser
.
add_argument
(
'-t'
,
'--time'
,
default
=
self
.
refresh_time
,
type
=
float
,
dest
=
'time'
,
help
=
_
(
'set refresh time in seconds [default: {0} sec]'
).
format
(
self
.
refresh_time
))
parser
.
add_argument
(
'-w'
,
'--webserver'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'webserver'
,
help
=
_
(
'run Glances in web server mode'
))
dest
=
'webserver'
,
help
=
_
(
'run Glances in web server mode
(need Bootle lib)
'
))
# Display options
parser
.
add_argument
(
'-f'
,
'--process-filter'
,
default
=
None
,
type
=
str
,
dest
=
'process_filter'
,
help
=
_
(
'set the process filter pattern (regular expression)'
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录