@@ -199,4 +199,67 @@ Accumulated per program — key 'j'
199
199
When activated ('j' hotkey or --programs option in the command line), processes are merged
200
200
to display which programs are active. The columns show the accumulated cpu consumption, the
201
201
accumulated virtual and resident memory consumption, the accumulated transferred data I/O.
202
- The PID columns is replaced by a NPROCS column which is the number of processes.
202
+ The PID columns is replaced by a NPROCS column which is the number of processes.
203
+
204
+ Export process
205
+ --------------
206
+
207
+ Glances version 4 introduces a new feature to export specifics processes. In order to use this
208
+ feature, you need to use the export option in the processlist section of the Glances configuration
209
+ file or the --export-process-filter option in the command line.
210
+
211
+ The export option is a list of Glances filters.
212
+
213
+ Example number one, export all processes named 'python' (or with a command line containing 'python'):
214
+
215
+ .. code-block :: ini
216
+
217
+ [processlist]
218
+ export =.*python.*
219
+
220
+ Note: or the --export-process-filter ".*python.*" option in the command line.
221
+
222
+ Example number two, export all processes with the name 'python' or 'bash':
223
+
224
+ .. code-block :: ini
225
+
226
+ [processlist]
227
+ export =.*python.*,.*bash.*
228
+
229
+ Note: or the --export-process-filter ".*python.*,.*bash.*" option in the command line.
230
+
231
+ Example number three, export all processes belong to 'nicolargo' user:
232
+
233
+ .. code-block :: ini
234
+
235
+ [processlist]
236
+ export =username:nicolargo
237
+
238
+ Note: or the --export-process-filter "username:nicolargo" option in the command line.
239
+
240
+ The output of the export use the PID as the key (for example if you want to export firefox process
241
+ to a CSV file):
242
+
243
+ Configuration file (glances.conf):
244
+
245
+ .. code-block :: ini
246
+
247
+ [processlist]
248
+ export =.*firefox.*
249
+
250
+ Note: or the --export-process-filter ".*firefox.*" option in the command line.
251
+
252
+ Command line example:
253
+
254
+ .. code-block :: bash
255
+
256
+ glances -C ./conf/glances.conf --export csv --export-csv-file /tmp/glances.csv --disable-plugin all --enable-plugin processlist --quiet
257
+
258
+ the result will be:
259
+
260
+ .. code-block :: csv
261
+
262
+ timestamp,845992.memory_percent,845992.status,845992.num_threads,845992.cpu_timesuser,845992.cpu_timessystem,845992.cpu_timeschildren_user,845992.cpu_timeschildren_system,845992.cpu_timesiowait,845992.memory_inforss,845992.memory_infovms,845992.memory_infoshared,845992.memory_infotext,845992.memory_infolib,845992.memory_infodata,845992.memory_infodirty,845992.name,845992.io_counters,845992.nice,845992.cpu_percent,845992.pid,845992.gidsreal,845992.gidseffective,845992.gidssaved,845992.key,845992.time_since_update,845992.cmdline,845992.username,total,running,sleeping,thread,pid_max
263
+ 2024-04-03 18:39:55,3.692938041968513,S,138,1702.88,567.89,1752.79,244.18,0.0,288919552,12871561216,95182848,856064,0,984535040,0,firefox,1863281664,0,0.5,845992,1000,1000,1000,pid,2.2084147930145264,/snap/firefox/3836/usr/lib/firefox/firefox,nicolargo,403,1,333,1511,0
264
+ 2024-04-03 18:39:57,3.692938041968513,S,138,1702.88,567.89,1752.79,244.18,0.0,288919552,12871561216,95182848,856064,0,984535040,0,firefox,1863281664,0,0.5,845992,1000,1000,1000,pid,2.2084147930145264,/snap/firefox/3836/usr/lib/firefox/firefox,nicolargo,403,1,333,1511,0
265
+
0 commit comments