aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/monitoring
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/monitoring')
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/collectd.nix7
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/datadog-agent.nix21
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/dd-agent/dd-agent.nix60
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix3
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/graphite.nix3
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/heapster.nix3
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/munin.nix10
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/nagios.nix153
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/netdata.nix11
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager.nix9
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/prometheus/default.nix5
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix18
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/statsd.nix3
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/sysstat.nix12
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/telegraf.nix5
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/ups.nix45
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/zabbix-server.nix5
17 files changed, 204 insertions, 169 deletions
diff --git a/nixpkgs/nixos/modules/services/monitoring/collectd.nix b/nixpkgs/nixos/modules/services/monitoring/collectd.nix
index 731ac743b7c..ef3663c62e0 100644
--- a/nixpkgs/nixos/modules/services/monitoring/collectd.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/collectd.nix
@@ -129,9 +129,10 @@ in {
};
};
- users.users = optional (cfg.user == "collectd") {
- name = "collectd";
- isSystemUser = true;
+ users.users = optionalAttrs (cfg.user == "collectd") {
+ collectd = {
+ isSystemUser = true;
+ };
};
};
}
diff --git a/nixpkgs/nixos/modules/services/monitoring/datadog-agent.nix b/nixpkgs/nixos/modules/services/monitoring/datadog-agent.nix
index 02a9f316fc3..2c5fe47242e 100644
--- a/nixpkgs/nixos/modules/services/monitoring/datadog-agent.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/datadog-agent.nix
@@ -22,9 +22,9 @@ let
# Generate Datadog configuration files for each configured checks.
# This works because check configurations have predictable paths,
# and because JSON is a valid subset of YAML.
- makeCheckConfigs = entries: mapAttrsToList (name: conf: {
- source = pkgs.writeText "${name}-check-conf.yaml" (builtins.toJSON conf);
- target = "datadog-agent/conf.d/${name}.d/conf.yaml";
+ makeCheckConfigs = entries: mapAttrs' (name: conf: {
+ name = "datadog-agent/conf.d/${name}.d/conf.yaml";
+ value.source = pkgs.writeText "${name}-check-conf.yaml" (builtins.toJSON conf);
}) entries;
defaultChecks = {
@@ -34,10 +34,11 @@ let
# Assemble all check configurations and the top-level agent
# configuration.
- etcfiles = with pkgs; with builtins; [{
- source = writeText "datadog.yaml" (toJSON ddConf);
- target = "datadog-agent/datadog.yaml";
- }] ++ makeCheckConfigs (cfg.checks // defaultChecks);
+ etcfiles = with pkgs; with builtins;
+ { "datadog-agent/datadog.yaml" = {
+ source = writeText "datadog.yaml" (toJSON ddConf);
+ };
+ } // makeCheckConfigs (cfg.checks // defaultChecks);
# Apply the configured extraIntegrations to the provided agent
# package. See the documentation of `dd-agent/integrations-core.nix`
@@ -204,7 +205,7 @@ in {
config = mkIf cfg.enable {
environment.systemPackages = [ datadogPkg pkgs.sysstat pkgs.procps pkgs.iproute ];
- users.extraUsers.datadog = {
+ users.users.datadog = {
description = "Datadog Agent User";
uid = config.ids.uids.datadog;
group = "datadog";
@@ -212,7 +213,7 @@ in {
createHome = true;
};
- users.extraGroups.datadog.gid = config.ids.gids.datadog;
+ users.groups.datadog.gid = config.ids.gids.datadog;
systemd.services = let
makeService = attrs: recursiveUpdate {
@@ -224,7 +225,7 @@ in {
Restart = "always";
RestartSec = 2;
};
- restartTriggers = [ datadogPkg ] ++ map (etc: etc.source) etcfiles;
+ restartTriggers = [ datadogPkg ] ++ attrNames etcfiles;
} attrs;
in {
datadog-agent = makeService {
diff --git a/nixpkgs/nixos/modules/services/monitoring/dd-agent/dd-agent.nix b/nixpkgs/nixos/modules/services/monitoring/dd-agent/dd-agent.nix
index 5ee6b092a6a..e91717fb205 100644
--- a/nixpkgs/nixos/modules/services/monitoring/dd-agent/dd-agent.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/dd-agent/dd-agent.nix
@@ -78,37 +78,35 @@ let
etcfiles =
let
defaultConfd = import ./dd-agent-defaults.nix;
- in (map (f: { source = "${pkgs.dd-agent}/agent/conf.d-system/${f}";
- target = "dd-agent/conf.d/${f}";
- }) defaultConfd) ++ [
- { source = ddConf;
- target = "dd-agent/datadog.conf";
- }
- { source = diskConfig;
- target = "dd-agent/conf.d/disk.yaml";
- }
- { source = networkConfig;
- target = "dd-agent/conf.d/network.yaml";
- } ] ++
- (optional (cfg.postgresqlConfig != null)
- { source = postgresqlConfig;
- target = "dd-agent/conf.d/postgres.yaml";
- }) ++
- (optional (cfg.nginxConfig != null)
- { source = nginxConfig;
- target = "dd-agent/conf.d/nginx.yaml";
- }) ++
- (optional (cfg.mongoConfig != null)
- { source = mongoConfig;
- target = "dd-agent/conf.d/mongo.yaml";
- }) ++
- (optional (cfg.processConfig != null)
- { source = processConfig;
- target = "dd-agent/conf.d/process.yaml";
- }) ++
- (optional (cfg.jmxConfig != null)
- { source = jmxConfig;
- target = "dd-agent/conf.d/jmx.yaml";
+ in
+ listToAttrs (map (f: {
+ name = "dd-agent/conf.d/${f}";
+ value.source = "${pkgs.dd-agent}/agent/conf.d-system/${f}";
+ }) defaultConfd) //
+ {
+ "dd-agent/datadog.conf".source = ddConf;
+ "dd-agent/conf.d/disk.yaml".source = diskConfig;
+ "dd-agent/conf.d/network.yaml".source = networkConfig;
+ } //
+ (optionalAttrs (cfg.postgresqlConfig != null)
+ {
+ "dd-agent/conf.d/postgres.yaml".source = postgresqlConfig;
+ }) //
+ (optionalAttrs (cfg.nginxConfig != null)
+ {
+ "dd-agent/conf.d/nginx.yaml".source = nginxConfig;
+ }) //
+ (optionalAttrs (cfg.mongoConfig != null)
+ {
+ "dd-agent/conf.d/mongo.yaml".source = mongoConfig;
+ }) //
+ (optionalAttrs (cfg.processConfig != null)
+ {
+ "dd-agent/conf.d/process.yaml".source = processConfig;
+ }) //
+ (optionalAttrs (cfg.jmxConfig != null)
+ {
+ "dd-agent/conf.d/jmx.yaml".source = jmxConfig;
});
in {
diff --git a/nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix b/nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix
index fe19ed56195..9b65c76ce02 100644
--- a/nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix
@@ -46,8 +46,7 @@ in {
config = mkIf cfg.enable {
- users.users = singleton {
- name = "fusion-inventory";
+ users.users.fusion-inventory = {
description = "FusionInventory user";
isSystemUser = true;
};
diff --git a/nixpkgs/nixos/modules/services/monitoring/graphite.nix b/nixpkgs/nixos/modules/services/monitoring/graphite.nix
index f7874af3df2..dd147bb3793 100644
--- a/nixpkgs/nixos/modules/services/monitoring/graphite.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/graphite.nix
@@ -632,8 +632,7 @@ in {
cfg.web.enable || cfg.api.enable ||
cfg.seyren.enable || cfg.pager.enable || cfg.beacon.enable
) {
- users.users = singleton {
- name = "graphite";
+ users.users.graphite = {
uid = config.ids.uids.graphite;
description = "Graphite daemon user";
home = dataDir;
diff --git a/nixpkgs/nixos/modules/services/monitoring/heapster.nix b/nixpkgs/nixos/modules/services/monitoring/heapster.nix
index 6da0831b4c5..585632943fd 100644
--- a/nixpkgs/nixos/modules/services/monitoring/heapster.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/heapster.nix
@@ -49,8 +49,7 @@ in {
};
};
- users.users = singleton {
- name = "heapster";
+ users.users.heapsterrs = {
uid = config.ids.uids.heapster;
description = "Heapster user";
};
diff --git a/nixpkgs/nixos/modules/services/monitoring/munin.nix b/nixpkgs/nixos/modules/services/monitoring/munin.nix
index 8af0650c738..1ebf7ee6a76 100644
--- a/nixpkgs/nixos/modules/services/monitoring/munin.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/munin.nix
@@ -317,18 +317,16 @@ in
environment.systemPackages = [ pkgs.munin ];
- users.users = [{
- name = "munin";
+ users.users.munin = {
description = "Munin monitoring user";
group = "munin";
uid = config.ids.uids.munin;
home = "/var/lib/munin";
- }];
+ };
- users.groups = [{
- name = "munin";
+ users.groups.munin = {
gid = config.ids.gids.munin;
- }];
+ };
}) (mkIf nodeCfg.enable {
diff --git a/nixpkgs/nixos/modules/services/monitoring/nagios.nix b/nixpkgs/nixos/modules/services/monitoring/nagios.nix
index 6a3b9776946..3ca79dddaf5 100644
--- a/nixpkgs/nixos/modules/services/monitoring/nagios.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/nagios.nix
@@ -8,6 +8,7 @@ let
nagiosState = "/var/lib/nagios";
nagiosLogDir = "/var/log/nagios";
+ urlPath = "/nagios";
nagiosObjectDefs = cfg.objectDefs;
@@ -16,32 +17,39 @@ let
preferLocalBuild = true;
} "mkdir -p $out; ln -s $nagiosObjectDefs $out/";
- nagiosCfgFile = pkgs.writeText "nagios.cfg"
- ''
- # Paths for state and logs.
- log_file=${nagiosLogDir}/current
- log_archive_path=${nagiosLogDir}/archive
- status_file=${nagiosState}/status.dat
- object_cache_file=${nagiosState}/objects.cache
- temp_file=${nagiosState}/nagios.tmp
- lock_file=/run/nagios.lock # Not used I think.
- state_retention_file=${nagiosState}/retention.dat
- query_socket=${nagiosState}/nagios.qh
- check_result_path=${nagiosState}
- command_file=${nagiosState}/nagios.cmd
-
- # Configuration files.
- #resource_file=resource.cfg
- cfg_dir=${nagiosObjectDefsDir}
-
- # Uid/gid that the daemon runs under.
- nagios_user=nagios
- nagios_group=nagios
-
- # Misc. options.
- illegal_macro_output_chars=`~$&|'"<>
- retain_state_information=1
- ''; # "
+ nagiosCfgFile = let
+ default = {
+ log_file="${nagiosLogDir}/current";
+ log_archive_path="${nagiosLogDir}/archive";
+ status_file="${nagiosState}/status.dat";
+ object_cache_file="${nagiosState}/objects.cache";
+ temp_file="${nagiosState}/nagios.tmp";
+ lock_file="/run/nagios.lock";
+ state_retention_file="${nagiosState}/retention.dat";
+ query_socket="${nagiosState}/nagios.qh";
+ check_result_path="${nagiosState}";
+ command_file="${nagiosState}/nagios.cmd";
+ cfg_dir="${nagiosObjectDefsDir}";
+ nagios_user="nagios";
+ nagios_group="nagios";
+ illegal_macro_output_chars="`~$&|'\"<>";
+ retain_state_information="1";
+ };
+ lines = mapAttrsToList (key: value: "${key}=${value}") (default // cfg.extraConfig);
+ content = concatStringsSep "\n" lines;
+ file = pkgs.writeText "nagios.cfg" content;
+ validated = pkgs.runCommand "nagios-checked.cfg" {preferLocalBuild=true;} ''
+ cp ${file} nagios.cfg
+ # nagios checks the existence of /var/lib/nagios, but
+ # it does not exists in the build sandbox, so we fake it
+ mkdir lib
+ lib=$(readlink -f lib)
+ sed -i s@=${nagiosState}@=$lib@ nagios.cfg
+ ${pkgs.nagios}/bin/nagios -v nagios.cfg && cp ${file} $out
+ '';
+ defaultCfgFile = if cfg.validateConfig then validated else file;
+ in
+ if cfg.mainConfigFile == null then defaultCfgFile else cfg.mainConfigFile;
# Plain configuration for the Nagios web-interface with no
# authentication.
@@ -49,12 +57,12 @@ let
''
main_config_file=${cfg.mainConfigFile}
use_authentication=0
- url_html_path=${cfg.urlPath}
+ url_html_path=${urlPath}
'';
extraHttpdConfig =
''
- ScriptAlias ${cfg.urlPath}/cgi-bin ${pkgs.nagios}/sbin
+ ScriptAlias ${urlPath}/cgi-bin ${pkgs.nagios}/sbin
<Directory "${pkgs.nagios}/sbin">
Options ExecCGI
@@ -62,7 +70,7 @@ let
SetEnv NAGIOS_CGI_CONFIG ${cfg.cgiConfigFile}
</Directory>
- Alias ${cfg.urlPath} ${pkgs.nagios}/share
+ Alias ${urlPath} ${pkgs.nagios}/share
<Directory "${pkgs.nagios}/share">
Options None
@@ -72,16 +80,15 @@ let
in
{
+ imports = [
+ (mkRemovedOptionModule [ "services" "nagios" "urlPath" ] "The urlPath option has been removed as it is hard coded to /nagios in the nagios package.")
+ ];
+
+ meta.maintainers = with lib.maintainers; [ symphorien ];
+
options = {
services.nagios = {
- enable = mkOption {
- default = false;
- description = "
- Whether to use <link
- xlink:href='http://www.nagios.org/'>Nagios</link> to monitor
- your system or network.
- ";
- };
+ enable = mkEnableOption "<link xlink:href='http://www.nagios.org/'>Nagios</link> to monitor your system or network.";
objectDefs = mkOption {
description = "
@@ -89,12 +96,14 @@ in
the hosts, host groups, services and contacts for the
network that you want Nagios to monitor.
";
+ type = types.listOf types.path;
+ example = literalExample "[ ./objects.cfg ]";
};
plugins = mkOption {
type = types.listOf types.package;
- default = [pkgs.nagiosPluginsOfficial pkgs.ssmtp];
- defaultText = "[pkgs.nagiosPluginsOfficial pkgs.ssmtp]";
+ default = with pkgs; [ nagiosPluginsOfficial ssmtp mailutils ];
+ defaultText = "[pkgs.nagiosPluginsOfficial pkgs.ssmtp pkgs.mailutils]";
description = "
Packages to be added to the Nagios <envar>PATH</envar>.
Typically used to add plugins, but can be anything.
@@ -102,14 +111,29 @@ in
};
mainConfigFile = mkOption {
- type = types.package;
- default = nagiosCfgFile;
- defaultText = "nagiosCfgFile";
+ type = types.nullOr types.package;
+ default = null;
description = "
- Derivation for the main configuration file of Nagios.
+ If non-null, overrides the main configuration file of Nagios.
";
};
+ extraConfig = mkOption {
+ type = types.attrsOf types.str;
+ example = {
+ debug_level = "-1";
+ debug_file = "/var/log/nagios/debug.log";
+ };
+ default = {};
+ description = "Configuration to add to /etc/nagios.cfg";
+ };
+
+ validateConfig = mkOption {
+ type = types.bool;
+ default = pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform;
+ description = "if true, the syntax of the nagios configuration file is checked at build time";
+ };
+
cgiConfigFile = mkOption {
type = types.package;
default = nagiosCGICfgFile;
@@ -121,6 +145,7 @@ in
};
enableWebInterface = mkOption {
+ type = types.bool;
default = false;
description = "
Whether to enable the Nagios web interface. You should also
@@ -128,13 +153,20 @@ in
";
};
- urlPath = mkOption {
- default = "/nagios";
- description = "
- The URL path under which the Nagios web interface appears.
- That is, you can access the Nagios web interface through
- <literal>http://<replaceable>server</replaceable>/<replaceable>urlPath</replaceable></literal>.
- ";
+ virtualHost = mkOption {
+ type = types.submodule (import ../web-servers/apache-httpd/per-server-options.nix);
+ example = literalExample ''
+ { hostName = "example.org";
+ adminAddr = "webmaster@example.org";
+ enableSSL = true;
+ sslServerCert = "/var/lib/acme/example.org/full.pem";
+ sslServerKey = "/var/lib/acme/example.org/key.pem";
+ }
+ '';
+ description = ''
+ Apache configuration can be done by adapting <option>services.httpd.virtualHosts</option>.
+ See <xref linkend="opt-services.httpd.virtualHosts"/> for further information.
+ '';
};
};
};
@@ -152,16 +184,12 @@ in
# This isn't needed, it's just so that the user can type "nagiostats
# -c /etc/nagios.cfg".
- environment.etc = [
- { source = cfg.mainConfigFile;
- target = "nagios.cfg";
- }
- ];
+ environment.etc."nagios.cfg".source = nagiosCfgFile;
environment.systemPackages = [ pkgs.nagios ];
systemd.services.nagios = {
description = "Nagios monitoring daemon";
- path = [ pkgs.nagios ];
+ path = [ pkgs.nagios ] ++ cfg.plugins;
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
@@ -172,16 +200,13 @@ in
RestartSec = 2;
LogsDirectory = "nagios";
StateDirectory = "nagios";
+ ExecStart = "${pkgs.nagios}/bin/nagios /etc/nagios.cfg";
+ X-ReloadIfChanged = nagiosCfgFile;
};
-
- script = ''
- for i in ${toString cfg.plugins}; do
- export PATH=$i/bin:$i/sbin:$i/libexec:$PATH
- done
- exec ${pkgs.nagios}/bin/nagios ${cfg.mainConfigFile}
- '';
};
- services.httpd.extraConfig = optionalString cfg.enableWebInterface extraHttpdConfig;
+ services.httpd.virtualHosts = optionalAttrs cfg.enableWebInterface {
+ ${cfg.virtualHost.hostName} = mkMerge [ cfg.virtualHost { extraConfig = extraHttpdConfig; } ];
+ };
};
}
diff --git a/nixpkgs/nixos/modules/services/monitoring/netdata.nix b/nixpkgs/nixos/modules/services/monitoring/netdata.nix
index 3ffde8e9bce..f8225af2042 100644
--- a/nixpkgs/nixos/modules/services/monitoring/netdata.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/netdata.nix
@@ -179,13 +179,14 @@ in {
{ domain = "netdata"; type = "hard"; item = "nofile"; value = "30000"; }
];
- users.users = optional (cfg.user == defaultUser) {
- name = defaultUser;
- isSystemUser = true;
+ users.users = optionalAttrs (cfg.user == defaultUser) {
+ ${defaultUser} = {
+ isSystemUser = true;
+ };
};
- users.groups = optional (cfg.group == defaultUser) {
- name = defaultUser;
+ users.groups = optionalAttrs (cfg.group == defaultUser) {
+ ${defaultUser} = { };
};
};
diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager.nix
index 11d85e9c4fc..9af6b1d94f3 100644
--- a/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager.nix
@@ -27,6 +27,15 @@ let
"--log.format ${cfg.logFormat}"
);
in {
+ imports = [
+ (mkRemovedOptionModule [ "services" "prometheus" "alertmanager" "user" ] "The alertmanager service is now using systemd's DynamicUser mechanism which obviates a user setting.")
+ (mkRemovedOptionModule [ "services" "prometheus" "alertmanager" "group" ] "The alertmanager service is now using systemd's DynamicUser mechanism which obviates a group setting.")
+ (mkRemovedOptionModule [ "services" "prometheus" "alertmanagerURL" ] ''
+ Due to incompatibility, the alertmanagerURL option has been removed,
+ please use 'services.prometheus2.alertmanagers' instead.
+ '')
+ ];
+
options = {
services.prometheus.alertmanager = {
enable = mkEnableOption "Prometheus Alertmanager";
diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/default.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/default.nix
index 191c0bff9c8..b67f697ca0d 100644
--- a/nixpkgs/nixos/modules/services/monitoring/prometheus/default.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/default.nix
@@ -464,6 +464,11 @@ let
};
in {
+
+ imports = [
+ (mkRenamedOptionModule [ "services" "prometheus2" ] [ "services" "prometheus" ])
+ ];
+
options.services.prometheus = {
enable = mkOption {
diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix
index 53f32b8fadc..36ebffa4463 100644
--- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix
@@ -160,6 +160,24 @@ let
};
in
{
+
+ imports = (lib.forEach [ "blackboxExporter" "collectdExporter" "fritzboxExporter"
+ "jsonExporter" "minioExporter" "nginxExporter" "nodeExporter"
+ "snmpExporter" "unifiExporter" "varnishExporter" ]
+ (opt: lib.mkRemovedOptionModule [ "services" "prometheus" "${opt}" ] ''
+ The prometheus exporters are now configured using `services.prometheus.exporters'.
+ See the 18.03 release notes for more information.
+ '' ))
+
+ ++ (lib.forEach [ "enable" "substitutions" "preset" ]
+ (opt: lib.mkRemovedOptionModule [ "fonts" "fontconfig" "ultimate" "${opt}" ] ''
+ The fonts.fontconfig.ultimate module and configuration is obsolete.
+ The repository has since been archived and activity has ceased.
+ https://github.com/bohoomil/fontconfig-ultimate/issues/171.
+ No action should be needed for font configuration, as the fonts.fontconfig
+ module is already used by default.
+ '' ));
+
options.services.prometheus.exporters = mkOption {
type = types.submodule {
options = (mkSubModules);
diff --git a/nixpkgs/nixos/modules/services/monitoring/statsd.nix b/nixpkgs/nixos/modules/services/monitoring/statsd.nix
index ea155821ecc..17836e95a6f 100644
--- a/nixpkgs/nixos/modules/services/monitoring/statsd.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/statsd.nix
@@ -125,8 +125,7 @@ in
message = "Only builtin backends (graphite, console, repeater) or backends enumerated in `pkgs.nodePackages` are allowed!";
}) cfg.backends;
- users.users = singleton {
- name = "statsd";
+ users.use.statsdrs = {
uid = config.ids.uids.statsd;
description = "Statsd daemon user";
};
diff --git a/nixpkgs/nixos/modules/services/monitoring/sysstat.nix b/nixpkgs/nixos/modules/services/monitoring/sysstat.nix
index d668faa53cc..ca2cff82723 100644
--- a/nixpkgs/nixos/modules/services/monitoring/sysstat.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/sysstat.nix
@@ -5,15 +5,10 @@ let
in {
options = {
services.sysstat = {
- enable = mkOption {
- type = types.bool;
- default = false;
- description = ''
- Whether to enable sar system activity collection.
- '';
- };
+ enable = mkEnableOption "sar system activity collection";
collect-frequency = mkOption {
+ type = types.str;
default = "*:00/10";
description = ''
OnCalendar specification for sysstat-collect
@@ -21,6 +16,7 @@ in {
};
collect-args = mkOption {
+ type = types.str;
default = "1 1";
description = ''
Arguments to pass sa1 when collecting statistics
@@ -33,13 +29,13 @@ in {
systemd.services.sysstat = {
description = "Resets System Activity Logs";
wantedBy = [ "multi-user.target" ];
- preStart = "test -d /var/log/sa || mkdir -p /var/log/sa";
serviceConfig = {
User = "root";
RemainAfterExit = true;
Type = "oneshot";
ExecStart = "${pkgs.sysstat}/lib/sa/sa1 --boot";
+ LogsDirectory = "sa";
};
};
diff --git a/nixpkgs/nixos/modules/services/monitoring/telegraf.nix b/nixpkgs/nixos/modules/services/monitoring/telegraf.nix
index d8786732668..5d131557e8b 100644
--- a/nixpkgs/nixos/modules/services/monitoring/telegraf.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/telegraf.nix
@@ -63,10 +63,9 @@ in {
};
};
- users.users = [{
- name = "telegraf";
+ users.users.telegraf = {
uid = config.ids.uids.telegraf;
description = "telegraf daemon user";
- }];
+ };
};
}
diff --git a/nixpkgs/nixos/modules/services/monitoring/ups.nix b/nixpkgs/nixos/modules/services/monitoring/ups.nix
index 1bdc4e4410f..a45e806d4ad 100644
--- a/nixpkgs/nixos/modules/services/monitoring/ups.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/ups.nix
@@ -214,14 +214,12 @@ in
environment.NUT_STATEPATH = "/var/lib/nut/";
};
- environment.etc = [
- { source = pkgs.writeText "nut.conf"
+ environment.etc = {
+ "nut/nut.conf".source = pkgs.writeText "nut.conf"
''
MODE = ${cfg.mode}
'';
- target = "nut/nut.conf";
- }
- { source = pkgs.writeText "ups.conf"
+ "nut/ups.conf".source = pkgs.writeText "ups.conf"
''
maxstartdelay = ${toString cfg.maxStartDelay}
@@ -229,25 +227,15 @@ in
"}
'';
- target = "nut/ups.conf";
- }
- { source = cfg.schedulerRules;
- target = "nut/upssched.conf";
- }
+ "nut/upssched.conf".source = cfg.schedulerRules;
# These file are containing private informations and thus should not
# be stored inside the Nix store.
/*
- { source = ;
- target = "nut/upsd.conf";
- }
- { source = ;
- target = "nut/upsd.users";
- }
- { source = ;
- target = "nut/upsmon.conf;
- }
+ "nut/upsd.conf".source = "";
+ "nut/upsd.users".source = "";
+ "nut/upsmon.conf".source = "";
*/
- ];
+ };
power.ups.schedulerRules = mkDefault "${pkgs.nut}/etc/upssched.conf.sample";
@@ -259,21 +247,16 @@ in
/*
- users.users = [
- { name = "nut";
- uid = 84;
+ users.users.nut =
+ { uid = 84;
home = "/var/lib/nut";
createHome = true;
group = "nut";
description = "UPnP A/V Media Server user";
- }
- ];
-
- users.groups = [
- { name = "nut";
- gid = 84;
- }
- ];
+ };
+
+ users.groups."nut" =
+ { gid = 84; };
*/
};
diff --git a/nixpkgs/nixos/modules/services/monitoring/zabbix-server.nix b/nixpkgs/nixos/modules/services/monitoring/zabbix-server.nix
index e9f1590760a..b4e4378ce1e 100644
--- a/nixpkgs/nixos/modules/services/monitoring/zabbix-server.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/zabbix-server.nix
@@ -44,6 +44,11 @@ let
in
{
+ imports = [
+ (lib.mkRenamedOptionModule [ "services" "zabbixServer" "dbServer" ] [ "services" "zabbixServer" "database" "host" ])
+ (lib.mkRemovedOptionModule [ "services" "zabbixServer" "dbPassword" ] "Use services.zabbixServer.database.passwordFile instead.")
+ ];
+
# interface
options = {