Module: check_mk
Branch: master
Commit: 91e529a399cd1118031341d8a38eeea3104743a7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=91e529a399cd11…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 25 16:17:48 2017 +0200
5041 FIX Removed NAGVIS_URLS OMD config option
The "omd config" option NAGVIS_URL which could be used to make the NagVis icons
link to different GUIs has been removed because all CMK environments use the CMK
GUI. A hook for this is not needed.
In case you need to customize your NagVis URLs you can still do it with the
NagVis configuration.
Change-Id: I2090b5b2bc2a583ed8ace4591d8eb7c87b598e81
---
.werks/5041 | 15 ++++
omd/packages/nagvis/NAGVIS_URLS.hook | 88 ----------------------
.../nagvis/skel/etc/nagvis/conf.d/omd.ini.php | 10 ++-
3 files changed, 24 insertions(+), 89 deletions(-)
diff --git a/.werks/5041 b/.werks/5041
new file mode 100644
index 0000000..08439aa
--- /dev/null
+++ b/.werks/5041
@@ -0,0 +1,15 @@
+Title: Removed NAGVIS_URLS OMD config option
+Level: 1
+Component: packages
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1500992110
+Class: fix
+
+The "omd config" option NAGVIS_URL which could be used to make the NagVis
icons
+link to different GUIs has been removed because all CMK environments use the CMK
+GUI. A hook for this is not needed.
+
+In case you need to customize your NagVis URLs you can still do it with the
+NagVis configuration.
diff --git a/omd/packages/nagvis/NAGVIS_URLS.hook b/omd/packages/nagvis/NAGVIS_URLS.hook
deleted file mode 100755
index c2d8b52..0000000
--- a/omd/packages/nagvis/NAGVIS_URLS.hook
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/bash
-
-# Alias: NagVis linked Web GUI
-# Menu: Addons
-# Description:
-# When clicking on NagVis map icons the user is redirected to another
-# Web-GUI. By default this is the classic Nagios webinterface. With
-# this switch the targeted Web-GUI can be changed.
-
-# Makes it possible to switch all the links from NagVis
-# to the default Web GUI to the choosen GUI or a defined
-# other one.
-
-case "$1" in
- default)
- echo "check_mk"
- ;;
- choices)
- echo "nagios: Classic Nagios webinterface"
- echo "check_mk: The Check_MK's Multisite GUI"
- echo "thruk: Thruk Monitoring Webinterface"
- echo "none: Use NagVis default behaviour"
- ;;
- set)
- # Skip this hook when NagVis configuration directory does not exist
- if [ ! -d $OMD_ROOT/etc/nagvis ]; then
- exit 0
- fi
-
- CFG_FILE=$OMD_ROOT/etc/nagvis/conf.d/urls.ini.php
- GUI=$2
-
- # When a user sets NAGVIS_URL to "none", previous config files are
- # deleted and the hook finishes. NagVis will use it's defaults or the
- # configuration which has been made in the NagVis configuration manually.
- if [ "$GUI" == "none" ]; then
- if [ -f $CFG_FILE ]; then
- rm $CFG_FILE
- fi
- exit 0
- fi
-
- # Previous OMD versions offered the option "auto", which is not
possible
- # anymore. Behave like the default value has been selected.
- if [ "$GUI" == "auto" ]; then
- GUI=check_mk
- fi
-
- if [ ! -d $OMD_ROOT/etc/nagvis/conf.d ]; then
- mkdir -p $OMD_ROOT/etc/nagvis/conf.d
- fi
-
- if [ "$GUI" == "check_mk" ]; then
- HTMLCGI="/$OMD_SITE/check_mk"
-
HOSTURL="[htmlcgi]/view.py?view_name=host&site=&host=[host_name]"
-
SERVICEURL="[htmlcgi]/view.py?view_name=service&site=&host=[host_name]&service=[service_description]"
-
HOSTGROUPURL="[htmlcgi]/view.py?view_name=hostgroup&site=&hostgroup=[hostgroup_name]"
-
SERVICEGROUPURL="[htmlcgi]/view.py?view_name=servicegroup&site=&servicegroup=[servicegroup_name]"
-
ACTION_URLS="host_downtime_url=\"\"\nhost_ack_url=\"\"\nservice_downtime_url=\"\"\nservice_ack_url=\"\"\n"
- else
- HTMLCGI="/$OMD_SITE/$GUI/cgi-bin"
- HOSTURL="[htmlcgi]/status.cgi?host=[host_name]"
- HOSTGROUPURL="[htmlcgi]/status.cgi?hostgroup=[hostgroup_name]"
-
SERVICEURL="[htmlcgi]/extinfo.cgi?type=2&host=[host_name]&service=[service_description]"
-
SERVICEGROUPURL="[htmlcgi]/status.cgi?servicegroup=[servicegroup_name]&style=detail"
- ACTION_URLS=""
- fi
-
- # Now write the NagVis configuration. This is a dedicated file so we can easily
write it out here
- cat > $CFG_FILE <<EOF
-; <?php exit(1); ?>
-; Do not edit this file. Your changes will be overwritten.
-; This file is controlled by the OMD hook NAGVIS_URLS.
-;
-; Written by OMD hook NAGVIS_URLS at $(date).
-[paths]
-htmlcgi="$HTMLCGI"
-
-[defaults]
-hosturl="$HOSTURL"
-hostgroupurl="$HOSTGROUPURL"
-serviceurl="$SERVICEURL"
-servicegroupurl="$SERVICEGROUPURL"
-EOF
- echo -ne "$ACTION_URLS" >> $CFG_FILE
- ;;
-
-esac
diff --git a/omd/packages/nagvis/skel/etc/nagvis/conf.d/omd.ini.php
b/omd/packages/nagvis/skel/etc/nagvis/conf.d/omd.ini.php
index 46ee38a..0e82a3b 100644
--- a/omd/packages/nagvis/skel/etc/nagvis/conf.d/omd.ini.php
+++ b/omd/packages/nagvis/skel/etc/nagvis/conf.d/omd.ini.php
@@ -22,10 +22,18 @@ sharedvar="###ROOT###/tmp/nagvis/share/"
profiles="###ROOT###/var/nagvis/profiles/"
htmlbase="/###SITE###/nagvis"
local_htmlbase="/###SITE###/nagvis/local"
-htmlcgi="/###SITE###/nagios/cgi-bin"
+htmlcgi="/###SITE###/check_mk"
[defaults]
backend="###SITE###"
+hosturl="[htmlcgi]/view.py?view_name=host&site=&host=[host_name]"
+hostgroupurl="[htmlcgi]/view.py?view_name=hostgroup&site=&hostgroup=[hostgroup_name]"
+serviceurl="[htmlcgi]/view.py?view_name=service&site=&host=[host_name]&service=[service_description]"
+servicegroupurl="[htmlcgi]/view.py?view_name=servicegroup&site=&servicegroup=[servicegroup_name]"
+host_downtime_url=""
+host_ack_url=""
+service_downtime_url=""
+service_ack_url=""
[backend_###SITE###]
backendtype="mklivestatus"