summaryrefslogtreecommitdiffstats
path: root/index.html
blob: 59603b94730950921c58ef1545dc31b1c0a3c3fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />

    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <title>Glances by nicolargo</title>
  </head>

  <body>
    <header>
      <div class="inner">
        <h1>Glances</h1>
        <h2>Glances an Eye on your system</h2>
        <a href="https://github.com/nicolargo/glances" class="button"><small>View project on</small>GitHub</a>
      </div>
    </header>

    <div id="content-wrapper">
      <div class="inner clearfix">
        <section id="main-content">
          <p><a href="https://flattr.com/thing/484466/nicolargoglances-on-GitHub"><img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this git repo"></a></p>

<h1>Glances -- Eye on your system</h1>

<h2>Description</h2>

<p>Glances is a CLI curses based monitoring tool for GNU/Linux and BSD OS.</p>

<p>Glances uses the PsUtil library to get information from your system.</p>

<p>It is developed in Python.</p>

<p>Console (80x24) screenshot:</p>

<p><img src="https://github.com/nicolargo/glances/raw/master/screenshot.png" alt="screenshot"></p>

<p>Wide terminal (&gt; 90x24) screenshot:</p>

<p><img src="https://github.com/nicolargo/glances/raw/master/screenshot-wide.png" alt="screenshot"></p>

<h2>Installation</h2>

<h3>From packets manager (clean and easy way)</h3>

<p>Note: Packets are maintained by contibutors. It's not sure to have the latest Glances version.</p>

<ul>
<li>ArchLinux: <a href="http://aur.archlinux.org/packages.php?ID=54666">In the AUR repository</a></li>
<li>CentOS: <a href="https://github.com/nicolargo/glances/wiki/Install:-On-CentOS-6.x-with-EPEL-repository">Using EPEL and Pip</a></li>
<li><a href="https://apps.fedoraproject.org/packages/glances">Fedora</a></li>
<li><a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=171517">FreeBSD</a></li>
<li><a href="http://packages.gentoo.org/package/sys-process/glances">Gentoo</a></li>
<li><a href="http://rpm.pbone.net/">Redhat</a></li>
<li><a href="https://launchpad.net/~arnaud-hartmann/+archive/glances-stable">Ubuntu (see instructions bellow)</a></li>
</ul>

<h3>From PyPi (easy and cross platform way)</h3>

<p>PyPi is an official Python package manager.</p>

<p>You first need to install pypi on your system.</p>

<p>For example on Debian/Ubuntu:</p>

<pre><code>$ sudo apt-get update
$ sudo apt-get install python-pip build-essential python-dev
</code></pre>

<p>or for CentOS/Fedora/RH:</p>

<pre><code>
$ sudo rpm -ivh http://fr2.rpmfind.net/linux/epel/6/x86_64/epel-release-6-7.noarch.rpm
$ sudo yum install python-pip python-dev
</code></pre>

<p>Then install the latest Glances version:</p>

<pre><code>$ sudo pip install glances
</code></pre>

<p>Note: if you are behind an HTTP Proxy, you should use</p>

<pre><code>$ sudo pip install --proxy=user:password@url:port glances
</code></pre>

<p>If you want to upgrade Glances to the latest version:</p>

<pre><code>$ sudo pip install --upgrade glances
</code></pre>

<h3>From PPA (easy way for Ubuntu/Mint...)</h3>

<p>Arnaud Hartmann (thanks to him !) maintains a PPA with the latest Glances version:</p>

<p>The PPA is available for Ubuntu version 9.10 to 12.04.</p>

<p>To install the PPA just enter:</p>

<pre><code>$ sudo add-apt-repository ppa:arnaud-hartmann/glances-stable
$ sudo apt-get update
</code></pre>

<p>Then install Glances:</p>

<pre><code>$ sudo apt-get install glances
</code></pre>

<h3>From our Puppet Master</h3>

<p>Remi Verchere has created <a href="https://github.com/rverchere/puppet-glances">a Glances module for Puppet</href>.</p>

<h3>From <a href="http://mxcl.github.com/homebrew/">Homebrew</a> via PyPi (OS X)</h3>

<pre><code>$ brew install brew-pip
$ export PYTHONPATH=$(brew --prefix)/lib/python2.7/site-packages
$ brew pip Glances
</code></pre>

<h3>From source</h3>

<p>Get the latest version:</p>

<pre><code>$ rm -rf /tmp/nicolargo-glances-* 
$ wget -O /tmp/glances-last.tgz https://github.com/nicolargo/glances/tarball/master
</code></pre>

<p>Glances use a standard GNU style installer (for a Debian like system):</p>

<pre><code>$ sudo apt-get update
$ sudo apt-get install python-setuptools build-essential python-dev
$ cd /tmp
$ tar zxvf glances-last.tgz
$ cd nicolargo-glances-*
$ sudo python setup.py install
</code></pre>

<p>Pre-requisites (information for packagers):</p>

<ul>
<li>Python 2.6+ (not tested with Python 3+)</li>
<li>build-essential (for installation via Pypi and setup.py)</li>
<li>python-dev (for installation via Pypi)</li>
<li>python-setuptools (for the installation via setup.py)</li>
<li>python-psutil 0.4.1+ (replace the old libstatgrab's lib)</li>
<li>python-jinja2 2.0+ (optional for HTML export)</li>
</ul>

<h2>Running</h2>

<p>Easy way (that's all folks !):</p>

<pre><code>$ glances
</code></pre>

<h2>User guide</h2>

<p>By default, stats are refreshed every second, to change this setting, you can
use the -t option. For example to set the refresh rate to 5 seconds:</p>

<pre><code>$ glances -t 5
</code></pre>

<p>Importants stats are colored:</p>

<ul>
<li>GREEN:   stat counter is "OK"</li>
<li>BLUE:    stat counter is "CAREFUL"</li>
<li>MAGENTA: stat counter is "WARNING"</li>
<li>RED:     stat counter is "CRITICAL"</li>
</ul><p>When Glances is running, you can press:</p>

<ul>
<li>'h' to display a help message with the keys you can press</li>
<li>
<p>'a' to set the automatic mode. The processes are sorted automatically</p>

<p>If CPU &gt; 70%, sort by process "CPU consumption"</p>

<p>If MEM &gt; 70%, sort by process "memory size"</p>
</li>
<li><p>'c' to sort the processes list by CPU consumption</p></li>
<li><p>'d' Disable or enable the disk IO stats</p></li>
<li><p>'f' Disable or enable the file system stats</p></li>
<li><p>'l' Disable or enable the logs</p></li>
<li><p>'m' to sort the processes list by process MEM</p></li>
<li><p>'n' Disable or enable the network interfaces stats</p></li>
<li><p>'p' to sort by process name</p></li>
<li><p>'q' Exit</p></li>
</ul><h3>Header</h3>

<p><img src="https://github.com/nicolargo/glances/raw/master/doc/header.png" alt="screenshot"></p>

<p>The header shows the host name and the operating system name, version and architecture.</p>

<h3>CPU</h3>

<p>Short view:</p>

<p><img src="https://github.com/nicolargo/glances/raw/master/doc/cpu.png" alt="screenshot"></p>

<p>Long view (only available if your terminal is wide enough). The CPU stats are shown as a percentage and for the configured refresh
time. The total CPU usage is displayed on the first line.</p>

<p><img src="https://github.com/nicolargo/glances/raw/master/doc/percpu.png" alt="screenshot"></p>

<p>If horizontal space is available, per core CPU infomations are displayed. </p>

<p>Color code used:</p>

<p>If user|kernel|nice CPU is &lt; 50%, then status is set to "OK".</p>

<p>If user|kernel|nice CPU is &gt; 50%, then status is set to "CAREFUL".</p>

<p>If user|kernel|nice CPU is &gt; 70%, then status is set to "WARNING".</p>

<p>If user|kernel|nice CPU is &gt; 90%, then status is set to "CRITICAL".</p>

<h3>Load</h3>

<p><img src="https://github.com/nicolargo/glances/raw/master/doc/load.png" alt="screenshot"></p>

<p>On the Nosheep blog, Zach defines 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."</p>

<p>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. The first line 
also display the number of CPU core.</p>

<p>If average load is &lt; O.7*Core, then status is set to "OK".</p>

<p>If average load is &gt; O.7*Core, then status is set to "CAREFUL".</p>

<p>If average load is &gt; 1*Core, then status is set to "WARNING".</p>

<p>If average load is &gt; 5*Core, then status is set to "CRITICAL".</p>

<h3>Memory</h3>

<p><img src="https://github.com/nicolargo/glances/raw/master/doc/mem.png" alt="screenshot"></p>

<p>Glances uses three columns: memory (RAM), "real" and swap.</p>

<p>Real used memory is: used - cache.</p>

<p>Real free memory is: free + cache.</p>

<p>With Glances, alerts are only set for on used swap and real memory.</p>

<p>If memory is &lt; 50%, then status is set to "OK".</p>

<p>If memory is &gt; 50%, then status is set to "CAREFUL".</p>

<p>If memory is &gt; 70%, then status is set to "WARNING".</p>

<p>If memory is &gt; 90%, then status is set to "CRITICAL".</p>

<h3>Network bit rate</h3>

<p><img src="https://github.com/nicolargo/glances/raw/master/doc/network.png" alt="screenshot"></p>

<p>Glances display the network interface bit rate. The unit is adapted
dynamicaly (bits per second, Kbits per second, Mbits per second...).</p>

<p>Alerts are set only if the network interface maximum speed is available.</p>

<p>If bit rate is &lt; 50%, then status is set to "OK".</p>

<p>If bit rate is &gt; 50%, then status is set to "CAREFUL".</p>

<p>If bit rate is &gt; 70%, then status is set to "WARNING".</p>

<p>If bit rate is &gt; 90%, then status is set to "CRITICAL".</p>

<p&g