Solve the _() error message

This commit is contained in:
nicolargo 2012-02-14 11:58:04 +01:00
parent 9de0daf990
commit 745434e4c7
6 changed files with 303 additions and 51 deletions

48
README
View File

@ -6,29 +6,41 @@ Glances -- Eye on your system
## Description ## Description
Glances is a CLI curses based monitoring tool for GNU/Linux or BSD OS. Glances is a CLI curses based monitoring tool for GNU/Linux and BSD OS.
Glances uses the libstatgrab library to get information from your system. Glances uses the PsUtil library to get information from your system.
It is developed in Python and uses the python-statgrab lib. It is developed in Python.
![screenshot](https://github.com/nicolargo/glances/raw/master/screenshot.png) ![screenshot](https://github.com/nicolargo/glances/raw/master/screenshot.png)
## Installation ## Installation
### From package manager ### From package manager (very easy way)
Packages exist for Arch, Fedora, Redhat ... Packages exist for Arch, Fedora, Redhat, Ubuntu (with PPA), FreeBSD...
### From PyPi (easy way)
PyPi is an official Python package manager.
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
### From source ### From source
Get the latest version: Get the latest version:
$ wget https://github.com/downloads/nicolargo/glances/glances-1.3.7.tar.gz $ wget https://github.com/downloads/nicolargo/glances/glances-1.4.tar.gz
Glances use a standard GNU style installer: Glances use a standard GNU style installer:
$ tar zxvf glances-1.3.7.tar.gz $ tar zxvf glances-1.4.tar.gz
$ cd glances-1.3.7 $ cd glances-1.4
$ ./configure $ ./configure
$ make $ make
$ sudo make install $ sudo make install
@ -36,22 +48,14 @@ Glances use a standard GNU style installer:
Pre-requisites: Pre-requisites:
* Python 2.6+ (not tested with Python 3+) * Python 2.6+ (not tested with Python 3+)
* python-statgrab 0.5+ (did NOT work with python-statgrab 0.4) * psutil 0.4.1+ (did NOT work with psutil < 0.2 )
Notes: For Debian. Notes: For Debian and Ubuntu < 12.04
The Debian Squeeze repos only include the python-statgrab 0.4. The officials repos only include the psutil version 0.2.1.
You had to install the version 0.5 using the following commands: You had to install the version 0.4.1 using the following commands:
$ sudo apt-get install libstatgrab-dev pkg-config python-dev make $ sudo apt-get install python-dev python-pip
$ wget http://ftp.uk.i-scream.org/sites/ftp.i-scream.org/pub/i-scream/pystatgrab/pystatgrab-0.5.tar.gz $ sudo pip install psutil
$ 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 ## Running

View File

@ -1 +0,0 @@
README

252
README.md Normal file
View File

@ -0,0 +1,252 @@
[![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)
=============================
Glances -- Eye on your system
=============================
## Description
Glances is a CLI curses based monitoring tool for GNU/Linux and BSD OS.
Glances uses the PsUtil library to get information from your system.
It is developed in Python.
![screenshot](https://github.com/nicolargo/glances/raw/master/screenshot.png)
## Installation
### From package manager (very easy way)
Packages exist for Arch, Fedora, Redhat, Ubuntu (with PPA), FreeBSD...
### From PyPi (easy way)
PyPi is an official Python package manager.
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
### From source
Get the latest version:
$ wget https://github.com/downloads/nicolargo/glances/glances-1.4.tar.gz
Glances use a standard GNU style installer:
$ tar zxvf glances-1.4.tar.gz
$ cd glances-1.4
$ ./configure
$ make
$ sudo make install
Pre-requisites:
* Python 2.6+ (not tested with Python 3+)
* psutil 0.4.1+ (did NOT work with psutil < 0.2 )
Notes: For Debian and Ubuntu < 12.04
The officials repos only include the psutil version 0.2.1.
You had to install the version 0.4.1 using the following commands:
$ sudo apt-get install python-dev python-pip
$ sudo pip install psutil
## 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
* 'l' Disable or enable the logs
* '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.
### 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
### 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

View File

@ -1,7 +1,7 @@
# Using buildout to install glances (thx to Benoit !) # Using buildout to install glances (thx to Benoit !)
# #
# Install system dependancies (debian example with python2.7 pinned from wheezy) # Install system dependancies (debian example with python2.7 pinned from wheezy)
# $ sudo apt-get install build-essential libstatgrab-dev python2.7-dev # $ sudo apt-get install build-essential python2.7-dev python-psutil
# #
# Bootstrap buildout # Bootstrap buildout
# $ mkdir glances # $ mkdir glances
@ -18,12 +18,10 @@
# cleanner solution ?) # cleanner solution ?)
# See http://guide.python-distribute.org/creation.html#entry-points # See http://guide.python-distribute.org/creation.html#entry-points
[buildout] [buildout]
parts = parts =
pystatgrab-src psutil-src
pystatgrab-install psutil-install
glances glances
include-site-packages = false include-site-packages = false
@ -31,18 +29,18 @@ allowed-eggs-from-site-packages = false
[config] [config]
glances_version = 1.3.7 glances_version = 1.3.7
pystatgrab_version = 0.5 psutil_version = 0.4.1
pystatgrab_download_url = http://ftp.uk.i-scream.org/sites/ftp.i-scream.org/pub/i-scream/pystatgrab psutil_download_url = http://psutil.googlecode.com/files
[pystatgrab-src] [psutil-src]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${config:pystatgrab_download_url}/pystatgrab-${config:pystatgrab_version}.tar.gz url = ${config:psutil_download_url}/psutil-${config:psutil_version}.tar.gz
[pystatgrab-install] [psutil-install]
recipe= iw.recipe.cmd recipe= iw.recipe.cmd
on_install = true on_install = true
cmds = cmds =
cd ${buildout:directory}/parts/pystatgrab-src/pystatgrab-${config:pystatgrab_version} cd ${buildout:directory}/parts/psutil-src/psutil-${config:psutil_version}
${buildout:executable} setup.py install ${buildout:executable} setup.py install
[glances] [glances]
@ -54,5 +52,5 @@ entry-points = glances=glances:main
eggs = eggs =
glances == ${config:glances_version} glances == ${config:glances_version}
pystatgrab == ${config:pystatgrab_version} psutil == ${config:psutil_version}

View File

@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl Created by Anjuta application wizard. dnl Created by Anjuta application wizard.
AC_INIT(Glances, 1.3.3, , glances) AC_INIT(Glances, 1.4, , glances)
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
@ -13,11 +13,7 @@ AM_SILENT_RULES([yes])
AM_PATH_PYTHON([2.6]) AM_PATH_PYTHON([2.6])
dnl AX_PYTHON_MODULE([statgrab],[needed]) dnl AX_PYTHON_MODULE([psutil],[needed])
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile

View File

@ -11,8 +11,8 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read() return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup( name='Glances', setup( name='Glances',
version='1.3.7', version='1.4',
download_url='https://github.com/downloads/nicolargo/glances/glances-1.3.7.tar.gz', download_url='https://github.com/downloads/nicolargo/glances/glances-1.4.tar.gz',
url='https://github.com/nicolargo/glances', url='https://github.com/nicolargo/glances',
description='CLI curses-based monitoring tool', description='CLI curses-based monitoring tool',
author='Nicolas Hennion', author='Nicolas Hennion',
@ -21,5 +21,5 @@ setup( name='Glances',
keywords = "cli curse monitoring system", keywords = "cli curse monitoring system",
long_description=read('README'), long_description=read('README'),
packages=['src'], packages=['src'],
install_requires=['pystatgrab>=0.5'] install_requires=['psutil>=0.4.1']
) )

View File

@ -37,6 +37,16 @@ try:
except KeyboardInterrupt: except KeyboardInterrupt:
pass pass
# Application informations
#=========================
application = 'glances'
__version__ = "1.4b5"
gettext.install(application)
# Test methods
#=============
try: try:
import curses import curses
import curses.panel import curses.panel
@ -98,13 +108,6 @@ except:
else: else:
psutil_network_io_tag = True psutil_network_io_tag = True
# Application informations
#=========================
application = 'glances'
__version__ = "1.4b4"
gettext.install(application)
# Classes # Classes
#======== #========