Commit d630e6b4 authored by Nicolas Wavrant's avatar Nicolas Wavrant

stack-monitor: now displays in only one interface

parent 93fcdebf
...@@ -53,20 +53,28 @@ download-only = true ...@@ -53,20 +53,28 @@ download-only = true
filename = monitor.py.in filename = monitor.py.in
mode = 0644 mode = 0644
[monitor-cgi] [index]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
download-only = true download-only = true
#md5sum = #md5sum =
filename = monitor.cgi.in filename = index.html.jinja2
mode = 0644 mode = 0644
[control-cgi] [status-cgi]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
download-only = true download-only = true
#md5sum = #md5sum =
filename = control.cgi.in filename = status.cgi.in
mode = 0644
[settings-cgi]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
download-only = true
#md5sum =
filename = settings.cgi.in
mode = 0644 mode = 0644
[rss-bin] [rss-bin]
......
<html>
<head>
<title>Monitoring Interface</title>
</head>
<body style="padding:15px">
<ul>
<li><a href="/{{ rss_filename }}" target="cgi-frame">RSS feed</a></li>
<li><a href="/{{ status_filename }}" target="cgi-frame">status</a></li>
<li><a href="/{{ settings_filename }}" target="cgi-frame">settings</a></li>
</ul>
<iframe name="cgi-frame" style="width:80%;height:70%;margin-left:15%;position:absolute;top:10px;border-style:none;border-left-style:solid"></iframe>
<body>
...@@ -6,4 +6,4 @@ PYTHON=${buildout:directory}/bin/${extra-eggs:interpreter} ...@@ -6,4 +6,4 @@ PYTHON=${buildout:directory}/bin/${extra-eggs:interpreter}
STATUS2RSS=${rss-bin:location}/${rss-bin:filename} STATUS2RSS=${rss-bin:location}/${rss-bin:filename}
NAME=`basename $STATUS` NAME=`basename $STATUS`
cat $STATUS/* | $PYTHON $STATUS2RSS "Monitoring RSS feed" "https://[$${slap-parameters:ipv6-random}]:$${cgi-httpd-configuration-file:listening-port}/$${deploy-monitor-cgi:filename}" > $RSS_FILE cat $STATUS/* | $PYTHON $STATUS2RSS "Monitoring RSS feed" "https://[$${slap-parameters:ipv6-random}]:$${cgi-httpd-configuration-file:listening-port}/$${deploy-status-cgi:filename}" > $RSS_FILE
\ No newline at end of file
...@@ -11,7 +11,8 @@ monitor-dir = $${directory:var}/monitor ...@@ -11,7 +11,8 @@ monitor-dir = $${directory:var}/monitor
result-dir = $${:monitor-dir}/bool result-dir = $${:monitor-dir}/bool
json-filename = monitor.json json-filename = monitor.json
json-path = $${:monitor-dir}/$${:json-filename} json-path = $${:monitor-dir}/$${:json-filename}
rss-path = $${directory:www}/index.html rss-path = $${directory:www}/$${:rss-filename}
rss-filename = rssfeed.html
executable = $${directory:bin}/monitor.py executable = $${directory:bin}/monitor.py
[directory] [directory]
...@@ -64,11 +65,22 @@ name = build-rss ...@@ -64,11 +65,22 @@ name = build-rss
frequency = * * * * * frequency = * * * * *
command = $${make-rss:output} command = $${make-rss:output}
[deploy-monitor-cgi] [deploy-index]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${monitor-cgi:location}/${monitor-cgi:filename} template = ${index:location}/${index:filename}
rendered = $${directory:www}/$${:filename} rendered = $${directory:www}/$${:filename}
filename = monitor.cgi filename = index.html
mode = 0744
context =
key rss_filename monitor-parameters:rss-filename
key settings_filename deploy-settings-cgi:filename
key status_filename deploy-status-cgi:filename
[deploy-status-cgi]
recipe = slapos.recipe.template:jinja2
template = ${status-cgi:location}/${status-cgi:filename}
rendered = $${directory:www}/$${:filename}
filename = status.cgi
mode = 0744 mode = 0744
context = context =
key json_file monitor-parameters:json-path key json_file monitor-parameters:json-path
...@@ -76,11 +88,11 @@ context = ...@@ -76,11 +88,11 @@ context =
raw python_executable ${buildout:executable} raw python_executable ${buildout:executable}
key this_filename :filename key this_filename :filename
[deploy-control-cgi] [deploy-settings-cgi]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${control-cgi:location}/${control-cgi:filename} template = ${settings-cgi:location}/${settings-cgi:filename}
rendered = $${directory:www}/$${:filename} rendered = $${directory:www}/$${:filename}
filename = control.cgi filename = settings.cgi
mode = 0744 mode = 0744
context = context =
raw config_cfg $${buildout:directory}/knowledge0.cfg raw config_cfg $${buildout:directory}/knowledge0.cfg
...@@ -215,5 +227,4 @@ wrapper-path = $${directory:bin}/cgi-httpd ...@@ -215,5 +227,4 @@ wrapper-path = $${directory:bin}/cgi-httpd
[publish-connection-informations] [publish-connection-informations]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
monitor_url = https://[$${cgi-httpd-configuration-file:listening-ip}]:$${cgi-httpd-configuration-file:listening-port}/index.html monitor_url = https://[$${cgi-httpd-configuration-file:listening-ip}]:$${cgi-httpd-configuration-file:listening-port}/index.html
control_url = https://[$${cgi-httpd-configuration-file:listening-ip}]:$${cgi-httpd-configuration-file:listening-port}/control.cgi
IMPORTANT_monitor_info = change the monitor_password as soon as possible ! Default is : $${public:monitor-password} IMPORTANT_monitor_info = change the monitor_password as soon as possible ! Default is : $${public:monitor-password}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment