1GLANCES(1) Glances GLANCES(1)
2
3
4
6 glances - An eye on your system
7
9 glances [OPTIONS]
10
12 glances is a cross-platform curses-based monitoring tool which aims to
13 present a maximum of information in a minimum of space, ideally to fit
14 in a classical 80x24 terminal or higher to have additional information.
15 It can adapt dynamically the displayed information depending on the
16 terminal size. It can also work in client/server mode. Remote monitor‐
17 ing could be done via terminal or web interface.
18
19 glances is written in Python and uses the psutil library to get infor‐
20 mation from your system.
21
24 -h, --help
25 show this help message and exit
26
27 -V, --version
28 show program’s version number and exit
29
30 -d, --debug
31 enable debug mode
32
33 -C CONF_FILE, --config CONF_FILE
34 path to the configuration file
35
36 --modules-list
37 display modules (plugins & exports) list and exit
38
39 --disable-plugin PLUGIN
40 disable PLUGIN (comma separed list)
41
42 --enable-plugin PLUGIN
43 enable PLUGIN (comma separed list)
44
45 --stdout PLUGINS_STATS
46 display stats to stdout (comma separated list of plugins/plug‐
47 ins.attribute)
48
49 --export EXPORT
50 enable EXPORT module (comma separed list)
51
52 --export-csv-file EXPORT_CSV_FILE
53 file path for CSV exporter
54
55 --export-json-file EXPORT_JSON_FILE
56 file path for JSON exporter
57
58 --disable-process
59 disable process module (reduce Glances CPU consumption)
60
61 --disable-webui
62 disable the Web UI (only the RESTful API will respond)
63
64 --light, --enable-light
65 light mode for Curses UI (disable all but top menu)
66
67 -0, --disable-irix
68 task’s CPU usage will be divided by the total number of CPUs
69
70 -1, --percpu
71 start Glances in per CPU mode
72
73 -2, --disable-left-sidebar
74 disable network, disk I/O, FS and sensors modules
75
76 -3, --disable-quicklook
77 disable quick look module
78
79 -4, --full-quicklook
80 disable all but quick look and load
81
82 -5, --disable-top
83 disable top menu (QuickLook, CPU, MEM, SWAP and LOAD)
84
85 -6, --meangpu
86 start Glances in mean GPU mode
87
88 --enable-history
89 enable the history mode
90
91 --disable-bold
92 disable bold mode in the terminal
93
94 --disable-bg
95 disable background colors in the terminal
96
97 --enable-process-extended
98 enable extended stats on top process
99
100 -c CLIENT, --client CLIENT
101 connect to a Glances server by IPv4/IPv6 address, hostname or
102 hostname:port
103
104 -s, --server
105 run Glances in server mode
106
107 --browser
108 start the client browser (list of servers)
109
110 --disable-autodiscover
111 disable autodiscover feature
112
113 -p PORT, --port PORT
114 define the client/server TCP port [default: 61209]
115
116 -B BIND_ADDRESS, --bind BIND_ADDRESS
117 bind server to the given IPv4/IPv6 address or hostname
118
119 --username
120 define a client/server username
121
122 --password
123 define a client/server password
124
125 --snmp-community SNMP_COMMUNITY
126 SNMP community
127
128 --snmp-port SNMP_PORT
129 SNMP port
130
131 --snmp-version SNMP_VERSION
132 SNMP version (1, 2c or 3)
133
134 --snmp-user SNMP_USER
135 SNMP username (only for SNMPv3)
136
137 --snmp-auth SNMP_AUTH
138 SNMP authentication key (only for SNMPv3)
139
140 --snmp-force
141 force SNMP mode
142
143 -t TIME, --time TIME
144 set refresh time in seconds [default: 3 sec]
145
146 -w, --webserver
147 run Glances in web server mode (bottle lib needed)
148
149 --cached-time CACHED_TIME
150 set the server cache time [default: 1 sec]
151
152 open-web-browser
153 try to open the Web UI in the default Web browser
154
155 -q, --quiet
156 do not display the curses interface
157
158 -f PROCESS_FILTER, --process-filter PROCESS_FILTER
159 set the process filter pattern (regular expression)
160
161 --process-short-name
162 force short name for processes name
163
164 --hide-kernel-threads
165 hide kernel threads in process list (not available on Windows)
166
167 -b, --byte
168 display network rate in byte per second
169
170 --diskio-show-ramfs
171 show RAM FS in the DiskIO plugin
172
173 --diskio-iops
174 show I/O per second in the DiskIO plugin
175
176 --fahrenheit
177 display temperature in Fahrenheit (default is Celsius)
178
179 --fs-free-space
180 display FS free space instead of used
181
182 --theme-white
183 optimize display colors for white background
184
185 --disable-check-update
186 disable online Glances version ckeck
187
189 The following commands (key pressed) are supported while in Glances:
190
191 ENTER Set the process filter
192
193 NOTE:
194 On macOS please use CTRL-H to delete filter.
195
196 Filter is a regular expression pattern:
197
198 · gnome: matches all processes starting with the gnome string
199
200 · .*gnome.*: matches all processes containing the gnome string
201
202 a Sort process list automatically
203
204 · If CPU >70%, sort processes by CPU usage
205
206 · If MEM >70%, sort processes by MEM usage
207
208 · If CPU iowait >60%, sort processes by I/O read and write
209
210 A Enable/disable Application Monitoring Process
211
212 b Switch between bit/s or Byte/s for network I/O
213
214 B View disk I/O counters per second
215
216 c Sort processes by CPU usage
217
218 d Show/hide disk I/O stats
219
220 D Enable/disable Docker stats
221
222 e Enable/disable top extended stats
223
224 E Erase current process filter
225
226 f Show/hide file system and folder monitoring stats
227
228 F Switch between file system used and free space
229
230 g Generate graphs for current history
231
232 h Show/hide the help screen
233
234 i Sort processes by I/O rate
235
236 I Show/hide IP module
237
238 k Show/hide TCP connections
239
240 l Show/hide log messages
241
242 m Sort processes by MEM usage
243
244 M Reset processes summary min/max
245
246 n Show/hide network stats
247
248 N Show/hide current time
249
250 p Sort processes by name
251
252 q|ESC|CTRL-C
253 Quit the current Glances session
254
255 Q Show/hide IRQ module
256
257 r Reset history
258
259 R Show/hide RAID plugin
260
261 s Show/hide sensors stats
262
263 t Sort process by CPU times (TIME+)
264
265 T View network I/O as combination
266
267 u Sort processes by USER
268
269 U View cumulative network I/O
270
271 w Delete finished warning log messages
272
273 W Show/hide Wifi module
274
275 x Delete finished warning and critical log messages
276
277 z Show/hide processes stats
278
279 0 Enable/disable Irix/Solaris mode
280
281 Task’s CPU usage will be divided by the total number of CPUs
282
283 1 Switch between global CPU and per-CPU stats
284
285 2 Enable/disable left sidebar
286
287 3 Enable/disable the quick look module
288
289 4 Enable/disable all but quick look and load module
290
291 5 Enable/disable top menu (QuickLook, CPU, MEM, SWAP and LOAD)
292
293 6 Enable/disable mean GPU mode
294
295 / Switch between process command line or command name
296
297 In the Glances client browser (accessible through the --browser command
298 line argument):
299
300 ENTER Run the selected server
301
302 UP Up in the servers list
303
304 DOWN Down in the servers list
305
306 q|ESC Quit Glances
307
309 No configuration file is mandatory to use Glances.
310
311 Furthermore a configuration file is needed to access more settings.
312
314 NOTE:
315 A template is available in the /usr{,/local}/share/doc/glances
316 (Unix-like) directory or directly on GitHub.
317
318 You can put your own glances.conf file in the following locations:
319
320 ┌─────────────┬────────────────────────────┐
321 │Linux, SunOS │ ~/.config/glances, │
322 │ │ /etc/glances │
323 ├─────────────┼────────────────────────────┤
324 │*BSD │ ~/.config/glances, │
325 │ │ /usr/local/etc/glances │
326 ├─────────────┼────────────────────────────┤
327 │macOS │ ~/Library/Application Sup‐ │
328 │ │ port/glances, │
329 │ │ /usr/local/etc/glances │
330 ├─────────────┼────────────────────────────┤
331 │Windows │ %APPDATA%\glances │
332 └─────────────┴────────────────────────────┘
333
334 · On Windows XP, %APPDATA% is: C:\Documents and Settings\<USER‐
335 NAME>\Application Data.
336
337 · On Windows Vista and later: C:\Users\<USERNAME>\AppData\Roaming.
338
339 User-specific options override system-wide options and options given on
340 the command line override either.
341
343 Glances reads configuration files in the ini syntax.
344
345 A first section (called global) is available:
346
347 [global]
348 # Does Glances should check if a newer version is available on PyPI?
349 check_update=true
350
351 Each plugin, export module and application monitoring process (AMP) can
352 have a section. Below an example for the CPU plugin:
353
354 [cpu]
355 disable=False
356 user_careful=50
357 user_warning=70
358 user_critical=90
359 iowait_careful=50
360 iowait_warning=70
361 iowait_critical=90
362 system_careful=50
363 system_warning=70
364 system_critical=90
365 steal_careful=50
366 steal_warning=70
367 steal_critical=90
368
369 an InfluxDB export module:
370
371 [influxdb]
372 # Configuration for the --export influxdb option
373 # https://influxdb.com/
374 host=localhost
375 port=8086
376 user=root
377 password=root
378 db=glances
379 prefix=localhost
380 #tags=foo:bar,spam:eggs
381
382 or a Nginx AMP:
383
384 [amp_nginx]
385 # Nginx status page should be enable (https://easyengine.io/tutorials/nginx/status-page/)
386 enable=true
387 regex=\/usr\/sbin\/nginx
388 refresh=60
389 one_line=false
390 status_url=http://localhost/nginx_status
391
392 With Glances 3.0 or higher it is also possible to use dynamic configu‐
393 ration value using system command. For example, if you to set the pre‐
394 fix of an InfluxDB export to the current hostname, use:
395
396 [influxdb]
397 ...
398 prefix=`hostname`
399
400 Or if you want to add the Operating System name as a tag:
401
402 [influxdb]
403 ...
404 tags=system:`uname -a`
405
407 Glances logs all of its internal messages to a log file.
408
409 DEBUG messages can been logged using the -d option on the command line.
410
411 The location of the Glances depends of your operating system. You could
412 displayed the Glances log file full path using the``glances -V`` com‐
413 mand line.
414
415 The file is automatically rotate when the size is higher than 1 MB.
416
417 If you want to use another system path or change the log message, you
418 can use your own logger configuration. First of all, you have to create
419 a glances.json file with, for example, the following content (JSON for‐
420 mat):
421
422 {
423 "version": 1,
424 "disable_existing_loggers": "False",
425 "root": {
426 "level": "INFO",
427 "handlers": ["file", "console"]
428 },
429 "formatters": {
430 "standard": {
431 "format": "%(asctime)s -- %(levelname)s -- %(message)s"
432 },
433 "short": {
434 "format": "%(levelname)s: %(message)s"
435 },
436 "free": {
437 "format": "%(message)s"
438 }
439 },
440 "handlers": {
441 "file": {
442 "level": "DEBUG",
443 "class": "logging.handlers.RotatingFileHandler",
444 "formatter": "standard",
445 "filename": "/var/tmp/glances.log"
446 },
447 "console": {
448 "level": "CRITICAL",
449 "class": "logging.StreamHandler",
450 "formatter": "free"
451 }
452 },
453 "loggers": {
454 "debug": {
455 "handlers": ["file", "console"],
456 "level": "DEBUG"
457 },
458 "verbose": {
459 "handlers": ["file", "console"],
460 "level": "INFO"
461 },
462 "standard": {
463 "handlers": ["file"],
464 "level": "INFO"
465 },
466 "requests": {
467 "handlers": ["file", "console"],
468 "level": "ERROR"
469 },
470 "elasticsearch": {
471 "handlers": ["file", "console"],
472 "level": "ERROR"
473 },
474 "elasticsearch.trace": {
475 "handlers": ["file", "console"],
476 "level": "ERROR"
477 }
478 }
479 }
480
481 and start Glances using the following command line:
482
483 LOG_CFG=<path>/glances.json glances
484
485 NOTE:
486 Replace <path> by the folder where your glances.json file is hosted.
487
489 Monitor local machine (standalone mode):
490 $ glances
491
492 Monitor local machine with the web interface (Web UI), run the follow‐
493 ing command line:
494 $ glances -w
495
496 and open a Web browser with the returned URL
497
498 Monitor local machine and export stats to a CSV file:
499 $ glances –export csv –export-csv-file /tmp/glances.csv
500
501 Monitor local machine and export stats to a InfluxDB server with 5s
502 refresh time (also possible to export to OpenTSDB, Cassandra, Statsd,
503 ElasticSearch, RabbitMQ and Riemann):
504 $ glances -t 5 –export influxdb
505
506 It is also possible to export stats to multiple endpoints:
507 $ glances -t 5 –export influxdb,statsd,csv
508
509 Start a Glances server (server mode):
510 $ glances -s
511
512 Connect Glances to a Glances server (client mode):
513 $ glances -c <ip_server>
514
515 Connect to a Glances server and export stats to a StatsD server:
516 $ glances -c <ip_server> –export statsd
517
518 Start the client browser (browser mode):
519 $ glances –browser
520
522 Nicolas Hennion aka Nicolargo <contact@nicolargo.com>
523
525 2020, Nicolas Hennion
526
527
528
529
5303.1.4 Mar 10, 2020 GLANCES(1)