git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #7553 from offlinehacker/pkgs/python-packages/graphite-beacon

Add graphite beacon package and module

commit8b79a09f78e49fd98b713d81017a7ea8179db5d7 authorJaka Hudoklin <jakahudoklin@gmail.com> dateMon 8 Jun 2015, 12:17 (11 years ago) parent509afe8b7d8d5d
2 files changed+46−1
nixos/modules/services/monitoring/graphite.nix+26−1 pkgs/top-level/python-packages.nix+20
nixos/modules/services/monitoring/graphite.nix+26−1
@@ -354,6 +354,16 @@ in {
354354 type = types.lines;
355355 };
356356 };
357+
358+ beacon = {
359+ enable = mkEnableOption "Whether to enable graphite beacon.";
360+
361+ config = mkOption {
362+ description = "Graphite beacon configuration.";
363+ default = {};
364+ type = types.attrs;
365+ };
366+ };
357367 };
358368
359369 ###### implementation
@@ -535,10 +545,25 @@ in {
535545 environment.systemPackages = [ pkgs.pythonPackages.graphite_pager ];
536546 })
537547
548+ (mkIf cfg.beacon.enable {
549+ systemd.services.graphite-beacon = {
550+ description = "Grpahite Beacon Alerting Daemon";
551+ wantedBy = [ "multi-user.target" ];
552+ serviceConfig = {
553+ ExecStart = ''
554+ ${pkgs.pythonPackages.graphite_beacon}/bin/graphite-beacon \
555+ --config ${pkgs.writeText "graphite-beacon.json" (builtins.toJSON cfg.beacon.config)}
556+ '';
557+ User = "graphite";
558+ Group = "graphite";
559+ };
560+ };
561+ })
562+
538563 (mkIf (
539564 cfg.carbon.enableCache || cfg.carbon.enableAggregator || cfg.carbon.enableRelay ||
540565 cfg.web.enable || cfg.api.enable ||
541− cfg.seyren.enable || cfg.pager.enable
566+ cfg.seyren.enable || cfg.pager.enable || cfg.beacon.enable
542567 ) {
543568 users.extraUsers = singleton {
544569 name = "graphite";
pkgs/top-level/python-packages.nix+20
@@ -14740,6 +14740,26 @@ let
1474014740 };
1474114741 };
1474214742
14743+ graphite_beacon = buildPythonPackage rec {
14744+ name = "graphite_beacon-0.22.1";
14745+
14746+ src = pkgs.fetchurl {
14747+ url = "https://pypi.python.org/packages/source/g/graphite_beacon/${name}.tar.gz";
14748+ md5 = "3d7b2bf8a41b6c3ec5ba2c14db321096";
14749+ };
14750+
14751+ propagatedBuildInputs = [ self.tornado ];
14752+
14753+ preBuild = "> requirements.txt";
14754+
14755+ meta = {
14756+ description = "A simple alerting application for Graphite metrics";
14757+ homepage = https://github.com/klen/graphite-beacon;
14758+ maintainers = [ maintainers.offline ];
14759+ license = licenses.mit;
14760+ };
14761+ };
14762+
1474314763 graphite_influxdb = buildPythonPackage rec {
1474414764 name = "graphite-influxdb-0.3";
1474514765