summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorsymphorien+git@xlumurb.eu <Symphorien Gibol>2019-12-26 12:00:00 +0000
committerSymphorien Gibol <symphorien+git@xlumurb.eu>2019-12-30 16:40:52 +0100
commitbe25e45fc86612fc52cc3361800547b3552b0131 (patch)
tree142f6251ac8d2d4e6311891d6445dc0bbabd0b49 /pkgs/servers
parentfa28c7750a393dc5139c6a4c75beeadf2a6f0108 (diff)
downloadnixpkgs-be25e45fc86612fc52cc3361800547b3552b0131.tar
nixpkgs-be25e45fc86612fc52cc3361800547b3552b0131.tar.gz
nixpkgs-be25e45fc86612fc52cc3361800547b3552b0131.tar.bz2
nixpkgs-be25e45fc86612fc52cc3361800547b3552b0131.tar.lz
nixpkgs-be25e45fc86612fc52cc3361800547b3552b0131.tar.xz
nixpkgs-be25e45fc86612fc52cc3361800547b3552b0131.tar.zst
nixpkgs-be25e45fc86612fc52cc3361800547b3552b0131.zip
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 <aaron@fosslib.net>
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/monitoring/nagios/default.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkgs/servers/monitoring/nagios/default.nix b/pkgs/servers/monitoring/nagios/default.nix
index 693e67ee6dd..d1654bdf3f7 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";