Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
4bfe32c6
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 搜索 >>
提交
4bfe32c6
编写于
6月 17, 2016
作者:
N
Nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add ICMP (system call to ping) in the Glances port plugin
上级
a38b6b48
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
18 deletion
+26
-18
conf/glances.conf
conf/glances.conf
+15
-12
glances/amps/glances_amp.py
glances/amps/glances_amp.py
+1
-1
glances/ports_list.py
glances/ports_list.py
+10
-5
未找到文件。
conf/glances.conf
浏览文件 @
4bfe32c6
...
...
@@ -180,25 +180,28 @@ mem_warning=70
mem_critical
=
90
[
ports
]
#
TCP
Ports scanner plugin configuration
# Ports scanner plugin configuration
# Interval in second between scan
refresh
=
30
# Set the
timeout for a scan
# Set the
default timeout for a scan (can be overwrite in the scan list)
timeout
=
3
# Define the scan list
# host (name or IP) and port (TCP) are mandatory
# description is optinal (set to host:port)
# host (name or IP) is mandatory
# port is optional (set to 0 = ICMP check by default)
# description is optional (set to host:port)
port_1_host
=
www
.
google
.
com
port_1_port
=
443
port_1_description
=
Internet
port_2_host
=
www
.
free
.
fr
port_2_port
=
80
port_2_description
=
ISP
port_3_host
=
192
.
168
.
0
.
1
port_3_port
=
80
port_3_description
=
Home
Box
port_4_host
=
192
.
168
.
5
.
1
port_1_description
=
Internet
Web
port_2_host
=
www
.
google
.
com
port_2_description
=
Internet
Ping
port_3_host
=
www
.
free
.
fr
port_3_description
=
Free
ISP
port_4_host
=
192
.
168
.
0
.
1
port_4_port
=
80
port_5_description
=
Home
Box
port_5_host
=
192
.
168
.
5
.
1
port_5_port
=
80
port_5_timeout
=
2
##############################################################################
# Client/server
...
...
glances/amps/glances_amp.py
浏览文件 @
4bfe32c6
...
...
@@ -107,7 +107,7 @@ class GlancesAmp(object):
logger
.
warning
(
"{}: Can not find configuration key {} in section {}"
.
format
(
self
.
NAME
,
k
,
self
.
amp_name
))
self
.
configs
[
'enable'
]
=
'false'
else
:
logger
.
warnin
g
(
"{} is disabled"
.
format
(
self
.
NAME
))
logger
.
debu
g
(
"{} is disabled"
.
format
(
self
.
NAME
))
# Init the count to 0
self
.
configs
[
'count'
]
=
0
...
...
glances/ports_list.py
浏览文件 @
4bfe32c6
...
...
@@ -53,14 +53,17 @@ class GlancesPortsList(object):
new_port
=
{}
postfix
=
'port_%s_'
%
str
(
i
)
# Read mandatories configuration keys: host and port
for
s
in
[
'host'
,
'port'
]:
new_port
[
s
]
=
config
.
get_value
(
self
.
_section
,
'%s%s'
%
(
postfix
,
s
))
# Read mandatories configuration key: host
new_port
[
'host'
]
=
config
.
get_value
(
self
.
_section
,
'%s%s'
%
(
postfix
,
'host'
))
if
new_port
[
'host'
]
is
None
or
new_port
[
'port'
]
is
None
:
if
new_port
[
'host'
]
is
None
:
continue
# Read optionals configuration keys
# Port is set to 0 by default. 0 mean ICMP check instead of TCP check
new_port
[
'port'
]
=
config
.
get_value
(
self
.
_section
,
'%s%s'
%
(
postfix
,
'port'
),
0
)
new_port
[
'description'
]
=
config
.
get_value
(
self
.
_section
,
'%sdescription'
%
postfix
,
default
=
"%s:%s"
%
(
new_port
[
'host'
],
new_port
[
'port'
]))
...
...
@@ -72,7 +75,9 @@ class GlancesPortsList(object):
new_port
[
'refresh'
]
=
refresh
# Timeout in second
new_port
[
'timeout'
]
=
timeout
new_port
[
'timeout'
]
=
config
.
get_value
(
self
.
_section
,
'%stimeout'
%
postfix
,
default
=
timeout
)
# Add the server to the list
logger
.
debug
(
"Add port %s:%s to the static list"
%
(
new_port
[
'host'
],
new_port
[
'port'
]))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录