Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
b7df2051
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 搜索 >>
提交
b7df2051
编写于
1月 11, 2015
作者:
N
Nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Alarm for DiskIO plugin
上级
0ab38218
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
12 deletion
+32
-12
NEWS
NEWS
+2
-1
conf/glances-test.conf
conf/glances-test.conf
+12
-2
glances/plugins/glances_diskio.py
glances/plugins/glances_diskio.py
+14
-6
glances/plugins/glances_network.py
glances/plugins/glances_network.py
+4
-3
未找到文件。
NEWS
浏览文件 @
b7df2051
...
...
@@ -14,7 +14,8 @@ Enhancements and news features:
* The Web inteface is now based on BootStarp / RWD grid (issue #417, #366 and #461) Thanks to Nicolas Hart @nclsHart
* Add the RAID plugin (issue #447)
* Add the Docker plugin (issue #440)
* It is possible to define (through teh configuration file) if an alarm should be logged or not (using the _log option) (issue #437)
* It is possible, through the configuration file, to define if an alarm should be logged or not (using the _log option) (issue #437)
* You can now set alarm for Disk IO
Bugs corrected:
...
...
conf/glances-test.conf
浏览文件 @
b7df2051
...
...
@@ -56,7 +56,7 @@ critical=90
# Define the list of hidden network interfaces (comma separeted)
hide
=
lo
# WLAN0 alias name
#
wlan0_alias=Wireless
wlan0_alias
=
Wireless
# WLAN0 Default limits (in bits per second aka bps) for interface bitrate
wlan0_rx_careful
=
4000000
wlan0_rx_warning
=
5000000
...
...
@@ -69,9 +69,19 @@ wlan0_tx_log=True
[
diskio
]
# Define the list of hidden disks (comma separeted)
hide
=
sda
2
,
sda
5
hide
=
sda5
# Alias for sda1
#sda1_alias=IntDisk
# SDA1 limits (in bytes per second aka Bps) for interface bitrate
sda2_rx_careful
=
150000000
sda2_rx_warning
=
180000000
sda2_rx_critical
=
200000000
#sda2_rx_log=True
sda2_tx_careful
=
150000000
sda2_tx_warning
=
180000000
sda2_tx_critical
=
200000000
#sda2_tx_log=True
[
fs
]
# Default limits for free filesytem space in %
...
...
glances/plugins/glances_diskio.py
浏览文件 @
b7df2051
...
...
@@ -43,7 +43,8 @@ class Plugin(GlancesPlugin):
def
__init__
(
self
,
args
=
None
):
"""Init the plugin."""
GlancesPlugin
.
__init__
(
self
,
args
=
args
,
items_history_list
=
items_history_list
)
GlancesPlugin
.
__init__
(
self
,
args
=
args
,
items_history_list
=
items_history_list
)
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -146,9 +147,10 @@ class Plugin(GlancesPlugin):
if
self
.
is_hide
(
i
[
'disk_name'
]):
continue
# Is there an alias for the disk name ?
disk_real_name
=
i
[
'disk_name'
]
disk_name
=
self
.
has_alias
(
i
[
'disk_name'
])
if
disk_name
is
None
:
disk_name
=
i
[
'disk_name'
]
disk_name
=
disk_real_name
# New line
ret
.
append
(
self
.
curse_new_line
())
if
len
(
disk_name
)
>
9
:
...
...
@@ -156,11 +158,17 @@ class Plugin(GlancesPlugin):
disk_name
=
'_'
+
disk_name
[
-
8
:]
msg
=
'{0:9}'
.
format
(
disk_name
)
ret
.
append
(
self
.
curse_add_line
(
msg
))
txps
=
self
.
auto_unit
(
int
(
i
[
'read_bytes'
]
//
i
[
'time_since_update'
]))
rxps
=
self
.
auto_unit
(
int
(
i
[
'write_bytes'
]
//
i
[
'time_since_update'
]))
txps
=
self
.
auto_unit
(
int
(
i
[
'read_bytes'
]
//
i
[
'time_since_update'
]))
rxps
=
self
.
auto_unit
(
int
(
i
[
'write_bytes'
]
//
i
[
'time_since_update'
]))
msg
=
'{0:>7}'
.
format
(
txps
)
ret
.
append
(
self
.
curse_add_line
(
msg
))
ret
.
append
(
self
.
curse_add_line
(
msg
,
self
.
get_alert
(
int
(
i
[
'read_bytes'
]
//
i
[
'time_since_update'
]),
header
=
disk_real_name
+
'_rx'
)))
msg
=
'{0:>7}'
.
format
(
rxps
)
ret
.
append
(
self
.
curse_add_line
(
msg
))
ret
.
append
(
self
.
curse_add_line
(
msg
,
self
.
get_alert
(
int
(
i
[
'write_bytes'
]
//
i
[
'time_since_update'
]),
header
=
disk_real_name
+
'_tx'
)))
return
ret
glances/plugins/glances_network.py
浏览文件 @
b7df2051
...
...
@@ -236,9 +236,10 @@ class Plugin(GlancesPlugin):
continue
# Format stats
# Is there an alias for the interface name ?
ifrealname
=
i
[
'interface_name'
].
split
(
':'
)[
0
]
ifname
=
self
.
has_alias
(
i
[
'interface_name'
])
if
ifname
is
None
:
ifname
=
i
[
'interface_name'
].
split
(
':'
)[
0
]
ifname
=
i
frealname
if
len
(
ifname
)
>
ifname_max_width
:
# Cut interface name if it is too long
ifname
=
'_'
+
ifname
[
-
ifname_max_width
+
1
:]
...
...
@@ -277,10 +278,10 @@ class Plugin(GlancesPlugin):
msg
=
'{0:>7}'
.
format
(
rx
)
ret
.
append
(
self
.
curse_add_line
(
msg
,
self
.
get_alert
(
int
(
i
[
'rx'
]
//
i
[
'time_since_update'
]
*
8
),
header
=
ifname
+
'_rx'
)))
header
=
if
real
name
+
'_rx'
)))
msg
=
'{0:>7}'
.
format
(
tx
)
ret
.
append
(
self
.
curse_add_line
(
msg
,
self
.
get_alert
(
int
(
i
[
'tx'
]
//
i
[
'time_since_update'
]
*
8
),
header
=
ifname
+
'_tx'
)))
header
=
if
real
name
+
'_tx'
)))
return
ret
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录