Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
8abb57fc
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 搜索 >>
提交
8abb57fc
编写于
1月 18, 2012
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
version 1.3.6
上级
85335fb1
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
477 addition
and
16 deletion
+477
-16
NEWS
NEWS
+1
-0
README
README
+3
-3
README-fr
README-fr
+4
-4
README.md
README.md
+228
-1
README.md
README.md
+228
-1
buildout.cfg
buildout.cfg
+1
-1
man/glances.1
man/glances.1
+1
-1
setup.py
setup.py
+2
-2
src/glances.py
src/glances.py
+9
-3
未找到文件。
NEWS
浏览文件 @
8abb57fc
...
...
@@ -3,6 +3,7 @@ Version 1.3.6
* Add control before libs import
* Change static Python path (issue #20)
* Correct a bug with a network interface disaippear (issue #27)
* Add French and Spanish translation (thx to Jean Bob)
Version 1.3.5
...
...
README
浏览文件 @
8abb57fc
...
...
@@ -20,12 +20,12 @@ Packages exist for Arch, Fedora, Redhat ...
Get the latest version:
$ wget https://github.com/downloads/nicolargo/glances/glances-1.3.
5
.tar.gz
$ wget https://github.com/downloads/nicolargo/glances/glances-1.3.
6
.tar.gz
Glances use a standard GNU style installer:
$ tar zxvf glances-1.3.
5
.tar.gz
$ cd glances-1.3.
5
$ tar zxvf glances-1.3.
6
.tar.gz
$ cd glances-1.3.
6
$ ./configure
$ make
$ sudo make install
...
...
README-fr
浏览文件 @
8abb57fc
...
...
@@ -27,14 +27,14 @@ Le projet Glances est hébergé sur GitHUB: https://github.com/nicolargo/glances
Pour l'installer, il suffit de suivre les instructions suivantes depuis un
terminal.
Récupération de la dernière version (1.3.
5
):
Récupération de la dernière version (1.3.
6
):
$ wget https://github.com/downloads/nicolargo/glances/glances-1.3.
5
.tar.gz
$ wget https://github.com/downloads/nicolargo/glances/glances-1.3.
6
.tar.gz
Procédez ensuite à l'installation:
$ tar zxvf glances-1.3.
5
.tar.gz
$ cd glances-1.3.
5
$ tar zxvf glances-1.3.
6
.tar.gz
$ cd glances-1.3.
6
$ ./configure
$ make
$ sudo make install
...
...
README.md
已删除
120000 → 0
浏览文件 @
85335fb1
README
\ No newline at end of file
README.md
0 → 100644
浏览文件 @
8abb57fc
Glances -- Eye on your system
=============================
## Description
Glances is a CLI curses based monitoring tool for GNU/Linux or BSD OS.
Glances uses the libstatgrab library to get information from your system.
It is developed in Python and uses the python-statgrab lib.
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/screenshot.png
)
## Installation
### From package manager
Packages exist for Arch, Fedora, Redhat ...
### From source
Get the latest version:
$ wget https://github.com/downloads/nicolargo/glances/glances-1.3.6.tar.gz
Glances use a standard GNU style installer:
$ tar zxvf glances-1.3.6.tar.gz
$ cd glances-1.3.6
$ ./configure
$ make
$ sudo make install
Pre-requisites:
*
Python 2.6+ (not tested with Python 3+)
*
python-statgrab 0.5+ (did NOT work with python-statgrab 0.4)
Notes: For Debian.
The Debian Squeeze repos only include the python-statgrab 0.4.
You had to install the version 0.5 using the following commands:
$ sudo apt-get install libstatgrab-dev pkg-config python-dev make
$ wget http://ftp.uk.i-scream.org/sites/ftp.i-scream.org/pub/i-scream/pystatgrab/pystatgrab-0.5.tar.gz
$ tar zxvf pystatgrab-0.5.tar.gz
$ cd pystatgrab-0.5/
$ ./setup.py build
$ sudo ./setup.py install
Notes: For Ubuntu 10.04 and 10.10.
The instruction to install the version 0.5 are here:
https://github.com/nicolargo/glances/issues/5#issuecomment-3033194
## Running
Easy:
$ glances.py
## User guide
By default, stats are refreshed every second, to change this setting, you can
use the -t option. For exemple to set the refrech rate to 5 seconds:
$ glances.py -t 5
Importants stats are colored:
*
GREEN: stat counter is "OK"
*
BLUE: stat counter is "CAREFUL"
*
MAGENTA: stat counter is "WARNING"
*
RED: stat counter is "CRITICAL"
When Glances is running, you can press:
*
'h' to display an help message whith the keys you can press
*
'a' to set the automatic mode. The processes are sorted automatically
If CPU > 70%, sort by process "CPU consumption"
If MEM > 70%, sort by process "memory size"
*
'c' to sort the processes list by CPU consumption
*
'd' Disable or enable the disk IO stats
*
'f' Disable or enable the file system stats
*
'm' to sort the processes list by process size
*
'n' Disable or enable the network interfaces stats
*
'q' Exit
### Header
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/doc/header.png
)
The header shows the Glances version, the host name and the operating
system name, version and architecture.
### CPU
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/doc/cpu.png
)
The CPU states are shown as a percentage and for the configured refresh
time.
If user|kernel|nice CPU is < 50%, then status is set to "OK".
If user|kernel|nice CPU is > 50%, then status is set to "CAREFUL".
If user|kernel|nice CPU is > 70%, then status is set to "WARNING".
If user|kernel|nice CPU is > 90%, then status is set to "CRITICAL".
### Load
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/doc/load.png
)
On the Nosheep blog, Zach defines the average load: "In short it is the
average sum of the number of processes waiting in the run-queue plus the
number currently executing over 1, 5, and 15 minute time periods."
Glances gets the number of CPU cores to adapt the alerts. With Glances,
alerts on average load are only set on 5 and 15 mins.
If average load is < O.7
*
Core, then status is set to "OK".
If average load is > O.7
*
Core, then status is set to "CAREFUL".
If average load is > 1
*
Core, then status is set to "WARNING".
If average load is > 5
*
Core, then status is set to "CRITICAL".
### Memory
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/doc/mem.png
)
Glances uses tree columns: memory (RAM), swap and "real".
Real used memory is: used - cache.
Real free memory is: free + cache.
With Glances, alerts are only set for on used swap and real memory.
If memory is < 50%, then status is set to "OK".
If memory is > 50%, then status is set to "CAREFUL".
If memory is > 70%, then status is set to "WARNING".
If memory is > 90%, then status is set to "CRITICAL".
### Network bit rate
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/doc/network.png
)
Glances display the network interface bit rate. The unit is adapted
dynamicaly (bits per second, Kbits per second, Mbits per second...).
Alerts are set only if the network interface maximum speed is available.
If bitrate is < 50%, then status is set to "OK".
If bitrate is > 50%, then status is set to "CAREFUL".
If bitrate is > 70%, then status is set to "WARNING".
If bitrate is > 90%, then status is set to "CRITICAL".
For exemple, on a 100 Mbps Ethernet interface, the warning status is set
if the bit rate is higher than 70 Mbps.
### Disk I/O
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/doc/diskio.png
)
Glances display the disk I/O throughput. The unit is adapted dynamicaly
(bytes per second, Kbytes per second, Mbytes per second...).
There is no alert on this information.
### Filesystem
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/doc/fs.png
)
Glances display the total and used filesytem disk space. The unit is
adapted dynamicaly (bytes per second, Kbytes per second, Mbytes per
second...).
Alerts are set for used disk space:
If disk used is < 50%, then status is set to "OK".
If disk used is > 50%, then status is set to "CAREFUL".
If disk used is > 70%, then status is set to "WARNING".
If disk used is > 90%, then status is set to "CRITICAL".
### Processes
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/doc/processlist.png
)
Glances displays a summary and a list of processes.
By default (or if you hit the 'a' key) the process list is automaticaly
sorted by CPU of memory consumption.
The number of processes in the list is adapted to the screen size.
### Footer
![
screenshot
](
https://github.com/nicolargo/glances/raw/master/doc/footer.png
)
Glances displays a caption and the current time/date.
## Localisation
To generate french locale execute as root or sudo :
i18n_francais_generate.sh
To generate spanish locale execute as root or sudo :
i18n_espanol_generate.sh
## Todo
You are welcome to contribute to this software.
*
Packaging for Debian, Ubuntu, BSD...
*
Check the needed Python library in the configure.ac
*
Add file system stats when the python-statgrab is corrected
buildout.cfg
浏览文件 @
8abb57fc
...
...
@@ -30,7 +30,7 @@ include-site-packages = false
allowed-eggs-from-site-packages = false
[config]
glances_version = 1.3.
5
glances_version = 1.3.
6
pystatgrab_version = 0.5
pystatgrab_download_url = http://ftp.uk.i-scream.org/sites/ftp.i-scream.org/pub/i-scream/pystatgrab
...
...
man/glances.1
浏览文件 @
8abb57fc
.TH glances 1 "January, 2012" "version 1.3.
5
" "USER COMMANDS"
.TH glances 1 "January, 2012" "version 1.3.
6
" "USER COMMANDS"
.SH NAME
glances \- CLI curses based monitoring tool
.SH SYNOPSIS
...
...
setup.py
浏览文件 @
8abb57fc
...
...
@@ -11,8 +11,8 @@ def read(fname):
return
open
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
fname
)).
read
()
setup
(
name
=
'Glances'
,
version
=
'1.3.
5
'
,
download_url
=
'https://github.com/downloads/nicolargo/glances/glances-1.3.
5
.tar.gz'
,
version
=
'1.3.
6
'
,
download_url
=
'https://github.com/downloads/nicolargo/glances/glances-1.3.
6
.tar.gz'
,
url
=
'https://github.com/nicolargo/glances'
,
description
=
'CLI curses-based monitoring tool'
,
author
=
'Nicolas Hennion'
,
...
...
src/glances.py
浏览文件 @
8abb57fc
...
...
@@ -4,7 +4,7 @@
#
# Pre-requisites: python-statgrab 0.5 or >
#
# Copyright (C) Nicolargo 201
1
<nicolas@nicolargo.com>
# Copyright (C) Nicolargo 201
2
<nicolas@nicolargo.com>
#
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
...
...
@@ -53,7 +53,7 @@ except:
#==================
# The glances version id
__version__
=
"1.3.
5
"
__version__
=
"1.3.
6
"
# Class
#======
...
...
@@ -702,12 +702,18 @@ class glancesScreen():
self
.
term_window
.
addnstr
(
self
.
network_y
,
self
.
network_x
+
10
,
_
(
"Rx/ps"
),
8
)
self
.
term_window
.
addnstr
(
self
.
network_y
,
self
.
network_x
+
20
,
_
(
"Tx/ps"
),
8
)
# Adapt the maximum interface to the screen
ret
=
2
for
i
in
range
(
0
,
min
(
screen_y
-
self
.
network_y
-
3
,
len
(
network
))):
try
:
speed
[
network
[
i
][
'interface_name'
]]
except
:
break
elapsed_time
=
max
(
1
,
network
[
i
][
'systime'
])
self
.
term_window
.
addnstr
(
self
.
network_y
+
1
+
i
,
self
.
network_x
,
network
[
i
][
'interface_name'
]
+
':'
,
8
)
self
.
term_window
.
addnstr
(
self
.
network_y
+
1
+
i
,
self
.
network_x
+
10
,
self
.
__autoUnit
(
network
[
i
][
'rx'
]
/
elapsed_time
*
8
)
+
"b"
,
8
,
self
.
__getColor
(
network
[
i
][
'rx'
]
/
elapsed_time
*
8
,
speed
[
network
[
i
][
'interface_name'
]]))
self
.
term_window
.
addnstr
(
self
.
network_y
+
1
+
i
,
self
.
network_x
+
20
,
self
.
__autoUnit
(
network
[
i
][
'tx'
]
/
elapsed_time
*
8
)
+
"b"
,
8
,
self
.
__getColor
(
network
[
i
][
'tx'
]
/
elapsed_time
*
8
,
speed
[
network
[
i
][
'interface_name'
]]))
return
i
+
3
ret
=
ret
+
1
return
ret
return
0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录