Skip to content

lxc ​

The lxc plugin reports LXD or Incus instances on the host. The server splits each report into one service per instance, with its state, CPU and memory. Turn it on for hosts that run LXD or Incus containers or VMs.

The plugin source notes that it was written to the documented lxc list --format json output and has not yet run against a live daemon. Check it on a real host before relying on it.

Enable it ​

Add lxc to the plugins array.

json
{
  "plugins": ["lxc"],
  "lxc": {
    "refreshInterval": 60000,
    "lxcBin": "lxc",
    "instances": [],
    "exclude": []
  }
}
OptionDefaultWhat it does
refreshInterval60000Milliseconds between reports. The plugin sends one report at startup, then one per interval.
lxcBin"lxc"The CLI to run. bin is accepted as an alias. Set it to incus for Incus.
instances[]If set, report only these instance names.
exclude[]Instance names to skip.

To group instances, set the user.daemonitor.group config key on an instance.

shell
lxc config set web-01 user.daemonitor.group shop

Instances without the key group under the host's name.

What it reports ​

The plugin sends one payload per group, with unique id lxc-<group>. It carries project, host, engine: "lxc", running, total and a containers list. Each entry has:

  • name, state (lower-cased status), status, running.
  • image, from image.description or the instance type.
  • cpu, in percent of one core, from the change in cumulative CPU time between reports. The first report shows 0.
  • mem in bytes, memLimit parsed from limits.memory, and memPercent.
  • health is always empty, and restarts and exitCode are always 0. LXD does not report them.

The server does not store the group payload. It writes one lxc-container service per instance, with unique id lxc-<host>-<name>, and records history for each.

When it alerts ​

It doesn't. The server stores each instance's status and returns before the notification step, so lxc reports never send a notification.

Each instance's stored status is:

ConditionStatus
Instance is not runningwarning, reason is its state, such as stopped
Otherwiseonline

The server code also marks unhealthy health or a non-zero exit code as error. The plugin never sends either, so that branch does not fire.

lxc reports also do not update the system's status, and do not trigger cluster evaluation.

On the dashboard ​

One card per instance, labelled LXC · <host>.

ReadingSourceWarnCrit
CPU barcpuabove 70%above 85%
STATEstate, upper-casedstoppednone in practice
MEMmemnonenone
RESTARTSrestarts, always 0more than 5none

CPU pressure raises the card color for display only. An instance that has not reported for 300 seconds shows OFFLINE. When you delete an instance, its card goes OFFLINE. The hourly service reaper removes it once it has been silent for 2 hours, as long as the system's last_seen is fresh. Of the host plugins, only os updates last_seen, so run os on the same agent.

Requirements ​

  • Linux with LXD or Incus.
  • The lxc or incus CLI on the PATH, or a full path in lxcBin.
  • The agent user must be allowed to run lxc list. On LXD that usually means membership in the lxd group.

Gotchas ​

  • The plugin checks for the CLI once, at startup, by running lxc version. If that fails, the plugin stays idle until the agent restarts.
  • A memory percentage needs limits.memory set on the instance. Without it memPercent is 0.