You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nixos-template-base/services/monitoring-munin.nix

58 lines
1.2 KiB
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
cfg = config.r6d.config-generator;
computers = config.r6d.computers;
profiles = config.r6d.profiles;
in
# TODO: ajouter option
# TODO: changer adresse mail
mkIf true {
# Paquets
environment.systemPackages = with pkgs; [
bc
mailutils
];
# Services
## Noeud de supervision munin = pas de stockage des données locales
services.munin-node = {
enable = true;
};
systemd.services.munin-node = {
path = with pkgs; [ munin lm_sensors ];
serviceConfig.TimeoutStartSec = "3min";
};
users.extraUsers.munin = {
#extraGroups = [ "postfix" "root" ];
extraGroups = [ "postfix" ];
};
# chmod a+rX -Rv /var/lib/postfix/queue/
## Munin server -- generate /var/www/munin
services.munin-cron = {
enable = true;
hosts = ''
[${config.networking.hostName}]
address 127.0.0.1
'';
extraGlobalConfig = ''
contact.email.command ${pkgs.mutt}/bin/mutt -F /etc/nixos/base/public/services/munin-muttrc -s "Munin notification for ''${var:host}" root@prunetwork.fr
'';
};
# Réseau
networking.firewall = {
allowedTCPPorts = [
#8000
];
allowedUDPPorts = [
];
};
}