interface = "ens3";
};
};
+ externalObjects = lib.genAttrs [ "tiboqorl-fr" ]
+ (n: pkgs.callPackage (./. + "/objects_" + n + ".nix") { inherit emailCheck; });
masterPassiveObjects = let
passiveNodes = lib.attrsets.filterAttrs (n: _: builtins.elem n ["backup-2" "eldiron"]) nodes;
toPassiveServices = map (s: s.passiveInfo.filter s // s.passiveInfo);
passiveServices = lib.flatten (lib.attrsets.mapAttrsToList
(_: n: toPassiveServices n.config.myServices.monitoring.services)
passiveNodes
- );
+ ) ++ lib.flatten (lib.attrsets.mapAttrsToList
+ (_: n: toPassiveServices n.service)
+ externalObjects);
in {
service = passiveServices;
host = lib.lists.foldr
(a: b: a//b)
{}
- (lib.attrsets.mapAttrsToList (_: h: h.config.myServices.monitoring.hosts) passiveNodes);
+ (lib.attrsets.mapAttrsToList (_: h: h.config.myServices.monitoring.hosts) passiveNodes
+ ++ lib.attrsets.mapAttrsToList (_: n: n.host) externalObjects);
};
emailCheck = host: hostFQDN: let
allCfg = config.myEnv.monitoring.email_check;
};
otherObjects = map
(n: (pkgs.callPackage (./. + "/objects_" + n + ".nix") { inherit emailCheck; }))
- [ "caldance-1" "ulminfo-fr" "phare" "tiboqorl-fr" ];
+ [ "caldance-1" "ulminfo-fr" "phare" ];
masterObjects = pkgs.callPackage ./objects_master.nix { inherit config; };
commonObjects = pkgs.callPackage ./objects_common.nix ({
master = cfg.master;
hostFQDN = config.hostEnv.fqdn;
hostName = name;
});
+ objectsFiles = lib.mapAttrs' (name: value: lib.nameValuePair
+ "=/${name}/objects.conf" { alias = pkgs.writeText "objects.conf" (toObjects value); }
+ ) externalObjects;
in
{
options = {
};
config = lib.mkIf cfg.enable {
+ services.nginx = lib.mkIf config.myServices.status.enable {
+ virtualHosts."status.immae.eu".locations = objectsFiles;
+ };
+
services.duplyBackup.profiles.monitoring = {
rootDir = config.services.naemon.varDir;
};