lego-monitoring/docs/nixos-options.md
2025-08-16 12:08:49 +03:00

757 lines
11 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## services\.lego-monitoring\.enable
Whether to enable lego-monitoring service\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.enabledCheckSets
List of enabled check sets\. Each check set is a module which checks something and generates alerts based on check results\. Available check sets:
- self send an alert when lego-monitoring is started and stopped
- remind periodically (daily by default) remind about ongoing unresolved alerts
- cpu alerts when CPU usage is above threshold
- ram alerts when RAM usage is above threshold
- temp alerts when temperature readings are above thresholds
- net alerts when network usage is above threshold
- vulnix periodically scans system for known CVEs, alerts if any are found (NixOS only)
*Type:*
list of (one of “self”, “remind”, “cpu”, “ram”, “temp”, “net”, “vulnix”)
*Default:*
` [ ] `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.alertChannels\.healthchecks\.enable
Whether to enable [Healthchecks](https://healthchecks\.io) notification channel\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.alertChannels\.healthchecks\.pingingApiEndpoint
Endpoint URL for Healthchecks pinging API\.
*Type:*
string
*Default:*
` "https://hc-ping.com/" `
*Example:*
` "https://your-healthchecks-instance.com/ping/" `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.alertChannels\.healthchecks\.pingingKeysSecretPath
Path to a file containing the pinging keys in a ` slug:key ` format, one on each line (ex: ` lego-cpu:aaaaaaaaaaaaaaaaaaaaaa `)\.
Specify ` default ` as the slug to use this key for check types that dont have a key explicitly assigned to them\.
If you are unsure of the exact slug a check will generate, it is recommended to try it out with the default key first, before
assigning a specific one\.
**Note**: checks will be auto-provisioned, but correct intervals and grace periods have to be configured manually from the web console,
otherwise silent failures will not be recorded until after 1 day (the default healthchecks interval)\.
*Type:*
string
*Default:*
` "" `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.alertChannels\.telegram\.enable
Whether to enable Telegram notification channel\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.alertChannels\.telegram\.credsSecretPath
Path to a file containing Telegram api_id, api_hash, and bot token, separated by the ` , ` character\.
*Type:*
string
*Default:*
` "" `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.alertChannels\.telegram\.roomId
ID of chat where to send alerts\.
*Type:*
signed integer
*Default:*
` 0 `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.cpu\.criticalPercentage
CPU load percentage for a critical alert to be sent\. Null means never generate a CPU critical alert\.
*Type:*
null or (positive integer or floating point number, meaning >0)
*Default:*
` 90.0 `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.cpu\.warningPercentage
CPU load percentage for a warning alert to be sent\. Null means never generate a CPU warning alert\.
*Type:*
null or (positive integer or floating point number, meaning >0)
*Default:*
` 80.0 `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.net\.interfaces
Per-interface configuration of IO byte thresholds\.
*Type:*
attribute set of (submodule)
*Default:*
` { } `
*Example:*
```
{
br0 = {
warningThresholdCombBytes = 700 * 1024 * 128; # 700 Megabits
criticalThresholdCombBytes = 1 * 1024 * 1024 * 128; # 1 Gigabit
};
}
```
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.net\.interfaces\.\<name>\.criticalThresholdCombBytes
Combined (sent + received) bytes per second threshold for a critical alert to be sent\. If null, this threshold is disabled and not checked\.
*Type:*
null or (positive integer, meaning >0)
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.net\.interfaces\.\<name>\.criticalThresholdRecvBytes
Received bytes per second threshold for a critical alert to be sent\. If null, this threshold is disabled and not checked\.
*Type:*
null or (positive integer, meaning >0)
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.net\.interfaces\.\<name>\.criticalThresholdSentBytes
Sent bytes per second threshold for a critical alert to be sent\. If null, this threshold is disabled and not checked\.
*Type:*
null or (positive integer, meaning >0)
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.net\.interfaces\.\<name>\.warningThresholdCombBytes
Combined (sent + received) bytes per second threshold for a warning alert to be sent\. If null, this threshold is disabled and not checked\.
*Type:*
null or (positive integer, meaning >0)
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.net\.interfaces\.\<name>\.warningThresholdRecvBytes
Received bytes per second threshold for a warning alert to be sent\. If null, this threshold is disabled and not checked\.
*Type:*
null or (positive integer, meaning >0)
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.net\.interfaces\.\<name>\.warningThresholdSentBytes
Sent bytes per second threshold for a warning alert to be sent\. If null, this threshold is disabled and not checked\.
*Type:*
null or (positive integer, meaning >0)
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.ram\.criticalPercentage
RAM usage percentage for a critical alert to be sent\. Null means never generate a RAM critical alert\.
*Type:*
null or (positive integer or floating point number, meaning >0)
*Default:*
` 90.0 `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.ram\.warningPercentage
RAM usage percentage for a warning alert to be sent\. Null means never generate a RAM warning alert\.
*Type:*
null or (positive integer or floating point number, meaning >0)
*Default:*
` 80.0 `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.temp\.sensors
Temp sensor override definitions\. Sensors not defined here, or missing options in definitions, will be read with default parameters\.
To get list of sensors and their default configurations, run ` lego-monitoring --print-temp `\.
*Type:*
attribute set of (submodule)
*Default:*
` { } `
*Example:*
```
{
amdgpu.readings.edge.label = "Integrated GPU";
k10temp.readings = {
Tctl = {
label = "AMD CPU";
criticalTemp = 95.0;
};
Tccd1.enabled = false;
Tccd2.enabled = false;
};
nvme.readings = {
"Sensor 1".enabled = false;
"Sensor 2".enabled = false;
};
}
```
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.temp\.sensors\.\<name>\.enabled
Whether sensor is enabled\.
*Type:*
boolean
*Default:*
` true `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.temp\.sensors\.\<name>\.name
Friendly name of the sensor\.
*Type:*
null or string
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.temp\.sensors\.\<name>\.readings
Overrides for specific readings of the sensor, by label\.
*Type:*
attribute set of (submodule)
*Default:*
` { } `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.temp\.sensors\.\<name>\.readings\.\<name>\.enabled
Whether this reading is enabled\.
*Type:*
boolean
*Default:*
` true `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.temp\.sensors\.\<name>\.readings\.\<name>\.criticalTemp
Critical temperature threshold\.
*Type:*
null or (positive integer or floating point number, meaning >0)
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.temp\.sensors\.\<name>\.readings\.\<name>\.label
Friendly label of the reading\.
*Type:*
null or string
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.temp\.sensors\.\<name>\.readings\.\<name>\.warningTemp
Warning temperature threshold\.
*Type:*
null or (positive integer or floating point number, meaning >0)
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.vulnix\.whitelist
Whitelist rules for vulnix\. Attr name is package with version, package name, or ` * `\.
*Type:*
attribute set of (submodule)
*Default:*
` { } `
*Example:*
```
{
"ffmpeg-3.4.2" = {
cve = [ "CVE-2018-6912" "CVE-2018-7557" ];
until = "2018-05-01";
issueUrl = "https://issues.example.com/29952";
};
}
```
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.vulnix\.whitelist\.\<name>\.cve
List of CVE identifiers to match\. The whitelist rule is valid as long as the detected CVEs are a subset of the CVEs listed here\.
If additional CVEs are detected, this whitelist rule is not effective anymore\. If null, all CVEs are matched\.
*Type:*
null or (list of string)
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.vulnix\.whitelist\.\<name>\.issueUrl
URL or list of URLs that point to any issue tracker\. Informational only\.
*Type:*
null or string
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.checks\.vulnix\.whitelist\.\<name>\.until
Date in the form “YYYY-MM-DD” which confines this rules lifetime\. Null means forever\.
On the specified date and later, this whitelist rule is not effective anymore\.
*Type:*
null or string
*Default:*
` null `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)
## services\.lego-monitoring\.logLevel
Level of logging\. INFO generates a log message with every check\.
*Type:*
one of “CRITICAL”, “ERROR”, “WARNING”, “INFO”, “DEBUG”
*Default:*
` "INFO" `
*Declared by:*
- [modules/options\.nix](../modules/options.nix)