mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 13:39:15 +03:00
Add NixOS module for Riemann monitoring server.
This commit is contained in:
parent
3194d5cc32
commit
e9252cb35e
3 changed files with 80 additions and 0 deletions
|
@ -144,6 +144,7 @@
|
||||||
siproxd = 134;
|
siproxd = 134;
|
||||||
mlmmj = 135;
|
mlmmj = 135;
|
||||||
neo4j = 136;
|
neo4j = 136;
|
||||||
|
riemann = 137;
|
||||||
|
|
||||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||||
|
|
||||||
|
@ -261,6 +262,7 @@
|
||||||
tss = 133;
|
tss = 133;
|
||||||
siproxd = 134;
|
siproxd = 134;
|
||||||
mlmmj = 135;
|
mlmmj = 135;
|
||||||
|
riemann = 137;
|
||||||
|
|
||||||
# When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399!
|
# When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399!
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,7 @@
|
||||||
./services/monitoring/monit.nix
|
./services/monitoring/monit.nix
|
||||||
./services/monitoring/munin.nix
|
./services/monitoring/munin.nix
|
||||||
./services/monitoring/nagios.nix
|
./services/monitoring/nagios.nix
|
||||||
|
./services/monitoring/riemann.nix
|
||||||
./services/monitoring/smartd.nix
|
./services/monitoring/smartd.nix
|
||||||
./services/monitoring/statsd.nix
|
./services/monitoring/statsd.nix
|
||||||
./services/monitoring/systemhealth.nix
|
./services/monitoring/systemhealth.nix
|
||||||
|
|
77
nixos/modules/services/monitoring/riemann.nix
Normal file
77
nixos/modules/services/monitoring/riemann.nix
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs;
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.services.riemann;
|
||||||
|
|
||||||
|
classpath = concatStringsSep ":" (
|
||||||
|
cfg.extraClasspathEntries ++ [ "${riemann}/share/java/riemann.jar" ]
|
||||||
|
);
|
||||||
|
|
||||||
|
launcher = writeScriptBin "riemann" ''
|
||||||
|
#!/bin/sh
|
||||||
|
exec ${openjdk}/bin/java ${concatStringsSep "\n" cfg.extraJavaOpts} \
|
||||||
|
-cp ${classpath} \
|
||||||
|
riemann.bin ${writeText "riemann.config" cfg.config}
|
||||||
|
'';
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.riemann = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Enable the Riemann network monitoring daemon.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
config = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
description = ''
|
||||||
|
Contents of the Riemann configuration file.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
extraClasspathEntries = mkOption {
|
||||||
|
type = with types; listOf str;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
Extra entries added to the Java classpath when running Riemann.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
extraJavaOpts = mkOption {
|
||||||
|
type = with types; listOf str;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
Extra Java options used when launching Riemann.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
users.extraGroups.riemann.gid = config.ids.gids.riemann;
|
||||||
|
|
||||||
|
users.extraUsers.riemann = {
|
||||||
|
description = "riemann daemon user";
|
||||||
|
uid = config.ids.uids.riemann;
|
||||||
|
group = "riemann";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.riemann = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
path = [ inetutils ];
|
||||||
|
serviceConfig = {
|
||||||
|
User = "riemann";
|
||||||
|
ExecStart = "${launcher}/bin/riemann";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue