[omd-commits] OMD Git: omd: omd: change some options in etc/check_mk/ defaults while changing CORE between Nagios and Icinga

git version control git at mathias-kettner.de
Tue Sep 11 19:29:46 CEST 2012


Module:   omd
Branch:   master
Commit:   6368a49c940054973190bb3f505eb4aafe0f8934
URL:      http://omdistro.org/projects/omd/repository/revisions/6368a49c940054973190bb3f505eb4aafe0f8934

Author:   Joerg Linge <pitchfork at pnp4nagios.org>
Date:     Tue Sep 11 19:28:17 2012 +0200
Commiter: Joerg Linge <pitchfork at pnp4nagios.org>
Date:     Tue Sep 11 19:28:17 2012 +0200

omd: change some options in etc/check_mk/defaults while changing CORE between Nagios and Icinga

---

 packages/omd/CORE.hook |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/packages/omd/CORE.hook b/packages/omd/CORE.hook
index 00fd983..ed6bf96 100755
--- a/packages/omd/CORE.hook
+++ b/packages/omd/CORE.hook
@@ -53,11 +53,19 @@ case "$1" in
             make_link ../../nagios/apache.conf $OMD_ROOT/etc/apache/conf.d/nagios.conf 
             make_link ../../icinga/apache.conf $OMD_ROOT/etc/apache/conf.d/icinga.conf 
             make_link nagios $OMD_ROOT/etc/init.d/core
+            sed -i -e "s|^nagios_binary[[:space:]]*=.*$|nagios_binary               = '$OMD_ROOT/bin/$2'|" $OMD_ROOT/etc/check_mk/defaults
+            sed -i -e "s|^nagios_config_file[[:space:]]*=.*$|nagios_config_file          = '$OMD_ROOT/tmp/$2/$2.cfg'|" $OMD_ROOT/etc/check_mk/defaults
+            sed -i -e "s|^nagios_url[[:space:]]*=.*$|nagios_url                  = '/$OMD_SITE/$2'|" $OMD_ROOT/etc/check_mk/defaults
+            sed -i -e "s|^nagios_cgi_url[[:space:]]*=.*$|nagios_cgi_url              = '/$OMD_SITE/$2/cgi-bin'|" $OMD_ROOT/etc/check_mk/defaults
         elif [ "$2" == "icinga" ]
         then
             make_link ../../nagios/apache.conf $OMD_ROOT/etc/apache/conf.d/nagios.conf 
             make_link ../../icinga/apache.conf $OMD_ROOT/etc/apache/conf.d/icinga.conf 
             make_link icinga $OMD_ROOT/etc/init.d/core
+            sed -i -e "s|^nagios_binary[[:space:]]*=.*$|nagios_binary               = '$OMD_ROOT/bin/$2'|" $OMD_ROOT/etc/check_mk/defaults
+            sed -i -e "s|^nagios_config_file[[:space:]]*=.*$|nagios_config_file          = '$OMD_ROOT/tmp/$2/$2.cfg'|" $OMD_ROOT/etc/check_mk/defaults
+            sed -i -e "s|^nagios_url[[:space:]]*=.*$|nagios_url                  = '/$OMD_SITE/$2'|" $OMD_ROOT/etc/check_mk/defaults
+            sed -i -e "s|^nagios_cgi_url[[:space:]]*=.*$|nagios_cgi_url              = '/$OMD_SITE/$2/cgi-bin'|" $OMD_ROOT/etc/check_mk/defaults
         elif [ "$2" == "shinken" ]
         then
             # Thruk is the default interface, but classic is possible



More information about the omd-commits mailing list