From be25e45fc86612fc52cc3361800547b3552b0131 Mon Sep 17 00:00:00 2001 From: "symphorien+git@xlumurb.eu" Date: Thu, 26 Dec 2019 12:00:00 +0000 Subject: nagios: various improvements * structured config for main config file allows to launch nagios in debug mode without having to write the whole config file by hand * build time syntax check * all options have types, one more example * I find it misleading that the main nagios config file is linked in /etc but that if you change the link in /etc/ and restart nagios, it has no effect. Have nagios use /etc/nagios.cfg * fix paths in example nagios config files, which allows to reuse it: services.nagios.objectDefs = (map (x: "${pkgs.nagios}/etc/objects/${x}.cfg") [ "templates" "timeperiods" "commands" ]) ++ [ ./main.cfg ] * for the above reason, add mailutils to default plugins Co-Authored-By: Aaron Andersen --- pkgs/servers/monitoring/nagios/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkgs/servers') diff --git a/pkgs/servers/monitoring/nagios/default.nix b/pkgs/servers/monitoring/nagios/default.nix index 693e67ee6ddb..d1654bdf3f7c 100644 --- a/pkgs/servers/monitoring/nagios/default.nix +++ b/pkgs/servers/monitoring/nagios/default.nix @@ -20,6 +20,13 @@ stdenv.mkDerivation rec { substituteInPlace Makefile --replace '$(MAKE) install-basic' "" ''; installTargets = "install install-config"; + postInstall = '' + # don't make default files use hardcoded paths to commands + sed -i 's@command_line *[^ ]*/\([^/]*\) @command_line \1 @' $out/etc/objects/commands.cfg + sed -i 's@/usr/bin/@@g' $out/etc/objects/commands.cfg + sed -i 's@/bin/@@g' $out/etc/objects/commands.cfg + ''; + meta = { description = "A host, service and network monitoring program"; -- cgit 1.4.1