Merge pull request #62061 from aanderse/nagios

nixos/nagios: module updates
This commit is contained in:
Aaron Andersen 2019-07-03 06:19:35 -04:00 committed by GitHub
commit ec80ffc621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ let
# Uid/gid that the daemon runs under.
nagios_user=nagios
nagios_group=nogroup
nagios_group=nagios
# Misc. options.
illegal_macro_output_chars=`~$&|'"<>
@ -58,9 +58,7 @@ let
<Directory "${pkgs.nagios}/sbin">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
Require all granted
SetEnv NAGIOS_CGI_CONFIG ${cfg.cgiConfigFile}
</Directory>
@ -68,9 +66,7 @@ let
<Directory "${pkgs.nagios}/share">
Options None
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
'';
@ -149,9 +145,11 @@ in
description = "Nagios user ";
uid = config.ids.uids.nagios;
home = nagiosState;
createHome = true;
group = "nagios";
};
users.groups.nagios = { };
# This isn't needed, it's just so that the user can type "nagiostats
# -c /etc/nagios.cfg".
environment.etc = [
@ -169,16 +167,13 @@ in
serviceConfig = {
User = "nagios";
Group = "nagios";
Restart = "always";
RestartSec = 2;
PermissionsStartOnly = true;
LogsDirectory = "nagios";
StateDirectory = "nagios";
};
preStart = ''
mkdir -m 0755 -p ${nagiosState} ${nagiosLogDir}
chown nagios ${nagiosState} ${nagiosLogDir}
'';
script = ''
for i in ${toString cfg.plugins}; do
export PATH=$i/bin:$i/sbin:$i/libexec:$PATH