diff options
author | Jaka Hudoklin <jakahudoklin@gmail.com> | 2015-06-08 12:17:01 +0200 |
---|---|---|
committer | Jaka Hudoklin <jakahudoklin@gmail.com> | 2015-06-08 12:17:01 +0200 |
commit | 8b79a09f78e49fd98b713d81017a7ea8179db5d7 (patch) | |
tree | 4650ff7c74650769e6c55f46fc9c7cf27934162d /nixos/modules | |
parent | 509afe860b0c1ad18cdd29f3e060fb5769780308 (diff) | |
parent | b7d8d5dd30a6cdcccc15707eb56d80373366ecee (diff) | |
download | nixlib-8b79a09f78e49fd98b713d81017a7ea8179db5d7.tar nixlib-8b79a09f78e49fd98b713d81017a7ea8179db5d7.tar.gz nixlib-8b79a09f78e49fd98b713d81017a7ea8179db5d7.tar.bz2 nixlib-8b79a09f78e49fd98b713d81017a7ea8179db5d7.tar.lz nixlib-8b79a09f78e49fd98b713d81017a7ea8179db5d7.tar.xz nixlib-8b79a09f78e49fd98b713d81017a7ea8179db5d7.tar.zst nixlib-8b79a09f78e49fd98b713d81017a7ea8179db5d7.zip |
Merge pull request #7553 from offlinehacker/pkgs/python-packages/graphite-beacon
Add graphite beacon package and module
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/monitoring/graphite.nix | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/nixos/modules/services/monitoring/graphite.nix b/nixos/modules/services/monitoring/graphite.nix index bbbbcbccb9be..2a572a6a065c 100644 --- a/nixos/modules/services/monitoring/graphite.nix +++ b/nixos/modules/services/monitoring/graphite.nix @@ -354,6 +354,16 @@ in { type = types.lines; }; }; + + beacon = { + enable = mkEnableOption "Whether to enable graphite beacon."; + + config = mkOption { + description = "Graphite beacon configuration."; + default = {}; + type = types.attrs; + }; + }; }; ###### implementation @@ -535,10 +545,25 @@ in { environment.systemPackages = [ pkgs.pythonPackages.graphite_pager ]; }) + (mkIf cfg.beacon.enable { + systemd.services.graphite-beacon = { + description = "Grpahite Beacon Alerting Daemon"; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = '' + ${pkgs.pythonPackages.graphite_beacon}/bin/graphite-beacon \ + --config ${pkgs.writeText "graphite-beacon.json" (builtins.toJSON cfg.beacon.config)} + ''; + User = "graphite"; + Group = "graphite"; + }; + }; + }) + (mkIf ( cfg.carbon.enableCache || cfg.carbon.enableAggregator || cfg.carbon.enableRelay || cfg.web.enable || cfg.api.enable || - cfg.seyren.enable || cfg.pager.enable + cfg.seyren.enable || cfg.pager.enable || cfg.beacon.enable ) { users.extraUsers = singleton { name = "graphite"; |