Skip to content

lemano summary

Show what changed on your servers, who did it, and what needs you

Description

Show what changed on the targets in a period, who changed it, and what
needs attention, from what the store recorded. It reads the store only and
connects to no server: a scheduled job runs lemano discover, then lemano
summary.

The period is the last 24 hours, ending now. --since takes another Go
duration (48h, 168h), or baseline for each target's changes since its
accepted baseline (see lemano baseline).

The text starts with one line, for example:

  14 servers since yesterday 09:00: 2 changed, 1 not read, 11 unchanged.

When nothing needs attention, that line is the whole output, so the command
can sit in a shell's login file. Otherwise one block follows for each
target that needs attention: first those with an open condition (a changed
host key, a changed machine identity, an unfinished trial), then those not
read as expected (a pass overdue, a blind window open, the latest pass
unreachable, partial or failing to read a kind), then those that changed.
Changes are grouped by kind and cause: package operations by the log that
recorded them ("41 packages upgraded by apt (unattended-upgrade)"), other
objects by who changed them ("File /etc/hosts changed by alice (sudo)"),
or "(unknown)". Reverts and trials are named. Each block ends with the
commands to look closer or act. Unchanged targets are only counted.

-o json and -o yaml give everything the text shows, unchanged targets
included, under a versioned shape (formatVersion). -o prometheus gives
gauges per target in the Prometheus text format, for node_exporter's
textfile collector. A summary names objects, users and packages; it never
holds a file's content, a sealed value or a command line.

--out FILE writes the output to FILE instead of standard output, through a
temporary file in the same folder renamed over it, so a reader never sees
half a file. A new file gets the mode a shell redirect would give it (0666
less the umask); an existing file keeps its mode.

With --detailed-exitcode, the exit code is 8 when at least one target needs
attention (a condition, not read, or changed; a target without a baseline
does not), 0 otherwise; a failure keeps its own
code.

Synopsis

lemano summary [NAME...] [-l SELECTOR] [--since DURATION|baseline] [-o text|json|yaml|prometheus] [--out FILE]

Examples

lemano summary
lemano summary -l env=prod --since 168h
lemano summary --since baseline
lemano summary -o json --out /var/lib/lemano/summary.json
lemano summary -o prometheus --out /var/lib/node_exporter/textfile/lemano.prom

Flags

FlagTypeDefaultDescription
--detailed-exitcodeexit 8 when at least one target needs attention (a failure still exits with its own code)
--outstringwrite the output to this file, replaced atomically, instead of standard output
-o, --outputstringtextoutput format: text, json, yaml or prometheus
-l, --selectorstringlabel selector: key=value pairs separated by commas, all of which must match
--sincestring24hthe period: a Go duration ending now, or baseline for the changes since each target’s baseline

Flags inherited from parent commands

FlagTypeDefaultDescription
--log-levelstringwarnlog level on standard error: debug, info, warn or error
--no-colornever colour the text (colour is also off when $NO_COLOR is set, when $TERM is dumb and when the output is not a terminal; $FORCE_COLOR turns it on, over $NO_COLOR)
--password-promptask on the terminal for the login password of each target whose file names none
--ssh-configstringssh configuration file that targets’ connection settings are read from, or none to read none (default $LEMANO_SSH_CONFIG, else the files ssh reads)
--storestringpath of the store (default $LEMANO_STORE, else $XDG_DATA_HOME/lemano/lemano.db)
--sudo-password-promptask on the terminal for the sudo password of each target whose file names none

Exit codes

See exit codes.

See also