No description
Find a file
2026-01-18 16:03:38 +03:00
.vscode explicit organize imports 2024-10-27 13:31:52 +03:00
archive-arch move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
docs add docs for ups 2026-01-18 15:33:56 +03:00
modules add docs for ups 2026-01-18 15:33:56 +03:00
src/lego_monitoring stop if alert cannot be sent 2026-01-01 16:49:13 +03:00
.gitignore stub service 2025-04-28 20:04:04 +03:00
config.example.json fix config example: replace start and stop with self 2025-08-16 12:10:40 +03:00
flake.lock update all flake references 2025-12-01 19:10:06 +03:00
flake.nix upgrade to nixos 25.11 2025-12-01 17:54:49 +03:00
lego-monitoring.service write a readme 2025-06-14 15:18:58 +03:00
mkdocs.nix do not use relative paths in link text 2025-05-10 16:46:36 +03:00
pyproject.toml update version in pyproject 2026-01-18 16:03:38 +03:00
README.md add ups event monitoring to description 2026-01-18 16:00:10 +03:00
uv.lock account for alert sending failing 2025-12-19 16:34:10 +03:00

lego-monitoring

Simple system monitoring service. Sends alerts in Telegram and/or reports status to Healthchecks. Currently supports monitoring:

  • CPU/RAM/network usage
  • temperature readings
  • UPS events
  • vulnix readings (NixOS only)

Setup

NixOS

Only flake-based setups are supported.

Include the module in your flake.nix:

{
  inputs = {
    # ... your other inputs ...
    lego-monitoring = {
      url = "git+https://gitlab.altau.su/lego/lego-monitoring.git";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {
    nixpkgs,
    lego-monitoring,
    ...
  }: {
    # change `yourhostname` to your actual hostname
    nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
      # change to your system:
      system = "x86_64-linux";
      modules = [
        lego-monitoring.nixosModules.default
        ./configuration.nix
        # ... your other modules ...
      ];
    };
  };
}

See docs/nixos-options.md for available configuration options.

Non-NixOS

Requires uv, systemd.

cd /opt
git clone https://gitlab.altau.su/lego/lego-monitoring.git
cd lego-monitoring
uv sync
cp config.example.json config.json

Edit config.json to suit your usage scenario. The default configuration only sends alerts on service's start and stop. You may refer to the NixOS option documentation, as its options are the same, except JSON uses snake_case instead of lowerCamelCase, and enable NixOS options just make a config section present or absent in JSON.

Then enable and start the service:

ln -s /opt/lego-monitoring/lego-monitoring.service /etc/systemd/system/lego-monitoring.service
systemctl enable --now lego-monitoring

UPS monitoring

See docs/ups.md for instructions.