bosun module: update module

This commit is contained in:
Jaka Hudoklin 2015-11-16 14:08:10 +01:00
parent c8d1e900d6
commit 0775a89c11

View File

@ -6,9 +6,11 @@ let
cfg = config.services.bosun; cfg = config.services.bosun;
configFile = pkgs.writeText "bosun.conf" '' configFile = pkgs.writeText "bosun.conf" ''
tsdbHost = ${cfg.opentsdbHost} ${optionalString (cfg.opentsdbHost !=null) "tsdbHost = ${cfg.opentsdbHost}"}
${optionalString (cfg.influxHost !=null) "influxHost = ${cfg.influxHost}"}
httpListen = ${cfg.listenAddress} httpListen = ${cfg.listenAddress}
stateFile = ${cfg.stateFile} stateFile = ${cfg.stateFile}
ledisDir = ${cfg.ledisDir}
checkFrequency = ${cfg.checkFrequency} checkFrequency = ${cfg.checkFrequency}
${cfg.extraConfig} ${cfg.extraConfig}
@ -54,10 +56,20 @@ in {
}; };
opentsdbHost = mkOption { opentsdbHost = mkOption {
type = types.string; type = types.nullOr types.string;
default = "localhost:4242"; default = "localhost:4242";
description = '' description = ''
Host and port of the OpenTSDB database that stores bosun data. Host and port of the OpenTSDB database that stores bosun data.
To disable opentsdb you can pass null as parameter.
'';
};
influxHost = mkOption {
type = types.nullOr types.string;
default = null;
example = "localhost:8086";
description = ''
Host and port of the influxdb database.
''; '';
}; };
@ -70,13 +82,21 @@ in {
}; };
stateFile = mkOption { stateFile = mkOption {
type = types.string; type = types.path;
default = "/var/lib/bosun/bosun.state"; default = "/var/lib/bosun/bosun.state";
description = '' description = ''
Path to bosun's state file. Path to bosun's state file.
''; '';
}; };
ledisDir = mkOption {
type = types.path;
default = "/var/lib/bosun/ledis_data";
description = ''
Path to bosun's ledis data dir
'';
};
checkFrequency = mkOption { checkFrequency = mkOption {
type = types.str; type = types.str;
default = "5m"; default = "5m";
@ -103,7 +123,7 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.services.bosun = { systemd.services.bosun = {
description = "bosun metrics collector (part of Bosun)"; description = "bosun metrics collector (part of Bosun)";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];