Commit eb5a5cfc authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Tristan Cavelier

monitor: Can display informations about computer parition and more

parent 919204f0
...@@ -82,6 +82,14 @@ md5sum = 7400c8cfa16a15a0d41f512b8bbb1581 ...@@ -82,6 +82,14 @@ md5sum = 7400c8cfa16a15a0d41f512b8bbb1581
filename = index.html.jinja2 filename = index.html.jinja2
mode = 0644 mode = 0644
[info-template]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfile-directory/${:filename}
download-only = true
#md5sum =
filename = information.html.in
mode = 0644
[status-cgi] [status-cgi]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfile-directory/${:filename} url = ${:_profile_base_location_}/webfile-directory/${:filename}
......
...@@ -100,7 +100,8 @@ recipe = slapos.recipe.template:jinja2 ...@@ -100,7 +100,8 @@ recipe = slapos.recipe.template:jinja2
template = ${index:location}/${index:filename} template = ${index:location}/${index:filename}
rendered = $${monitor-parameters:index-path} rendered = $${monitor-parameters:index-path}
update-apache-access = ${apache:location}/bin/htpasswd -cb $${monitor-parameters:htaccess-file} admin update-apache-access = ${apache:location}/bin/htpasswd -cb $${monitor-parameters:htaccess-file} admin
mode = 0744 # Force deploy information.html
mode = $${partition-parameters:mode}
context = context =
key cgi_directory monitor-directory:cgi-bin key cgi_directory monitor-directory:cgi-bin
raw index_template $${deploy-index-template:location}/$${deploy-index-template:filename} raw index_template $${deploy-index-template:location}/$${deploy-index-template:filename}
...@@ -322,6 +323,27 @@ filename = $${public:filename} ...@@ -322,6 +323,27 @@ filename = $${public:filename}
[monitor-rewrite-rule] [monitor-rewrite-rule]
[partition-parameters]
recipe = slapos.recipe.template:jinja2
template = ${info-template:location}/${info-template:filename}
rendered = $${monitor-directory:monitoring-cgi}/information.html
mode = 0744
instance-id =
context =
raw extra_eggs_interpreter ${buildout:directory}/bin/${extra-eggs:interpreter}
key computer_id slap-connection:computer-id
key partition_id slap-connection:partition-id
key home buildout:directory
key master_url slap-connection:server-url
key software_url slap-connection:software-release-url
key ipv4 slap-parameters:ipv4-random
key ipv6 slap-parameters:ipv6-random
key slapparameter_dict slap-parameters:configuration
key instance_reference :instance-id
section extra_parameters extra-parameters-output
[extra-parameters-output]
# XXX could it be something lighter? # XXX could it be something lighter?
[monitor-httpd-configuration] [monitor-httpd-configuration]
pid-file = $${monitor-directory:run}/cgi-httpd.pid pid-file = $${monitor-directory:run}/cgi-httpd.pid
......
#!{{ extra_eggs_interpreter }}
print """<html>
<head>
<title>Computer Partition</title>
<link rel="stylesheet" href="pure-min.css">
<link rel="stylesheet" href="style.css">
<style>
.mo-table {
margin:0px;padding:0px;
width:100%;
border:1px solid #ffffff;
-moz-border-radius-bottomleft:0px;
-webkit-border-bottom-left-radius:0px;
border-bottom-left-radius:0px;
-moz-border-radius-bottomright:0px;
-webkit-border-bottom-right-radius:0px;
border-bottom-right-radius:0px;
-moz-border-radius-topright:0px;
-webkit-border-top-right-radius:0px;
border-top-right-radius:0px;
-moz-border-radius-topleft:0px;
-webkit-border-top-left-radius:0px;
border-top-left-radius:0px;
}.mo-table table{
border-collapse: collapse;
border-spacing: 0;
width:100%;
margin:0px;padding:0px;
}.mo-table tr:last-child td:last-child {
-moz-border-radius-bottomright:0px;
-webkit-border-bottom-right-radius:0px;
border-bottom-right-radius:0px;
}
.mo-table table tr:first-child td:first-child {
-moz-border-radius-topleft:0px;
-webkit-border-top-left-radius:0px;
border-top-left-radius:0px;
}
.mo-table table tr:first-child td:last-child {
-moz-border-radius-topright:0px;
-webkit-border-top-right-radius:0px;
border-top-right-radius:0px;
}.mo-table tr:last-child td:first-child{
-moz-border-radius-bottomleft:0px;
-webkit-border-bottom-left-radius:0px;
border-bottom-left-radius:0px;
}.mo-table tr:hover td{
background-color:#EEF1F4;
}
.mo-table td.upper{text-transform: uppercase;}
.mo-table td{
vertical-align:middle;
background-color:#e8eaed;
min-width: 190px;
border:1px solid #ffffff;
border-width:0px 1px 1px 0px;
text-align:left;
padding:12px;
font-size:13px;
font-family:Helvetica;
font-weight:normal;
color:#575757;
}.mo-table tr:last-child td{
border-width:0px 1px 0px 0px;
}.mo-table tr td:last-child{
border-width:0px 0px 1px 0px;
}.mo-table tr:last-child td:last-child{
border-width:0px 0px 0px 0px;
}
.mo-table tr:first-child td{
background-color:#3799fc;
border:0px solid #ffffff;
text-align:left;
border-width:0px 0px 1px 1px;
font-size:16px;
font-family:Helvetica;
font-weight:normal;
color:#ffffff;
}
.mo-table tr:first-child td:first-child{
border-width:0px 0px 1px 0px;
}
.mo-table tr:first-child td:last-child{
border-width:0px 0px 1px 1px;
}
</style>
</head>
<body>
<h1>Computer Partition Parameters</h1>
<div class="mo-table" >
<table >
<tr>
<td colspan=2>
Computer Partition information
</td>
</tr>
<tr>
<td class="upper" > Partition IPv4 </td>
<td> {{ ipv4 }} </td>
</tr>
<tr>
<td class="upper"> Partition IPv6 </td>
<td> {{ ipv6 }} </td>
</tr>
<!--<tr>
<td class="upper" > Instance Reference </td>
<td> {{ instance_reference }} </td>
</tr>-->
<tr>
<td class="upper" > Software Release Url </td>
<td> <a href="{{ software_url }}" target='_blank'>{{ software_url }}</a> </td>
</tr>
<tr>
<td class="upper" > Partition Home directory </td>
<td> {{ home }} </td>
</tr>
<tr>
<td class="upper" > Partition Reference </td>
<td> {{ partition_id }} </td>
</tr>
<tr>
<td class="upper" > Computer Reference </td>
<td> {{ computer_id }} </td>
</tr>
<tr>
<td class="upper" > Master Server Url </td>
<td> {{ master_url }} </td>
</tr>
{% for key, parameter in extra_parameters.items() -%}
<tr>
<td class="upper" > {{ key }} </td>
<td> {{ parameter }} </td>
</tr>
{% endfor -%}
<tr>
<td class="upper" > Instance Parameters </td>
<td> {{ slapparameter_dict }} </td>
</tr>
</table>
</div>
</body>
</html>
"""
\ No newline at end of file
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