3 # Alias: TCP port number for Apache
6 # Configure the TCP port used for the Shinken WebUI
7 # process of this site. This option is only useful if
8 # the CORE is set to "shinken" and WEBSERVER is set to "own".
10 # After changing this variable, the site-wide Apache webserver
17 ls /omd
/sites
/*/etc
/omd
/site.conf
>/dev
/null
2>&1 ||
return 1
18 for conf
in /omd
/sites
/*/etc
/omd
/site.conf
20 [ $conf != /omd
/sites
/$OMD_SITE/etc
/omd
/site.conf
] ||
continue
21 if grep -qx "CONFIG_SHINKEN_WEBUI_TCP_PORT='$PORT'" < $conf > /dev
/null
2>&1 ; then
32 while port_is_used
$PORT
42 # Scan for a free port number by looking at the
43 # configuration of the other sites...
44 PORT
=$
(next_free_hook
57767)
48 echo "(none)|([1-9][0-9]{0,5})|([a-zA-Z0-9\.\-]*:[1-9][0-9]{0,5})"
51 if [ "$2" = "none" ]; then
54 PORT
=$
(next_free_hook
$2)
55 if [ "$PORT" != "$2" ] ; then
56 echo "WebUI port $2 is in use. I've choosen $PORT instead." >&2
59 cat <<EOF > $OMD_ROOT/etc/shinken/apache.conf
60 # This file is managed by 'omd config set SHINKEN_WEBUI_TCP_PORT'.
61 # Better do not edit manually
62 <IfModule mod_alias.c>
63 <Location /$OMD_SITE/shinken>
65 RewriteCond %{ENV:REDIRECT_STATUS} !=501
66 RewriteCond $OMD_ROOT/lib/shinken/shinken/modules/webui_broker/__init__.py -f
67 RewriteRule ^/(.*) http://%{HTTP_HOST}:$PORT [last,redirect=301]
68 RewriteRule .* http://127.0.0.1/mi/gibts/ned [last,redirect=501]
69 ErrorDocument 501 "<h1>OMD: Shinken WebUI not available</h1>You are using a distribution where the Shinken WebUI feature has been deactivated because the built-in Python interpreter is too old.<br>In order to be correctly displayed with Internet Explorer, this message must be longer than 512 bytes. <br><br>Mir san vom Woid dahoam, des kennt a jeda glei,<br>wenns von de Berge hallt, dann samma mir dabei.<br>Und wenn as Stutzerl knallt, dann samma mir um d'Weg,<br> Mir san vom Woid dahoam, da Woid is sche.<br>Mir san af Straubing zua als lust'ge Bauernknecht,<br>Weil mir uns eibült ham, des war fir uns des recht.<br>Uns hods ned g'folln do draussd, ham miassn glei hoamgeh,<br>Mir san vom Woid dahoam, da Woid is sche."
76 [ "$CONFIG_CORE" = shinken
]