[omd-commits] OMD Git: omd: shinken: bugfix in the init-script, handle multiple mongodbs

git version control git at mathias-kettner.de
Fri Apr 5 19:52:18 CEST 2013


Module:   omd
Branch:   master
Commit:   65e7252bb77e2fc0c2473c54c31c3774a3805b91
URL:      http://omdistro.org/projects/omd/repository/revisions/65e7252bb77e2fc0c2473c54c31c3774a3805b91

Author:   Gerhard Lausser <gerhard.lausser at consol.de>
Date:     Fri Apr  5 19:38:27 2013 +0200
Commiter: Gerhard Lausser <gerhard.lausser at consol.de>
Date:     Fri Apr  5 19:38:27 2013 +0200

shinken: bugfix in the init-script, handle multiple mongodbs

---

 packages/shinken/skel/etc/init.d/shinken |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/packages/shinken/skel/etc/init.d/shinken b/packages/shinken/skel/etc/init.d/shinken
index f9e5883..aa8f95a 100644
--- a/packages/shinken/skel/etc/init.d/shinken
+++ b/packages/shinken/skel/etc/init.d/shinken
@@ -78,6 +78,7 @@ NSCA=${CONFIG_NSCA:=off}
 NSCA_TCP_PORT=${CONFIG_NSCA_TCP_PORT:=5667}
 PNP4NAGIOS=${CONFIG_PNP4NAGIOS:=on}
 MONGODB=${CONFIG_MONGODB:=off}
+MONGODB_TCP_PORT=${CONFIG_MONGODB_TCP_PORT:=27017}
 
 #
 # Pyro and multiprocessing have been installed locally
@@ -170,6 +171,12 @@ EOTXT
     #fi
     if [ "$MONGODB" = "on" ]; then
       sed -ri 's/^([[:space:]]*modules[[:space:]]*)(.+)/\1mongologs/' $TARGET_ETC/shinken-specific.d/module_livestatus.cfg
+      sed -ri 's/^([[:space:]]*mongodb_uri[[:space:]]*)(.+)/\1mongodb:\/\/MONGODB_TCP_PORT/' $TARGET_ETC/shinken-specific.d/module_livestatus.cfg
+      if [ "${MONGODB_TCP_PORT##*:}" = "${MONGODB_TCP_PORT%%:*}" ]; then
+        sed -ri "s/MONGODB_TCP_PORT/127.0.0.1:$MONGODB_TCP_PORT/" $TARGET_ETC/shinken-specific.d/module_livestatus.cfg
+      else
+        sed -ri "s/MONGODB_TCP_PORT/$MONGODB_TCP_PORT/" $TARGET_ETC/shinken-specific.d/module_livestatus.cfg
+      fi
     else
       sed -ri 's/^([[:space:]]*modules[[:space:]]*)(.+)/\1sqlitelogs/' $TARGET_ETC/shinken-specific.d/module_livestatus.cfg
     fi



More information about the omd-commits mailing list