mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
Merge pull request #38514 from disassembler/grafana-reporter
grafana-reporter: init at 2.0.1
This commit is contained in:
commit
9c984b06c4
@ -431,6 +431,7 @@
|
||||
./services/monitoring/dd-agent/dd-agent.nix
|
||||
./services/monitoring/fusion-inventory.nix
|
||||
./services/monitoring/grafana.nix
|
||||
./services/monitoring/grafana-reporter.nix
|
||||
./services/monitoring/graphite.nix
|
||||
./services/monitoring/hdaps.nix
|
||||
./services/monitoring/heapster.nix
|
||||
|
66
nixos/modules/services/monitoring/grafana-reporter.nix
Normal file
66
nixos/modules/services/monitoring/grafana-reporter.nix
Normal file
@ -0,0 +1,66 @@
|
||||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.grafana_reporter;
|
||||
|
||||
in {
|
||||
options.services.grafana_reporter = {
|
||||
enable = mkEnableOption "grafana_reporter";
|
||||
|
||||
grafana = {
|
||||
protocol = mkOption {
|
||||
description = "Grafana protocol.";
|
||||
default = "http";
|
||||
type = types.enum ["http" "https"];
|
||||
};
|
||||
addr = mkOption {
|
||||
description = "Grafana address.";
|
||||
default = "127.0.0.1";
|
||||
type = types.str;
|
||||
};
|
||||
port = mkOption {
|
||||
description = "Grafana port.";
|
||||
default = 3000;
|
||||
type = types.int;
|
||||
};
|
||||
|
||||
};
|
||||
addr = mkOption {
|
||||
description = "Listening address.";
|
||||
default = "127.0.0.1";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
description = "Listening port.";
|
||||
default = 8686;
|
||||
type = types.int;
|
||||
};
|
||||
|
||||
templateDir = mkOption {
|
||||
description = "Optional template directory to use custom tex templates";
|
||||
default = "${pkgs.grafana_reporter}";
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.grafana_reporter = {
|
||||
description = "Grafana Reporter Service Daemon";
|
||||
wantedBy = ["multi-user.target"];
|
||||
after = ["network.target"];
|
||||
serviceConfig = let
|
||||
args = lib.concatSepString " " [
|
||||
"-proto ${cfg.grafana.protocol}://"
|
||||
"-ip ${cfg.grafana.addr}:${toString cfg.grafana.port}"
|
||||
"-port :${toString cfg.port}"
|
||||
"-templates ${cfg.templateDir}"
|
||||
];
|
||||
in {
|
||||
ExecStart = "${pkgs.grafana_reporter.bin}/bin/grafana-reporter ${args}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
32
pkgs/servers/monitoring/grafana-reporter/default.nix
Normal file
32
pkgs/servers/monitoring/grafana-reporter/default.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{ stdenv, buildGoPackage, fetchFromGitHub, tetex, makeWrapper }:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
buildGoPackage rec {
|
||||
name = "reporter-${version}";
|
||||
version = "2.0.1";
|
||||
rev = "v${version}";
|
||||
|
||||
goPackagePath = "github.com/IzakMarais/reporter";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "IzakMarais";
|
||||
repo = "reporter";
|
||||
sha256 = "0yi7nx8ig5xgkwizddl0gdicnmcdp4qgg1fdxyq04l2y3qs176sg";
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $bin/bin/grafana-reporter \
|
||||
--prefix PATH : ${makeBinPath [ tetex ]}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "PDF report generator from a Grafana dashboard";
|
||||
homepage = https://github.com/IzakMarais/reporter;
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ disassembler ];
|
||||
};
|
||||
}
|
@ -13354,6 +13354,8 @@ with pkgs;
|
||||
|
||||
grafana = callPackage ../servers/monitoring/grafana { };
|
||||
|
||||
grafana_reporter = callPackage ../servers/monitoring/grafana-reporter { };
|
||||
|
||||
h2o = callPackage ../servers/http/h2o { };
|
||||
|
||||
haka = callPackage ../tools/security/haka { };
|
||||
|
Loading…
Reference in New Issue
Block a user