Appearance
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": []
}
}| Option | Default | What it does |
|---|---|---|
refreshInterval | 60000 | Milliseconds 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 shopInstances 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, fromimage.descriptionor the instance type.cpu, in percent of one core, from the change in cumulative CPU time between reports. The first report shows 0.memin bytes,memLimitparsed fromlimits.memory, andmemPercent.healthis always empty, andrestartsandexitCodeare 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:
| Condition | Status |
|---|---|
| Instance is not running | warning, reason is its state, such as stopped |
| Otherwise | online |
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>.
| Reading | Source | Warn | Crit |
|---|---|---|---|
| CPU bar | cpu | above 70% | above 85% |
| STATE | state, upper-cased | stopped | none in practice |
| MEM | mem | none | none |
| RESTARTS | restarts, always 0 | more than 5 | none |
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
lxcorincusCLI on the PATH, or a full path inlxcBin. - The agent user must be allowed to run
lxc list. On LXD that usually means membership in thelxdgroup.
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.memoryset on the instance. Without itmemPercentis 0.