No description
Find a file
2025-08-15 18:15:13 +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 write a readme 2025-06-14 15:18:58 +03:00
modules try to use OK alerts to reflect successful checks 2025-08-15 18:02:43 +03:00
src/lego_monitoring adapt rest of checks to use OK alerts 2025-08-15 18:15:13 +03:00
.gitignore stub service 2025-04-28 20:04:04 +03:00
config.example.json write a readme 2025-06-14 15:18:58 +03:00
flake.lock network monitoring 2025-06-07 15:59:05 +03:00
flake.nix network monitoring 2025-06-07 15:59:05 +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 add healthchecks client 2025-08-15 02:56:27 +03:00
README.md write a readme 2025-06-14 15:18:58 +03:00
uv.lock add healthchecks client 2025-08-15 02:56:27 +03:00

lego-monitoring

Simple system monitoring service. Sends alerts in Telegram. 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.

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