3 # Alias: NagVis linked Web GUI
6 # When clicking on NagVis map icons the user is redirected to another
7 # Web-GUI. By default this is the classic Nagios webinterface. With
8 # this switch the targeted Web-GUI can be changed.
10 # Makes it possible to switch all the links from NagVis
11 # to the default Web GUI to the choosen GUI or a defined
14 # Idea: Default mode is "auto". In this mode the HOOK
15 # checks the current configuration for the default
16 # web gui and sets the NagVis links to point to it.
17 # It is also possible to force the other Web GUIs instead
19 # Another option is "none". In this case OMD configures
20 # nothing and NagVis uses the hard coded optionsa
27 echo "auto: Use the default Web-GUI"
28 echo "nagios: Classic Nagios webinterface"
29 echo "check_mk: The Check_MK's Multisite GUI"
30 echo "thruk: Thruk Monitoring Webinterface"
34 # Skip this hook when NagVis configuration directory does not exist
35 if [ ! -d $OMD_ROOT/etc
/nagvis
]; then
39 CFG_FILE
=$OMD_ROOT/etc
/nagvis
/conf.d
/urls.ini.php
41 if [ "$GUI" == "auto" ]; then
42 GUI
=$CONFIG_DEFAULT_GUI
45 # Fallback to classic Nagios GUI when auto mode and unhandled GUIs selected
46 # (welcome/nagvis GUIs are catched in DEFAULT_GUI hook)
47 if [ "$GUI" == "none" ] && [ -f $CFG_FILE ]; then
52 if [ ! -d $OMD_ROOT/etc
/nagvis
/conf.d
]; then
53 mkdir
-p $OMD_ROOT/etc
/nagvis
/conf.d
56 if [ "$GUI" == "check_mk" ]; then
57 HTMLCGI
="/$OMD_SITE/check_mk"
58 HOSTURL
="[htmlcgi]/view.py?view_name=host&site=&host=[host_name]"
59 SERVICEURL
="[htmlcgi]/view.py?view_name=service&site=&host=[host_name]&service=[service_description]"
60 HOSTGROUPURL
="[htmlcgi]/view.py?view_name=hostgroup&site=&hostgroup=[hostgroup_name]"
61 SERVICEGROUPURL
="[htmlcgi]/view.py?view_name=servicegroup&site=&servicegroup=[servicegroup_name]"
63 HTMLCGI
="/$OMD_SITE/$GUI/cgi-bin"
64 HOSTURL
="[htmlcgi]/status.cgi?host=[host_name]"
65 HOSTGROUPURL
="[htmlcgi]/status.cgi?hostgroup=[hostgroup_name]"
66 SERVICEURL
="[htmlcgi]/extinfo.cgi?type=2&host=[host_name]&service=[service_description]"
67 SERVICEGROUPURL
="[htmlcgi]/status.cgi?servicegroup=[servicegroup_name]&style=detail"
70 # Now write the NagVis configuration. This is a dedicated file so we can easily write it out here
73 ; Do not edit this file. Your changes will be overwritten.
74 ; This file is controlled by the OMD hook NAGVIS_URLS.
76 ; Written by OMD hook NAGVIS_URLS at $(date).
82 hostgroupurl="$HOSTGROUPURL"
83 serviceurl="$SERVICEURL"
84 servicegroupurl="$SERVICEGROUPURL"