glances/README

289 lines
7.7 KiB
Plaintext
Raw Normal View History

2012-01-20 18:36:03 +04:00
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=nicolargo&url=https://github.com/nicolargo/glances&title=Glances&language=&tags=github&category=software)
=============================
2011-12-05 16:24:49 +04:00
Glances -- Eye on your system
=============================
## Description
2012-02-14 14:58:04 +04:00
Glances is a CLI curses based monitoring tool for GNU/Linux and BSD OS.
2011-12-05 16:24:49 +04:00
2012-02-14 14:58:04 +04:00
Glances uses the PsUtil library to get information from your system.
2012-02-21 20:23:41 +04:00
2012-02-14 14:58:04 +04:00
It is developed in Python.
2011-12-05 16:24:49 +04:00
![screenshot](https://github.com/nicolargo/glances/raw/master/screenshot.png)
## Installation
2012-02-14 14:58:04 +04:00
### From package manager (very easy way)
2011-12-18 20:34:22 +04:00
2012-03-13 17:23:00 +04:00
Packages exist for Arch, Fedora, Redhat, FreeBSD...
### From PPA (easy way for Ubuntu/Mint...)
Arnaud Hartmann (thanks to him !) maintains a PPA with the latest Glances version:
To install the PPA just enter:
$ sudo add-apt-repository ppa:arnaud-hartmann/glances-dev
$ sudo apt-get update
Then install Glances:
$ sudo apt-get install glances
2012-02-14 14:58:04 +04:00
### From PyPi (easy way)
PyPi is an official Python package manager.
2011-12-18 20:34:22 +04:00
2012-02-14 14:58:04 +04:00
You first need to install pypi on your system. For exemple on Debian/Ubuntu:
$ sudo apt-get install python-pip
Then install the latest Glances version:
$ sudo pip install glances
2011-12-18 20:34:22 +04:00
2012-03-13 17:31:19 +04:00
### From PPA (Ubuntu/Mint)
Thanks to Arnaud Hartmann, a PPA is available for the stable branch.
To install it on your Ubuntu system:
$ sudo add-apt-repository ppa:arnaud-hartmann/glances-stable
$ sudo apt-get update
$ sudo apt-get install glances
The PPA is available for Ubuntu version 9.10 to 12.04.
2011-12-18 20:34:22 +04:00
### From source
2011-12-06 15:03:24 +04:00
Get the latest version:
2012-02-14 14:58:04 +04:00
$ wget https://github.com/downloads/nicolargo/glances/glances-1.4.tar.gz
2011-12-06 15:03:24 +04:00
2011-12-05 16:24:49 +04:00
Glances use a standard GNU style installer:
2012-02-14 14:58:04 +04:00
$ tar zxvf glances-1.4.tar.gz
$ cd glances-1.4
$ sudo python setup.py install
2011-12-05 16:24:49 +04:00
Pre-requisites:
2011-12-06 16:58:25 +04:00
* Python 2.6+ (not tested with Python 3+)
2011-12-05 16:24:49 +04:00
## Running
Easy way (that's all folks !):
2011-12-05 16:24:49 +04:00
$ glances.py
## User guide
2011-12-18 20:34:22 +04:00
By default, stats are refreshed every second, to change this setting, you can
2011-12-05 16:24:49 +04:00
use the -t option. For exemple to set the refrech rate to 5 seconds:
$ glances.py -t 5
Importants stats are colored:
2011-12-18 20:34:22 +04:00
* GREEN: stat counter is "OK"
* BLUE: stat counter is "CAREFUL"
* MAGENTA: stat counter is "WARNING"
* RED: stat counter is "CRITICAL"
2011-12-05 16:24:49 +04:00
When Glances is running, you can press:
2012-01-04 17:24:07 +04:00
* 'h' to display an help message whith the keys you can press
2011-12-18 20:34:22 +04:00
* 'a' to set the automatic mode. The processes are sorted automatically
2011-12-05 16:24:49 +04:00
2011-12-18 20:34:22 +04:00
If CPU > 70%, sort by process "CPU consumption"
2011-12-05 16:24:49 +04:00
2011-12-18 20:34:22 +04:00
If MEM > 70%, sort by process "memory size"
2011-12-05 16:24:49 +04:00
2011-12-18 20:34:22 +04:00
* 'c' to sort the processes list by CPU consumption
2011-12-26 00:35:46 +04:00
* 'd' Disable or enable the disk IO stats
* 'f' Disable or enable the file system stats
2012-01-31 17:37:56 +04:00
* 'l' Disable or enable the logs
2012-07-06 16:03:32 +04:00
* 'm' to sort the processes list by process MEM
2011-12-26 00:35:46 +04:00
* 'n' Disable or enable the network interfaces stats
2012-07-06 16:03:32 +04:00
* 'p' to sort by process name
2011-12-05 16:24:49 +04:00
* 'q' Exit
2011-12-18 20:34:22 +04:00
### Header
![screenshot](https://github.com/nicolargo/glances/raw/master/doc/header.png)
2012-07-06 16:03:32 +04:00
The header shows the host name and the operating system name, version and architecture.
2011-12-18 20:34:22 +04:00
### 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
2012-07-06 16:03:32 +04:00
time. The total CPU usage is displayed on the first line.
2011-12-18 20:34:22 +04:00
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
2011-12-18 20:34:22 +04:00
number currently executing over 1, 5, and 15 minute time periods."
Glances gets the number of CPU cores to adapt the alerts. With Glances,
2012-07-06 16:03:32 +04:00
alerts on average load are only set on 5 and 15 mins. The first line
also display the number of CPU core.
2011-12-18 20:34:22 +04:00
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)
2012-07-06 16:03:32 +04:00
Glances uses tree columns: memory (RAM), "real" and swap.
2011-12-18 20:34:22 +04:00
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
2011-12-18 20:34:22 +04:00
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
2011-12-18 20:34:22 +04:00
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
2011-12-18 20:34:22 +04:00
(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
2011-12-18 20:34:22 +04:00
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
2011-12-18 20:34:22 +04:00
sorted by CPU of memory consumption.
The number of processes in the list is adapted to the screen size.
2012-07-06 16:03:32 +04:00
* VIRT: Virtual memory size (in byte)
* REST: Amount of resident memory (in byte)
* CPU%: % of CPU used by the process
* MEM%: % of MEM used by the process
* PID: Process ID
* USER: Process user ID
* NI: Nice level of the process
* S: Process status
R - Running
D - Sleeping (may not be interrupted)
S - Sleeping (may be interrupted)
T - Traced or stopped
Z - Zombie or "hung" process
* TIME+: Cumulative CPU time used
* NAME: Process name or command line
2012-01-31 17:37:56 +04:00
### Logs
![screenshot](https://github.com/nicolargo/glances/raw/master/doc/logs.png)
A logs list is displayed in the bottom of the screen if (an only if):
* at least one WARNING or CRITICAL alert was occured.
* space is available in the bottom of the console/terminal
There is one line per alert with the following information:
* start date
* end date
* alert name
* (min/avg/max) values
2012-01-31 17:37:56 +04:00
2011-12-18 20:34:22 +04:00
### Footer
![screenshot](https://github.com/nicolargo/glances/raw/master/doc/footer.png)
2012-07-06 16:03:32 +04:00
Glances displays the current time/date and access to the embeded help screen.
2011-12-18 20:34:22 +04:00
2012-01-12 23:48:16 +04:00
## 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
2011-12-05 16:24:49 +04:00
## Todo
You are welcome to contribute to this software.
2012-07-06 16:03:32 +04:00
* Code optimization
* Port to FreeBSD and Mac OS X
* Documentation for HTML and CVS export option