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
19 echo "nagios: Classic Nagios webinterface"
20 echo "check_mk: The Check_MK's Multisite GUI"
21 echo "thruk: Thruk Monitoring Webinterface"
22 echo "none: Use NagVis default behaviour"
25 # Skip this hook when NagVis configuration directory does not exist
26 if [ ! -d $OMD_ROOT/etc
/nagvis
]; then
30 CFG_FILE
=$OMD_ROOT/etc
/nagvis
/conf.d
/urls.ini.php
33 # When a user sets NAGVIS_URL to "none", previous config files are
34 # deleted and the hook finishes. NagVis will use it's defaults or the
35 # configuration which has been made in the NagVis configuration manually.
36 if [ "$GUI" == "none" ]; then
37 if [ -f $CFG_FILE ]; then
43 # Previous OMD versions offered the option "auto", which is not possible
44 # anymore. Behave like the default value has been selected.
45 if [ "$GUI" == "auto" ]; then
49 if [ ! -d $OMD_ROOT/etc
/nagvis
/conf.d
]; then
50 mkdir
-p $OMD_ROOT/etc
/nagvis
/conf.d
53 if [ "$GUI" == "check_mk" ]; then
54 HTMLCGI
="/$OMD_SITE/check_mk"
55 HOSTURL
="[htmlcgi]/view.py?view_name=host&site=&host=[host_name]"
56 SERVICEURL
="[htmlcgi]/view.py?view_name=service&site=&host=[host_name]&service=[service_description]"
57 HOSTGROUPURL
="[htmlcgi]/view.py?view_name=hostgroup&site=&hostgroup=[hostgroup_name]"
58 SERVICEGROUPURL
="[htmlcgi]/view.py?view_name=servicegroup&site=&servicegroup=[servicegroup_name]"
59 ACTION_URLS
="host_downtime_url=\"\"\nhost_ack_url=\"\"\nservice_downtime_url=\"\"\nservice_ack_url=\"\"\n"
61 HTMLCGI
="/$OMD_SITE/$GUI/cgi-bin"
62 HOSTURL
="[htmlcgi]/status.cgi?host=[host_name]"
63 HOSTGROUPURL
="[htmlcgi]/status.cgi?hostgroup=[hostgroup_name]"
64 SERVICEURL
="[htmlcgi]/extinfo.cgi?type=2&host=[host_name]&service=[service_description]"
65 SERVICEGROUPURL
="[htmlcgi]/status.cgi?servicegroup=[servicegroup_name]&style=detail"
69 # Now write the NagVis configuration. This is a dedicated file so we can easily write it out here
72 ; Do not edit this file. Your changes will be overwritten.
73 ; This file is controlled by the OMD hook NAGVIS_URLS.
75 ; Written by OMD hook NAGVIS_URLS at $(date).
81 hostgroupurl="$HOSTGROUPURL"
82 serviceurl="$SERVICEURL"
83 servicegroupurl="$SERVICEGROUPURL"
85 echo -ne "$ACTION_URLS" >> $CFG_FILE