No description
Find a file
2025-09-13 14:40:02 +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 update docs to match new functionality 2025-08-16 12:08:49 +03:00
modules add ups periodic checks 2025-09-13 14:40:02 +03:00
src/lego_monitoring add ups periodic checks 2025-09-13 14:40:02 +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 add ups periodic checks 2025-09-13 14:40:02 +03:00
flake.nix add ups periodic checks 2025-09-13 14:40:02 +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 bump ver to v1.1.1 2025-08-16 13:44:26 +03:00
README.md update docs to match new functionality 2025-08-16 12:08:49 +03:00
uv.lock add ups periodic checks 2025-09-13 14:40:02 +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
  • 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