CSV

It’s possible to export stats to a CSV file.

$ glances --export csv --export-csv-file /tmp/glances.csv --quiet

CSV file description:

  • first line: Stats description (header)

  • others lines: Stats (data)

Columns are fixed by the first sample. If a device disappears, its columns are left empty. Devices or fields first seen later are not added to the file; start a new export to include them. Existing columns stay aligned with their headers.

By default, data will be append any existing CSV file (if header are compliant).

If the header did not match with a previous one, an error is logged.

The –export-csv-overwrite tag should be used if you want to delete the existing CSV file when Glances starts.

It is possible to remove some exported data using the –disable-plugin tag:

$ glances –export csv –export-csv-file /tmp/glances.csv –disable-plugin load,swap –quiet

or by only enable some plugins:

$ glances –export csv –export-csv-file /tmp/glances.csv –disable-plugin all –enable-plugin cpu,mem,load –quiet