[omd-commits] OMD Git: omd: nagvis: Fixed handling of welcome/ nagvis DEFAULT_GUI selections when processing NAGVIS_URLS hook

git version control git at mathias-kettner.de
Sun Jul 10 03:03:57 CEST 2011


Module:   omd
Branch:   master
Commit:   3aee253ed322e94d6a7c3af896bf86d02d423237
URL:      http://omdistro.org/projects/omd/repository/revisions/3aee253ed322e94d6a7c3af896bf86d02d423237

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Sun Jul 10 01:50:39 2011 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Sun Jul 10 01:50:39 2011 +0200

nagvis: Fixed handling of welcome/nagvis DEFAULT_GUI selections when processing NAGVIS_URLS hook

---

 packages/nagvis/NAGVIS_URLS.hook |    8 +++++++-
 packages/omd/DEFAULT_GUI.hook    |    6 +++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/packages/nagvis/NAGVIS_URLS.hook b/packages/nagvis/NAGVIS_URLS.hook
index f77590b..bd525f7 100755
--- a/packages/nagvis/NAGVIS_URLS.hook
+++ b/packages/nagvis/NAGVIS_URLS.hook
@@ -32,9 +32,15 @@ case "$1" in
     ;;
     set)
         GUI=$2
-        if [ "$2" == "auto" ] && [ "$CONFIG_DEFAULT_GUI" != "welcome" ] && [ "$CONFIG_DEFAULT_GUI" != "nagvis" ]; then
+        if [ "$2" == "auto" ]; then
             GUI=$CONFIG_DEFAULT_GUI
         fi
+
+        # Fallback to classic Nagios GUI when auto mode and unhandled GUIs selected
+        # (welcome/nagvis GUIs are catched in DEFAULT_GUI hook)
+        if [ "$GUI" == "none" ]; then
+            GUI=nagios
+        fi
         
         if [ "$GUI" == "check_mk" ]; then
             HTMLCGI="/$OMD_SITE/check_mk"
diff --git a/packages/omd/DEFAULT_GUI.hook b/packages/omd/DEFAULT_GUI.hook
index b17c323..77dc816 100755
--- a/packages/omd/DEFAULT_GUI.hook
+++ b/packages/omd/DEFAULT_GUI.hook
@@ -24,7 +24,11 @@ case "$1" in
             # The NAGVIS_URL hook depends on this hooks value but is not
             # executed when this hook is changed. It would be better to
             # solve this in a more general way in omd.
-            omd config set NAGVIS_URLS $2 >/dev/null 2>&1
+            if [ "$2" == "welcome" -o "$2" == "nagvis" ]; then
+                omd config set NAGVIS_URLS nagios >/dev/null 2>&1
+            else
+                omd config set NAGVIS_URLS $2 >/dev/null 2>&1
+            fi
     ;;
     depends)
         [ "$CONFIG_APACHE_MODE" != none ]



More information about the omd-commits mailing list