From 0b0d068ccb91f25f48099ff4d346eac2c387f86e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Wed, 2 Mar 2011 13:28:33 +0200 Subject: health: fix memory info Parse /proc/meminfo instead of 'free' output which changed in busybox and caused breakage. Display also Buffers. --- health-system-html.lsp | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'health-system-html.lsp') diff --git a/health-system-html.lsp b/health-system-html.lsp index f2e4d6c..f25bf8b 100644 --- a/health-system-html.lsp +++ b/health-system-html.lsp @@ -23,14 +23,42 @@
<%= html.html_escape(view.value.memory.value) %>
+<% +local function print_percent(val) + if (tonumber(val) > 10) then + io.write(html.html_escape(val) .. "%") + end +end +%> + - + + + + +
0%
<% if ( tonumber(view.value.memory.used) > 10) then io.write(html.html_escape(view.value.memory.used) .. "%") end %>
<% if ( 90 > tonumber(view.value.memory.used)) then io.write((100-tonumber(view.value.memory.used)) .. "%") end %>
100%0% +
<% print_percent(view.value.memory.used) %>
+
+
<% print_percent(view.value.memory.buffers) %>
+
+
<% print_percent(view.value.memory.free) %>
+
100%
+ - + + + + + + +
Total:=Used=FreeLegend:=Used=Buffers=Free
-- cgit v1.2.3