Commit bc31b905 authored by Rafael Monnerat's avatar Rafael Monnerat

monitor: Include server usage logs.

parent edfb66ca
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -18,9 +18,47 @@ parts =
cgi-httpd-graceful-wrapper
monitor-promise
monitor-instance-log-access
cron-rsync-logs
plot-html
dygraph-js
extends = ${monitor-template:output}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
\ No newline at end of file
offline = true
[cron-rsync-logs]
<= cron
recipe = slapos.cookbook:cron.d
name = rsync-logs
frequency = * * * * *
command = $${rsync-logs:rendered}
[rsync-logs]
recipe = slapos.recipe.template:jinja2
template = ${rsync-logs-script:output}
rendered = $${monitor-directory:bin}/rsync-logs.sh
mode = 0744
context =
key buildout_directory buildout:directory
raw rsync_binary ${rsync:location}/bin/rsync
key server_log_directory monitor-directory:server-log
[plot-html]
recipe = slapos.recipe.template:jinja2
template = ${template-plot-html:output}
rendered = $${monitor-directory:server-log}/plot.html
mode = 0644
context =
[dygraph-js]
recipe = slapos.recipe.template:jinja2
template = ${template-dygraph-js:output}
rendered = $${monitor-directory:server-log}/dygraph-combined.js
mode = 0644
context =
[monitor-directory]
server-log = $${:private-directory}/server-log
<html>
<head>
<meta charset="utf-8">
<style>
div {
float: left;
margin: 5px;
}
</style>
</head>
<body>
<div> <b> LOADAVG </b> <div class="chart"id="loadavg"> </div></div>
<div> <b> CPU PERCENT </b> <div class="chart"id="cpu_percent"> </div></div>
<div> <b> MEMORY USED </b> <div class="chart"id="memory_used"> </div></div>
<div> <b> MEMORY FREE </b> <div class="chart"id="memory_free"> </div></div>
<div> <b> NET IN BYTES </b> <div class="chart"id="net_in_bytes"> </div></div>
<div> <b> NET IN ERROR </b> <div class="chart"id="net_in_errors"> </div></div>
<div> <b> NET IN DROPPED </b> <div class="chart"id="net_in_dropped"> </div></div>
<div> <b> NET OUT BYTES </b> <div class="chart"id="net_out_bytes"> </div></div>
<div> <b> NET OUT ERRORS </b> <div class="chart"id="net_out_errors"> </div></div>
<div> <b> NET OUT DROPPED </b> <div class="chart"id="net_out_dropped"> </div></div>
<script type="text/javascript" src="dygraph-combined.js"></script>
<script>
new Dygraph(
document.getElementById("loadavg"), "system_loadavg.csv");
new Dygraph(
document.getElementById("cpu_percent"), "system_cpu_percent.csv");
new Dygraph(
document.getElementById("memory_used"), "system_memory_used.csv");
new Dygraph(
document.getElementById("memory_free"), "system_memory_free.csv");
new Dygraph(
document.getElementById("net_in_bytes"), "system_net_in_bytes.csv");
new Dygraph(
document.getElementById("net_in_errors"), "system_net_in_errors.csv");
new Dygraph(
document.getElementById("net_in_dropped"), "system_net_in_dropped.csv");
new Dygraph(
document.getElementById("net_out_bytes"), "system_net_out_bytes.csv");
new Dygraph(
document.getElementById("net_out_errors"), "system_net_out_errors.csv");
new Dygraph(
document.getElementById("net_out_dropped"), "system_net_out_dropped.csv");
</script>
</body>
</html>
#!${dash-output:dash}
RSYNC_BIN={{ rsync_binary }}
SLAPGRID_LOGS={{ buildout_directory }}/../var/data-logs/
SERVERLOGS={{ server_log_directory }}
$RSYNC_BIN -a $SLAPGRID_LOGS $SERVERLOGS
......@@ -3,17 +3,40 @@
extends =
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
../../component/rsync/buildout.cfg
parts =
slapos-cookbook
template
eggs
rsync
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/instance.cfg
md5sum = 02442c6727c8fe8247dc91c4b085bcc6
md5sum = df01574007b7e9a05cf9a4eabe07e78c
mode = 0644
[rsync-logs-script]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/rsync-logs.sh.in
md5sum = e48c41cf1cebcaf33353e950edc94717
output = ${buildout:directory}/template-rsync-logs.sh.in
mode = 0644
[template-plot-html]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/plot.html.in
md5sum = 7f9f201f6695ae56b26b742e571478f5
output = ${buildout:directory}/template-plot-html.in
mode = 0644
[template-dygraph-js]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/dygraph-combined.js
md5sum = 9bbf0b64dc1ee1ed3b6f4e2c302e21aa
output = ${buildout:directory}/dygraph-combined.js
mode = 0644
[eggs]
......
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