Skip to content

edc v0.68.0

Choose a tag to compare

@github-actions github-actions released this 26 Oct 05:37
· 685 commits to main since this release
4218e6c

Find what is broken now with edc check

edc check is new. It reads ten areas of a Linux host in parallel and prints one PASS, WARN, or FAIL line for each, with the edc command to run next:

  • service: failed units, and units in a state change or auto-restart.
  • process: defunct processes grouped by parent PID, and processes in D state.
  • memory: MemAvailable below 10% warns, below 5% fails.
  • disk: use or inode use at 90% warns, at 95% fails. A read-only mount warns. Image file systems such as squashfs are not judged.
  • kernel: OOM kills, disk I/O errors, read-only remounts, lockups, and oops in the last hour.
  • time, network, container, filehandles, and reboot: clock sync, default route and nameservers, conntrack and TCP memory use, failed or unhealthy containers, fs.file-max use, and a pending reboot or a newer installed kernel.

A FAIL makes the exit code 1, like the other diagnose commands. A source that does not answer within --timeout, such as df on a hung NFS mount, makes its check skip instead of holding the command. A source that cannot be read shows skip or a warning, not pass. edc does not judge counters that only grow after boot, such as NIC drops, because one reading cannot show when they changed. On macOS, edc check prints one skip line.

Check every host of a group with edc check --group

edc check --group <group> runs edc check over SSH on each host of an edc remote group. It uses the same inventory and OpenSSH setup as edc remote and edc clean --group. The table shows one row for each host and one cell for each check, and the WARN and FAIL findings follow with their next commands. A host without a result shows the reason: an SSH failure, no edc, an edc without check, a timeout, or output that is not a check report. Each host needs this release to show results.

Accept known findings with [check] in config.toml

A finding that you already know about no longer has to fail every run.

[check]
accept = ["reboot"]
accept_units = ["systemd-networkd-wait-online.service"]
require_units = ["nginx.service"]

[check.limits]
disk = [90, 95]

accept turns a whole check into skip with the accepted (warn) marker of edc audit, and the JSON keeps the original status. accept_units, accept_containers, and accept_mounts take glob patterns. An accepted name is not judged, but the summary counts it and the JSON lists it. require_units makes a unit that is inactive or missing a FAIL. [check.limits] sets [warn, fail] percentages for disk, available memory, and usage. With --group, each host reads its own config file.

Run routines with shell commands

[check.routines.<name>] defines a routine, and edc check <name> runs it. edc check --group <group> --routine <name> runs it on each host. A routine can select checks, add accept and require rules, change limits, and run shell commands such as an application health check. A command passes with exit code 0. Another code fails, or warns with level = "warn". A command that does not end within its timeout (default 10s) fails, and edc stops it and its child processes. The result keeps the last lines of the output.

Routine commands run shell commands from the config file, and sudo edc check reads the config file of root. So edc runs them only when the group and other users cannot write the config file or any parent directory, and no other user owns them. A directory with the sticky bit, such as /tmp, is allowed. Otherwise each command shows skip with the reason. If your home directory is writable by its group, move the routine to a safe path or fix the mode.

Full Changelog: v0.67.0...v0.68.0