From 82a6effcd89b253b72c3822108f895d742917fda Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Sun, 17 Aug 2014 22:00:07 +0200
Subject: [PATCH 01/24] Version 2.8
---
VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION b/VERSION
index 1effb00..a4412fa 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.7
+2.8
From c81d6b32a9077f5c51f8fa8208ea97cb03d5442a Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Sun, 17 Aug 2014 22:00:42 +0200
Subject: [PATCH 02/24] Add 'Badge' function for status page (similar to Label)
---
rpimonitor/template/services.conf | 3 ++-
rpimonitor/web/js/rpimonitor.status.js | 10 ++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/rpimonitor/template/services.conf b/rpimonitor/template/services.conf
index 6e27fe7..512339c 100644
--- a/rpimonitor/template/services.conf
+++ b/rpimonitor/template/services.conf
@@ -20,4 +20,5 @@ dynamic.19.regexp=tcp .*:(443).*LISTEN
web.status.1.content.9.name=Servers
web.status.1.content.9.icon=daemons.png
-web.status.1.content.9.line.1="ssh : "+Label(data.ssh,"==22","OK","label-success")+Label(data.ssh,"!=22","KO","label-important")+" rpimonitor : "+Label(data.rpimonitor,"==8888","OK","label-success")+Label(data.rpimonitor,"!=8888","KO","label-important")+" nginx http : "+Label(data.http,"==80","OK","label-success")+Label(data.http,"!=80","KO","label-important")+" nginx https : "+Label(data.https,"==443","OK","label-success")+Label(data.https,"!=443","KO","label-important")
+web.status.1.content.9.line.1="ssh : "+Label(data.ssh,"==22","OK","success")+Label(data.ssh,"!=22","KO","important")+" rpimonitor : "+Label(data.rpimonitor,"==8888","OK","success")+Label(data.rpimonitor,"!=8888","KO","important")+" nginx http : "+Label(data.http,"==80","OK","success")+Label(data.http,"!=80","KO","important")+" nginx https : "+Label(data.https,"==443","OK","success")+Label(data.https,"!=443","KO","important")
+web.status.1.content.9.line.2="ssh : "+Badge(data.ssh,"==22","OK","success")+Badge(data.ssh,"!=22","KO","important")+" rpimonitor : "+Badge(data.rpimonitor,"==8888","OK","success")+Badge(data.rpimonitor,"!=8888","KO","important")+" nginx http : "+Badge(data.http,"==80","OK","success")+Badge(data.http,"!=80","KO","important")+" nginx https : "+Badge(data.https,"==443","OK","success")+Badge(data.https,"!=443","KO","important")
diff --git a/rpimonitor/web/js/rpimonitor.status.js b/rpimonitor/web/js/rpimonitor.status.js
index da83970..efda559 100644
--- a/rpimonitor/web/js/rpimonitor.status.js
+++ b/rpimonitor/web/js/rpimonitor.status.js
@@ -91,10 +91,20 @@ function ProgressBar(value, max){
function Label(data,formula, text, level){
var result="";
+ if ( level.indexOf('label-') < 0 ) { level = 'label-'+level };
eval ( "if ("+data+formula+") result=\""+text+" \"" );
return result;
}
+function Badge(data,formula, text, level){
+ var result="";
+ if ( level.indexOf('badge-') < 0 ) { level = 'badge-'+level };
+ if ( false ) level = 'badge-'+level;
+ eval ( "if ("+data+formula+") result=\""+text+" \"" );
+ return result;
+}
+
+
var clocksec=0;
function Clock(localtime){
clocksec=localtime[5];
From 85a51f3c243b6753e92a0bd613739fa263a8c52d Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Mon, 18 Aug 2014 10:21:16 +0200
Subject: [PATCH 03/24] Fix upstart script and make it start with default
configuration
---
tools/upstart/rpimonitord.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/upstart/rpimonitord.conf b/tools/upstart/rpimonitord.conf
index db10796..f97437d 100644
--- a/tools/upstart/rpimonitord.conf
+++ b/tools/upstart/rpimonitord.conf
@@ -9,7 +9,7 @@ stop on runlevel [!2345]
script
cd /usr/local/rpimonitor/
- exec /usr/bin/rpimonitord -c /etc/rpimonitor/rpimonitord.conf -c /etc/rpimonitor/default.conf
+ exec /usr/bin/rpimonitord
end script
respawn
From 21ef65294c0e69956e89d86d6d40f61e14ebcbe4 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Mon, 18 Aug 2014 10:34:06 +0200
Subject: [PATCH 04/24] Simplify sysVinit script
---
init/cron.d/rpimonitor | 2 +-
init/default/rpimonitor | 9 ---------
init/init.d/rpimonitor | 27 +--------------------------
scripts/updatePackagesStatus.sh | 11 +++++++++++
4 files changed, 13 insertions(+), 36 deletions(-)
delete mode 100644 init/default/rpimonitor
create mode 100755 scripts/updatePackagesStatus.sh
diff --git a/init/cron.d/rpimonitor b/init/cron.d/rpimonitor
index 662632f..8c51347 100644
--- a/init/cron.d/rpimonitor
+++ b/init/cron.d/rpimonitor
@@ -2,6 +2,6 @@
05 03 * * * root /usr/bin/apt-get update > /dev/null 2>&1
# run at 03:10 to update status
-10 03 * * * root /etc/init.d/rpimonitor update > /dev/null 2>&1
+10 03 * * * root /usr/share/rpimonitor/scripts/updatePackagesStatus.sh > /dev/null 2>&1
diff --git a/init/default/rpimonitor b/init/default/rpimonitor
deleted file mode 100644
index 441a681..0000000
--- a/init/default/rpimonitor
+++ /dev/null
@@ -1,9 +0,0 @@
-# DEAMON_START=0 : do not start rpimonitord at boot
-# DEAMON_START=1 : rpimonitord start automatically at boot
-DAEMON_START=1
-
-#CONFFILE="-c /etc/rpimonitor/rpimonitord.conf -c /etc/rpimonitor/rpimonitord.conf.d/default.conf" : Define configuration file to use
-
-# SHOW_PACKAGE_UPDATE=0 : Do not show update packages
-# SHOW_PACKAGE_UPDATE=1 : Show update packages
-SHOW_PACKAGE_UPDATE=1
diff --git a/init/init.d/rpimonitor b/init/init.d/rpimonitor
index dc5658e..9037b1c 100755
--- a/init/init.d/rpimonitor
+++ b/init/init.d/rpimonitor
@@ -15,12 +15,9 @@
DAEMON="/usr/bin/rpimonitord"
PIDFILE="/var/run/rpimonitord.pid"
-DEFAULTFILE="/etc/default/rpimonitor"
[ -x $DAEMON ] || exit 0
-[ -r $DEFAULTFILE ] && . $DEFAULTFILE
-
checkroot(){
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root"
@@ -29,12 +26,6 @@ checkroot(){
}
start() {
- if [ "$DAEMON_START" = "0" ]; then
- echo "RPi-Monitor deamon id disabled."
- echo "Update /etc/default/rpimonitor and set DEAMON_START to 1."
- return 0
- fi
-
touch $PIDFILE
for pid in $(cat $PIDFILE); do
@@ -80,19 +71,6 @@ status(){
echo
}
-update(){
- if [ "$SHOW_PACKAGE_UPDATE" = "0" ]; then
- echo > /var/lib/rpimonitor/updatestatus.txt
- return 0
- fi
-
- log_daemon_msg "RPi-Monitor" "Updating package status"
- LANG=C
- apt-get upgrade --dry-run| perl -ne '/(.*upgraded.*installed|^ \S+.*)/ and print "$1 "' 2>/dev/null > /var/lib/rpimonitor/updatestatus.txt
- status=$?
- log_end_msg $status
-}
-
checkroot
case "$1" in
start)
@@ -107,11 +85,8 @@ case "$1" in
restart)
restart
;;
- update)
- update
- ;;
*)
- echo "Usage: $0 {start|stop|restart|status|update}"
+ echo "Usage: $0 {start|stop|restart|status}"
;;
esac
diff --git a/scripts/updatePackagesStatus.sh b/scripts/updatePackagesStatus.sh
new file mode 100755
index 0000000..4d4cbe2
--- /dev/null
+++ b/scripts/updatePackagesStatus.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# Source function library.
+. /lib/lsb/init-functions
+
+# Update file /var/lib/rpimonitor/updatestatus.txt
+log_daemon_msg "RPi-Monitor" "Updating package status"
+LANG=C
+apt-get upgrade --dry-run| perl -ne '/(.*upgraded.*installed|^ \S+.*)/ and print "$1 "' 2>/dev/null > /var/lib/rpimonitor/updatestatus.txt
+status=$?
+log_end_msg $status
From 989f42db2ef33a071a1af6ab02ecad59c9dea497 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Mon, 18 Aug 2014 11:10:21 +0200
Subject: [PATCH 05/24] Update PACKAGING.md
---
PACKAGING.md | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/PACKAGING.md b/PACKAGING.md
index 9ab115e..5e6d368 100644
--- a/PACKAGING.md
+++ b/PACKAGING.md
@@ -3,6 +3,9 @@
## Introduction
This document intended to help [**RPi-Monitor**](http://rpi-experiences.blogspot.fr/)'s package maintainer to know what to install and where.
+## Version
+This document describe file organisation for **Version 2.8**
+
## Dependencies
**rpimonitord** is a perl script which require the following perl modules to work:
@@ -26,9 +29,6 @@ This document intended to help [**RPi-Monitor**](http://rpi-experiences.blogspot
###Configuration
-Since version 2.7:
-
-* /etc/default/rpimonitor : *Init script configuration file*
* /etc/rpimonitor/daemon.conf : *configuration of rpimonitord daemon*
* /etc/rpimonitor/data.conf : *(symlink to template/.conf) configuration of default data to be extracted and presented*
* /etc/rpimonitor/\*.conf : *all other *.conf file will be parsed to look for data to be monitored*
@@ -48,7 +48,6 @@ The template directory is also containing some templates that can be used as exa
###Web Interface
-* /usr/share/rpimonitor
* /usr/share/rpimonitor/web : *Directory containing html*
* /usr/share/rpimonitor/web/js: *Directory containing javascripts*
* /usr/share/rpimonitor/web/css: *Directory containing style*
@@ -58,9 +57,11 @@ The template directory is also containing some templates that can be used as exa
When **RPi-Monitor** is configured to not use the internal server, the json are written on the disk into the web root directory /usr/share/rpimonitor/web
-###Data
+###Scripts
-Since version 2.7:
+* /usr/share/rpimonitor/scripts/updatePackagesStatus.sh: *Script periodically executed to update /var/lib/rpimonitor/updatestatus.txt*
+
+###Data
* /var/lib/rpimonitor/web/stat : *Directory containing \*.rrd*
-* /var/lib/rpimonitor/updatestatus.txt: * Current status of packages*
+* /var/lib/rpimonitor/updatestatus.txt: *Current status of packages update*
From 13698bf68539d067411f917394c6fa2e6d605446 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Mon, 25 Aug 2014 19:37:01 +0200
Subject: [PATCH 06/24] Manage cofiguration indexes unicity per file (to make
configuration easier)
---
rpimonitor/rpimonitord | 62 ++++++++++++-----
rpimonitor/template/printer.conf | 112 +++++++++++++++---------------
rpimonitor/template/services.conf | 32 ++++-----
3 files changed, 118 insertions(+), 88 deletions(-)
diff --git a/rpimonitor/rpimonitord b/rpimonitor/rpimonitord
index e908833..28909b9 100755
--- a/rpimonitor/rpimonitord
+++ b/rpimonitor/rpimonitord
@@ -41,6 +41,10 @@ sub new
$this->Debug(3,"");
$this->{'rrd'}=();
$this->{'daemon'}->{'confFiles'} = [];
+ $this->{'counter'}->{'static'} = 0;
+ $this->{'counter'}->{'dynamic'} = 0;
+ $this->{'counter'}->{'status'} = 0;
+ $this->{'counter'}->{'statistics'} = 0;
return $this;
}
@@ -127,6 +131,7 @@ sub Load
) or die $!;
if ( $this->{'show'} ) {
+ $Data::Dumper::Indent = 1;
die Data::Dumper->Dump([$this]);
}
}
@@ -135,6 +140,7 @@ sub LoadFile
{
my $this = shift;
my $confFile = shift;
+ my $dict;
$this->Debug(2,"Loading file: $confFile");
open ( FILE, $confFile)
@@ -145,33 +151,57 @@ sub LoadFile
my ($key, $value) = /^([^=]*)=(.*)/; # Extract key and value
my @leaves=split('\.', $key); # Explode key and construct config hash
my $tree=$this;
+ my $previous;
my $current;
my $next;
- while (scalar(@leaves) > 0) {
- $current ||= shift (@leaves);
- $next = shift (@leaves);
- if ( $next =~ /^\d+$/ ) {
- if ($current =~ /^\d+$/) {
- @{$tree}[$current-1] ||= [];
- $tree=@{$tree}[$current-1];
+ my $root;
+ while (scalar(@leaves) > 0) { # While @leaves contains data
+ $current ||= shift (@leaves); # If root is empty, shift the first element of @leaves to $current
+ $root ||= $current;
+ if ( $root eq 'web' ) { $root = $current }
+ $next = shift (@leaves); # Shift the first element of @leaves in $next
+ if ( $next =~ /^\d+$/ ) { # If $next is an integer -> we are in an array
+ if ($current =~ /^\d+$/) { # If $current is an integer -> we are in an array
+ @{$tree}[$current-1] ||= []; # If the branch is not an array, create an empty array
+ $tree=@{$tree}[$current-1]; # Define this array as $tree root
}
else {
- $tree->{$current} ||= [];
- $tree=$tree->{$current};
+ $tree->{$current} ||= []; # If the branch is not an array, create an empty array
+ $tree=$tree->{$current}; # Define this array as $tree root
}
- } else {
- if ($current =~ /^\d+$/) {
- @{$tree}[$current-1] ||= {};
- $tree=@{$tree}[$current-1];
+ } else { # If $next is not an integer -> We are in a hash
+ if ($current =~ /^\d+$/) { # If $current is an integer -> we are in an array
+ my $index = $current;
+
+ # Manage per file indexes unicity
+ if ( ($root eq "static") ||
+ ($root eq "dynamic") ||
+ ( ( ($root eq 'status' ) ||
+ ($root eq 'statistics' ) ) &&
+ ($previous eq "content") ) )
+ {
+ # If $index is not in $dict, add it with counter++
+ if ( ! $dict->{$root}[$current] )
+ {
+ $dict->{$root}[$current] = ++$this->{'counter'}->{$root};
+ }
+ $index = $dict->{$root}[$current];
+ }
+
+ @{$tree}[$index-1] ||= {}; # If the branch is not an array, create an empty hash
+ $tree=@{$tree}[$index-1]; # Define this hash as $tree root
}
- else {
- $tree->{$current} ||= {};
- $tree=$tree->{$current};
+ else { # We are in a hash
+ $tree->{$current} ||= {}; # If the branch is not an array, create an empty hash
+ $tree=$tree->{$current}; # Define this hash as $tree root
}
}
if ( ($next eq 'rrd') and $value) { push(@{$this->{'rrd'}},$tree) };
+ $previous = $current;
$current = $next;
}
+
+ # Add value
if ($current =~ /^\d+$/) {
@{$tree}[$current-1] = $value;
}
diff --git a/rpimonitor/template/printer.conf b/rpimonitor/template/printer.conf
index cd20db6..a6e779c 100644
--- a/rpimonitor/template/printer.conf
+++ b/rpimonitor/template/printer.conf
@@ -1,59 +1,59 @@
# sudo apt-get install snmp
-dynamic.20.name=copies
-dynamic.20.source=snmpget -On -v2c -cpublic 192.168.0.14 .1.3.6.1.2.1.43.10.2.1.4.1.1
-dynamic.20.regexp=.* (\d+)$
-dynamic.20.postprocess=
-dynamic.20.rrd=GAUGE
-
-dynamic.21.name=magenta
-dynamic.21.source=wget http://192.168.0.14/general/status.html -o /dev/null -O /dev/stdout
-dynamic.21.regexp=Magenta.*height="(\d+)px.*Cyan
-dynamic.21.postprocess=
-dynamic.21.rrd=GAUGE
-
-dynamic.22.name=cyan
-dynamic.22.source=wget http://192.168.0.14/general/status.html -o /dev/null -O /dev/stdout
-dynamic.22.regexp=Cyan.*height="(\d+)px.*Yellow
-dynamic.22.postprocess=
-dynamic.22.rrd=GAUGE
-
-dynamic.23.name=yellow
-dynamic.23.source=wget http://192.168.0.14/general/status.html -o /dev/null -O /dev/stdout
-dynamic.23.regexp=Yellow.*height="(\d+)px.*Black
-dynamic.23.postprocess=
-dynamic.23.rrd=GAUGE
-
-dynamic.24.name=black
-dynamic.24.source=wget http://192.168.0.14/general/status.html -o /dev/null -O /dev/stdout
-dynamic.24.regexp=Black.*height="(\d+)px"
-dynamic.24.postprocess=
-dynamic.24.rrd=GAUGE
-
-web.status.1.content.10.name=Printer
-web.status.1.content.10.icon=printer.png
-web.status.1.content.10.line.1="Number of copy: "+data.copies+" "
-web.status.1.content.10.line.2="Black ("+Percent(data.black,55)+") "
-web.status.1.content.10.line.3=ProgressBar(data.black,55)
-web.status.1.content.10.line.4="Magenta ("+Percent(data.magenta,55)+") "
-web.status.1.content.10.line.5=ProgressBar(data.magenta,55)
-web.status.1.content.10.line.6="Cyan ("+Percent(data.cyan,55)+") "
-web.status.1.content.10.line.7=ProgressBar(data.cyan,55)
-web.status.1.content.10.line.8="Yellow ("+Percent(data.yellow,55)+") "
-web.status.1.content.10.line.9=ProgressBar(data.yellow,55)
-
-web.statistics.1.content.10.name=Printer
-web.statistics.1.content.10.graph.1=copies
-web.statistics.1.content.10.graph.2=black
-web.statistics.1.content.10.graph.3=magenta
-web.statistics.1.content.10.graph.4=cyan
-web.statistics.1.content.10.graph.5=yellow
-web.statistics.1.content.10.ds_graph_options.copies.color="#00FF00"
-web.statistics.1.content.10.ds_graph_options.black.color="#000000"
-web.statistics.1.content.10.ds_graph_options.magenta.color="#FF0000"
-web.statistics.1.content.10.ds_graph_options.cyan.color="#0000FF"
-web.statistics.1.content.10.ds_graph_options.yellow.color="#FFFF00"
-web.statistics.1.content.10.ds_graph_options.copies.yaxis=2
-web.statistics.1.content.10.graph_options.y2axis={ position: "right" }
-web.statistics.1.content.10.graph_options.legend= { position: "se"}
+dynamic.1.name=copies
+dynamic.1.source=snmpget -On -v2c -cpublic 192.168.0.14 .1.3.6.1.2.1.43.1.2.1.4.1.1
+dynamic.1.regexp=.* (\d+)$
+dynamic.1.postprocess=
+dynamic.1.rrd=GAUGE
+
+dynamic.2.name=magenta
+dynamic.2.source=wget http://192.168.0.14/general/status.html -o /dev/null -O /dev/stdout
+dynamic.2.regexp=Magenta.*height="(\d+)px.*Cyan
+dynamic.2.postprocess=
+dynamic.2.rrd=GAUGE
+
+dynamic.3.name=cyan
+dynamic.3.source=wget http://192.168.0.14/general/status.html -o /dev/null -O /dev/stdout
+dynamic.3.regexp=Cyan.*height="(\d+)px.*Yellow
+dynamic.3.postprocess=
+dynamic.3.rrd=GAUGE
+
+dynamic.4.name=yellow
+dynamic.4.source=wget http://192.168.0.14/general/status.html -o /dev/null -O /dev/stdout
+dynamic.4.regexp=Yellow.*height="(\d+)px.*Black
+dynamic.4.postprocess=
+dynamic.4.rrd=GAUGE
+
+dynamic.5.name=black
+dynamic.5.source=wget http://192.168.0.14/general/status.html -o /dev/null -O /dev/stdout
+dynamic.5.regexp=Black.*height="(\d+)px"
+dynamic.5.postprocess=
+dynamic.5.rrd=GAUGE
+
+web.status.1.content.1.name=Printer
+web.status.1.content.1.icon=printer.png
+web.status.1.content.1.line.1="Number of copy: "+data.copies+" "
+web.status.1.content.1.line.2="Black ("+Percent(data.black,55)+") "
+web.status.1.content.1.line.3=ProgressBar(data.black,55)
+web.status.1.content.1.line.4="Magenta ("+Percent(data.magenta,55)+") "
+web.status.1.content.1.line.5=ProgressBar(data.magenta,55)
+web.status.1.content.1.line.6="Cyan ("+Percent(data.cyan,55)+") "
+web.status.1.content.1.line.7=ProgressBar(data.cyan,55)
+web.status.1.content.1.line.8="Yellow ("+Percent(data.yellow,55)+") "
+web.status.1.content.1.line.9=ProgressBar(data.yellow,55)
+
+web.statistics.1.content.1.name=Printer
+web.statistics.1.content.1.graph.1=copies
+web.statistics.1.content.1.graph.2=black
+web.statistics.1.content.1.graph.3=magenta
+web.statistics.1.content.1.graph.4=cyan
+web.statistics.1.content.1.graph.5=yellow
+web.statistics.1.content.1.ds_graph_options.copies.color="#00FF00"
+web.statistics.1.content.1.ds_graph_options.black.color="#000000"
+web.statistics.1.content.1.ds_graph_options.magenta.color="#FF0000"
+web.statistics.1.content.1.ds_graph_options.cyan.color="#0000FF"
+web.statistics.1.content.1.ds_graph_options.yellow.color="#FFFF00"
+web.statistics.1.content.1.ds_graph_options.copies.yaxis=2
+web.statistics.1.content.1.graph_options.y2axis={ position: "right" }
+web.statistics.1.content.1.graph_options.legend= { position: "se"}
diff --git a/rpimonitor/template/services.conf b/rpimonitor/template/services.conf
index 512339c..a8e11ef 100644
--- a/rpimonitor/template/services.conf
+++ b/rpimonitor/template/services.conf
@@ -2,23 +2,23 @@
# External daemons information added into Raspberry Pi page
# http://www.iconseeker.com/search-icon/crystal-project-application/daemons.html
########################################################################
-dynamic.16.name=ssh
-dynamic.16.source=netstat -nlt
-dynamic.16.regexp=tcp .*:(22).*LISTEN
+dynamic.1.name=ssh
+dynamic.1.source=netstat -nlt
+dynamic.1.regexp=tcp .*:(22).*LISTEN
-dynamic.17.name=rpimonitor
-dynamic.17.source=netstat -nlt
-dynamic.17.regexp=tcp .*:(8888).*LISTEN
+dynamic.2.name=rpimonitor
+dynamic.2.source=netstat -nlt
+dynamic.2.regexp=tcp .*:(8888).*LISTEN
-dynamic.18.name=http
-dynamic.18.source=netstat -nlt
-dynamic.18.regexp=tcp .*:(80).*LISTEN
+dynamic.3.name=http
+dynamic.3.source=netstat -nlt
+dynamic.3.regexp=tcp .*:(80).*LISTEN
-dynamic.19.name=https
-dynamic.19.source=netstat -nlt
-dynamic.19.regexp=tcp .*:(443).*LISTEN
+dynamic.4.name=https
+dynamic.4.source=netstat -nlt
+dynamic.4.regexp=tcp .*:(443).*LISTEN
-web.status.1.content.9.name=Servers
-web.status.1.content.9.icon=daemons.png
-web.status.1.content.9.line.1="ssh : "+Label(data.ssh,"==22","OK","success")+Label(data.ssh,"!=22","KO","important")+" rpimonitor : "+Label(data.rpimonitor,"==8888","OK","success")+Label(data.rpimonitor,"!=8888","KO","important")+" nginx http : "+Label(data.http,"==80","OK","success")+Label(data.http,"!=80","KO","important")+" nginx https : "+Label(data.https,"==443","OK","success")+Label(data.https,"!=443","KO","important")
-web.status.1.content.9.line.2="ssh : "+Badge(data.ssh,"==22","OK","success")+Badge(data.ssh,"!=22","KO","important")+" rpimonitor : "+Badge(data.rpimonitor,"==8888","OK","success")+Badge(data.rpimonitor,"!=8888","KO","important")+" nginx http : "+Badge(data.http,"==80","OK","success")+Badge(data.http,"!=80","KO","important")+" nginx https : "+Badge(data.https,"==443","OK","success")+Badge(data.https,"!=443","KO","important")
+web.status.1.content.1.name=Servers
+web.status.1.content.1.icon=daemons.png
+web.status.1.content.1.line.1="ssh : "+Label(data.ssh,"==22","OK","success")+Label(data.ssh,"!=22","KO","important")+" rpimonitor : "+Label(data.rpimonitor,"==8888","OK","success")+Label(data.rpimonitor,"!=8888","KO","important")+" nginx http : "+Label(data.http,"==80","OK","success")+Label(data.http,"!=80","KO","important")+" nginx https : "+Label(data.https,"==443","OK","success")+Label(data.https,"!=443","KO","important")
+web.status.1.content.1.line.2="ssh : "+Badge(data.ssh,"==22","OK","success")+Badge(data.ssh,"!=22","KO","important")+" rpimonitor : "+Badge(data.rpimonitor,"==8888","OK","success")+Badge(data.rpimonitor,"!=8888","KO","important")+" nginx http : "+Badge(data.http,"==80","OK","success")+Badge(data.http,"!=80","KO","important")+" nginx https : "+Badge(data.https,"==443","OK","success")+Badge(data.https,"!=443","KO","important")
From 2f311bd978217368c97eaf46bc3a21d1629f73e8 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Mon, 25 Aug 2014 19:39:32 +0200
Subject: [PATCH 07/24] Update updatestatus.txt initial comment to match new
sysVinit startup script
---
rpimonitor/updatestatus.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rpimonitor/updatestatus.txt b/rpimonitor/updatestatus.txt
index 22d2db6..fd74d73 100644
--- a/rpimonitor/updatestatus.txt
+++ b/rpimonitor/updatestatus.txt
@@ -1 +1 @@
-Update needed...
Execute sudo apt-get update && sudo service rpimonitor update
+Update needed...
Execute Execute sudo apt-get update && sudo /usr/share/rpimonitor/scripts/updatePackagesStatus.sh
From 1a488ad89c4b2884db9826575ad0d0e2e87efb19 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Mon, 25 Aug 2014 19:59:25 +0200
Subject: [PATCH 08/24] Fix oid issue in printer.conf
---
rpimonitor/template/printer.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rpimonitor/template/printer.conf b/rpimonitor/template/printer.conf
index a6e779c..048665c 100644
--- a/rpimonitor/template/printer.conf
+++ b/rpimonitor/template/printer.conf
@@ -1,6 +1,6 @@
# sudo apt-get install snmp
dynamic.1.name=copies
-dynamic.1.source=snmpget -On -v2c -cpublic 192.168.0.14 .1.3.6.1.2.1.43.1.2.1.4.1.1
+dynamic.1.source=snmpget -On -v2c -cpublic 192.168.0.14 .1.3.6.1.2.1.43.10.2.1.4.1.1
dynamic.1.regexp=.* (\d+)$
dynamic.1.postprocess=
dynamic.1.rrd=GAUGE
From 212112df5ce23e3311f1d0832e169310a100c8d4 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Mon, 25 Aug 2014 22:47:20 +0200
Subject: [PATCH 09/24] Add parameters to customise menu logo, title and page
titles
---
rpimonitor/rpimonitord | 15 ++++++++++++---
rpimonitor/template/raspbian.conf | 6 ++++++
rpimonitor/web/js/rpimonitor.js | 15 +++++++++------
3 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/rpimonitor/rpimonitord b/rpimonitor/rpimonitord
index 28909b9..da51659 100755
--- a/rpimonitor/rpimonitord
+++ b/rpimonitor/rpimonitord
@@ -87,7 +87,7 @@ sub Load
$this->{'daemon'}->{'delay'} ||= 10;
$this->{'daemon'}->{'timeout'} ||= 5;
$this->{'daemon'}->{'sharedmemkey'}||= 20130906;
-
+
# Check user and group
$this->{'daemon'}->{'gid'} = getgrnam($this->{'daemon'}->{'user'}) || 1000;
$this->{'daemon'}->{'uid'} = getpwnam($this->{'daemon'}->{'group'}) || 1000;
@@ -116,6 +116,11 @@ sub Load
#print Data::Dumper->Dump([$this->{'rrdlist'}]);
+ # manage page common parameters
+ $this->{'web'}->{'page'}->{'icon'} ||= 'img/logo/png';
+ $this->{'web'}->{'page'}->{'menutitle'} ||= 'RPi-Monitor';
+ $this->{'web'}->{'page'}->{'pagetitle'} ||= 'RPi-Monitor';
+
# manage menu
foreach (@{$this->{'web'}->{'status'}}) {
$_->{'name'} and push(@{$this->{'menu'}->{'status'}}, $_->{'name'});
@@ -188,8 +193,8 @@ sub LoadFile
$index = $dict->{$root}[$current];
}
- @{$tree}[$index-1] ||= {}; # If the branch is not an array, create an empty hash
- $tree=@{$tree}[$index-1]; # Define this hash as $tree root
+ @{$tree}[$index-1] ||= {}; # If the branch is not an array, create an empty hash
+ $tree=@{$tree}[$index-1]; # Define this hash as $tree root
}
else { # We are in a hash
$tree->{$current} ||= {}; # If the branch is not an array, create an empty hash
@@ -256,6 +261,7 @@ use IO::Handle;
use HTTP::Daemon;
use HTTP::Status;
use JSON;
+use Sys::Hostname;
#use Data::Dumper;
sub new
@@ -272,6 +278,7 @@ sub new
"/statistics.json",
"/menu.json",
"/friends.json",
+ "/page.json",
"/version.json",
"/favicon.ico",
@@ -469,6 +476,8 @@ sub Run
$this->{'status'} = encode_json(\@{$configuration->{'web'}->{'status'}});
$this->{'statistics'} = encode_json(\@{$configuration->{'web'}->{'statistics'}});
$this->{'friends'} = encode_json(\@{$configuration->{'web'}->{'friends'}});
+ $this->{'page'} = encode_json(\%{$configuration->{'web'}->{'page'}});
+ $monitor->{'static'}->{'hostname'} = hostname();
$this->{'static'} = encode_json(\%{$monitor->{'static'}});
$this->{'menu'} = encode_json(\%{$configuration->{'menu'}});
$this->{'version'} = "{\"version\":\"$configuration->{'version'}\"}";
diff --git a/rpimonitor/template/raspbian.conf b/rpimonitor/template/raspbian.conf
index 194df25..3c3dffd 100644
--- a/rpimonitor/template/raspbian.conf
+++ b/rpimonitor/template/raspbian.conf
@@ -333,6 +333,12 @@ dynamic.15.rrd=GAUGE
#web.friends.3.name=Laptop
#web.friends.3.link=http://192.168.0.38/
+#######################################################################
+
+#web.page.icon='img/logo.png'
+#web.page.menutitle='RPi-Monitor ('+data.hostname+') '
+#web.page.pagetitle='RPi-Monitor ('+data.hostname+')'
+
#######################################################################
web.status.1.name=Raspberry Pi
web.status.1.content.1.name=Version
diff --git a/rpimonitor/web/js/rpimonitor.js b/rpimonitor/web/js/rpimonitor.js
index 661f400..4fc3846 100644
--- a/rpimonitor/web/js/rpimonitor.js
+++ b/rpimonitor/web/js/rpimonitor.js
@@ -103,11 +103,11 @@ function ShowFriends(){
function AddFooter(){
$('#footer').html(
- ''
+ ''
);
}
@@ -202,6 +202,9 @@ function AddDialogs(){
}
function AddTopmenu(){
+ page = getData('page')
+ data = getData('static')
+ document.title = eval(page.pagetitle);
topmenu=
''+
'
'+
@@ -211,7 +214,7 @@ function AddTopmenu(){
'
'+
'
'+
''+
- '
RPi-Monitor'+
+ '
'+eval(page.menutitle)+''+
'
'+
'
'+
''+
From 63699db08d66ebfb3ffba0063374d73a2c96d21c Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Fri, 29 Aug 2014 21:25:51 +0200
Subject: [PATCH 10/24] Update default updatestatus.txt
---
rpimonitor/updatestatus.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rpimonitor/updatestatus.txt b/rpimonitor/updatestatus.txt
index fd74d73..514d54f 100644
--- a/rpimonitor/updatestatus.txt
+++ b/rpimonitor/updatestatus.txt
@@ -1 +1 @@
-Update needed... Execute Execute sudo apt-get update && sudo /usr/share/rpimonitor/scripts/updatePackagesStatus.sh
+Update needed...
Execute sudo apt-get update && sudo /usr/share/rpimonitor/scripts/updatePackagesStatus.sh
From b82a58db1be19a402f819e4356f6396bc74e961a Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Fri, 29 Aug 2014 21:27:14 +0200
Subject: [PATCH 11/24] Implement title anc icon configuration when internal
server is not used
---
rpimonitor/rpimonitord | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/rpimonitor/rpimonitord b/rpimonitor/rpimonitord
index da51659..7833c09 100755
--- a/rpimonitor/rpimonitord
+++ b/rpimonitor/rpimonitord
@@ -261,7 +261,6 @@ use IO::Handle;
use HTTP::Daemon;
use HTTP::Status;
use JSON;
-use Sys::Hostname;
#use Data::Dumper;
sub new
@@ -477,7 +476,6 @@ sub Run
$this->{'statistics'} = encode_json(\@{$configuration->{'web'}->{'statistics'}});
$this->{'friends'} = encode_json(\@{$configuration->{'web'}->{'friends'}});
$this->{'page'} = encode_json(\%{$configuration->{'web'}->{'page'}});
- $monitor->{'static'}->{'hostname'} = hostname();
$this->{'static'} = encode_json(\%{$monitor->{'static'}});
$this->{'menu'} = encode_json(\%{$configuration->{'menu'}});
$this->{'version'} = "{\"version\":\"$configuration->{'version'}\"}";
@@ -558,6 +556,10 @@ sub Run
or warn $!;
print FILE encode_json \@{$configuration->{'web'}->{'status'}} ;
close(FILE);
+ open(FILE, "> $configuration->{'daemon'}->{'webroot'}/page.json")
+ or warn $!;
+ print FILE encode_json \%{$configuration->{'web'}->{'page'}} ;
+ close(FILE);
open(FILE, "> $configuration->{'daemon'}->{'webroot'}/statistics.json")
or warn $!;
print FILE encode_json \@{$configuration->{'web'}->{'statistics'}} ;
@@ -974,6 +976,7 @@ sub Run
package main;
use strict;
use POSIX;
+use Sys::Hostname;
sub help
{
@@ -1116,6 +1119,7 @@ $pidfile and &daemonize;
my $monitor = Monitor->new();
# Process data that should be extracted once, before the server starts
$monitor->Process($configuration,'static');
+$monitor->{'static'}->{'hostname'} = hostname();
$SIG{INT} = sub { stop(); }; # catch Ctrl+C
From c6247fa9c73e3bd8ec6610910e40d0f5d4cc3563 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Fri, 29 Aug 2014 23:18:02 +0200
Subject: [PATCH 12/24] Put charset definition into the 1024 first char as
recommanded by firefox
---
rpimonitor/web/index.html | 2 +-
rpimonitor/web/shellinabox.html | 2 +-
rpimonitor/web/statistics.html | 2 +-
rpimonitor/web/status.html | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rpimonitor/web/index.html b/rpimonitor/web/index.html
index 160eabd..ccee902 100644
--- a/rpimonitor/web/index.html
+++ b/rpimonitor/web/index.html
@@ -19,11 +19,11 @@
RPi-Monitor
+
-
diff --git a/rpimonitor/web/shellinabox.html b/rpimonitor/web/shellinabox.html
index 7f5e66f..2d72cf9 100644
--- a/rpimonitor/web/shellinabox.html
+++ b/rpimonitor/web/shellinabox.html
@@ -19,11 +19,11 @@
RPi-Monitor
+
-
diff --git a/rpimonitor/web/statistics.html b/rpimonitor/web/statistics.html
index 72b7b51..36c6695 100644
--- a/rpimonitor/web/statistics.html
+++ b/rpimonitor/web/statistics.html
@@ -19,11 +19,11 @@
RPi-Monitor
+
-
diff --git a/rpimonitor/web/status.html b/rpimonitor/web/status.html
index 6744abe..d49c1ab 100644
--- a/rpimonitor/web/status.html
+++ b/rpimonitor/web/status.html
@@ -19,11 +19,11 @@
RPi-Monitor
+
-
From 99851b6c79e84e8990fc652339d1894f20bd7242 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Fri, 29 Aug 2014 23:19:39 +0200
Subject: [PATCH 13/24] Fix logo and title potential bugs and define default
title and logo in case of missconfiguration
---
rpimonitor/rpimonitord | 2 +-
rpimonitor/template/raspbian.conf | 6 +++---
rpimonitor/web/js/rpimonitor.js | 21 +++++++++++++++++++--
3 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/rpimonitor/rpimonitord b/rpimonitor/rpimonitord
index 7833c09..882bda9 100755
--- a/rpimonitor/rpimonitord
+++ b/rpimonitor/rpimonitord
@@ -117,7 +117,7 @@ sub Load
#print Data::Dumper->Dump([$this->{'rrdlist'}]);
# manage page common parameters
- $this->{'web'}->{'page'}->{'icon'} ||= 'img/logo/png';
+ $this->{'web'}->{'page'}->{'icon'} ||= 'img/logo.png';
$this->{'web'}->{'page'}->{'menutitle'} ||= 'RPi-Monitor';
$this->{'web'}->{'page'}->{'pagetitle'} ||= 'RPi-Monitor';
diff --git a/rpimonitor/template/raspbian.conf b/rpimonitor/template/raspbian.conf
index 3c3dffd..75ccc4c 100644
--- a/rpimonitor/template/raspbian.conf
+++ b/rpimonitor/template/raspbian.conf
@@ -335,9 +335,9 @@ dynamic.15.rrd=GAUGE
#######################################################################
-#web.page.icon='img/logo.png'
-#web.page.menutitle='RPi-Monitor ('+data.hostname+') '
-#web.page.pagetitle='RPi-Monitor ('+data.hostname+')'
+web.page.icon='img/logo.png'
+web.page.menutitle='RPi-Monitor ('+data.hostname+') '
+web.page.pagetitle='RPi-Monitor ('+data.hostname+')'
#######################################################################
web.status.1.name=Raspberry Pi
diff --git a/rpimonitor/web/js/rpimonitor.js b/rpimonitor/web/js/rpimonitor.js
index 4fc3846..9c84db0 100644
--- a/rpimonitor/web/js/rpimonitor.js
+++ b/rpimonitor/web/js/rpimonitor.js
@@ -204,7 +204,24 @@ function AddDialogs(){
function AddTopmenu(){
page = getData('page')
data = getData('static')
- document.title = eval(page.pagetitle);
+ try {
+ document.title = eval(page.pagetitle);
+ }
+ catch (err) {
+ document.title=page.pagetitle;
+ }
+ try {
+ icon = eval(page.icon);
+ }
+ catch (err) {
+ icon=page.icon;
+ }
+ try {
+ menutitle = eval(page.menutitle);
+ }
+ catch (err) {
+ menutitle=page.menutitle;
+ }
topmenu=
''+
'
'+
@@ -214,7 +231,7 @@ function AddTopmenu(){
'
'+
'
'+
''+
- '
'+eval(page.menutitle)+''+
+ '
'+menutitle+''+
'
'+
'
'+
''+
From ab079b3a4e32b390c3a1f0b5e9b0688cda868584 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Sat, 30 Aug 2014 16:24:41 +0200
Subject: [PATCH 14/24] Add 'include' to load configuration additionnal files
---
rpimonitor/rpimonitord | 1 +
rpimonitor/template/raspbian.conf | 1 +
2 files changed, 2 insertions(+)
diff --git a/rpimonitor/rpimonitord b/rpimonitor/rpimonitord
index 882bda9..b5304ed 100755
--- a/rpimonitor/rpimonitord
+++ b/rpimonitor/rpimonitord
@@ -153,6 +153,7 @@ sub LoadFile
while (){
chomp;
/^\s*#|^$/ and next; # Ignore comments
+ /^include=(.*)/ and -f $1 and push($this->{'daemon'}->{'confFiles'}, $1) and next;
my ($key, $value) = /^([^=]*)=(.*)/; # Extract key and value
my @leaves=split('\.', $key); # Explode key and construct config hash
my $tree=$this;
diff --git a/rpimonitor/template/raspbian.conf b/rpimonitor/template/raspbian.conf
index 75ccc4c..7615f5a 100644
--- a/rpimonitor/template/raspbian.conf
+++ b/rpimonitor/template/raspbian.conf
@@ -452,3 +452,4 @@ web.statistics.1.content.8.name=Temperature
web.statistics.1.content.8.graph.1=soc_temp
web.statistics.1.content.8.ds_graph_options.soc_temp.label=Core temperature (deg C)
+include=/etc/rpimonitor/template/services.conf
From 9c49547ebdd0f27cc675b826ca8be7f029ad6079 Mon Sep 17 00:00:00 2001
From: Xavier Berger
Date: Sun, 31 Aug 2014 18:05:09 +0200
Subject: [PATCH 15/24] Split configuration file and use 'include' keyword
---
rpimonitor/template/cpu.conf | 46 +++
rpimonitor/template/dht11.conf | 73 ++--
rpimonitor/template/memory.conf | 39 ++
rpimonitor/template/network.conf | 35 ++
rpimonitor/template/printer.conf | 12 +
rpimonitor/template/raspbian.conf | 381 ++++-------------
rpimonitor/template/raspbmc.conf | 425 +------------------
rpimonitor/template/sdcard.conf | 55 +++
rpimonitor/template/sdcard_raspbmc.conf | 56 +++
rpimonitor/template/sdcard_xbian.conf | 55 +++
rpimonitor/template/services.conf | 12 +-
rpimonitor/template/storage.conf | 8 +-
rpimonitor/template/swap.conf | 31 ++
rpimonitor/template/temperature.conf | 19 +
rpimonitor/template/temperature_xbian.conf | 19 +
rpimonitor/template/uptime.conf | 21 +
rpimonitor/template/version.conf | 50 +++
rpimonitor/template/wlan.conf | 35 ++
rpimonitor/template/xbian.conf | 453 +--------------------
19 files changed, 640 insertions(+), 1185 deletions(-)
create mode 100644 rpimonitor/template/cpu.conf
create mode 100644 rpimonitor/template/memory.conf
create mode 100644 rpimonitor/template/network.conf
create mode 100644 rpimonitor/template/sdcard.conf
create mode 100644 rpimonitor/template/sdcard_raspbmc.conf
create mode 100644 rpimonitor/template/sdcard_xbian.conf
create mode 100644 rpimonitor/template/swap.conf
create mode 100644 rpimonitor/template/temperature.conf
create mode 100644 rpimonitor/template/temperature_xbian.conf
create mode 100644 rpimonitor/template/uptime.conf
create mode 100644 rpimonitor/template/version.conf
create mode 100644 rpimonitor/template/wlan.conf
diff --git a/rpimonitor/template/cpu.conf b/rpimonitor/template/cpu.conf
new file mode 100644
index 0000000..9ac3bc1
--- /dev/null
+++ b/rpimonitor/template/cpu.conf
@@ -0,0 +1,46 @@
+########################################################################
+# Extract CPU information
+# Page: 1
+# Information Status Statistics
+# - cpu frequency - yes - no
+# - cpu voltage - yes - no
+# - cpu load 1, 5, 15 - yes - yes
+# - cpu scaling governor - yes - no
+########################################################################
+dynamic.1.name=cpu_frequency
+dynamic.1.source=/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
+dynamic.1.regexp=(.*)
+dynamic.1.postprocess=$1/1000
+dynamic.1.rrd=
+
+dynamic.2.name=cpu_voltage
+dynamic.2.source=vcgencmd measure_volts core
+dynamic.2.regexp=(\d+.\d+)V
+dynamic.2.postprocess=
+dynamic.2.rrd=
+
+dynamic.3.name=load1,load5,load15
+dynamic.3.source=/proc/loadavg
+dynamic.3.regexp=^(\S+)\s(\S+)\s(\S+)
+dynamic.3.postprocess=
+dynamic.3.rrd=GAUGE
+
+dynamic.4.name=scaling_governor
+dynamic.4.source=/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+dynamic.4.regexp=(.*)
+dynamic.4.postprocess=
+dynamic.4.rrd=
+
+web.status.1.content.1.name=CPU
+web.status.1.content.1.icon=cpu.png
+web.status.1.content.1.line.1="Loads: " + data.load1 + " [1min] - " + data.load5 + " [5min] - " + data.load15 + " [15min]"
+web.status.1.content.1.line.2="CPU frequency: " + data.cpu_frequency + "MHz Voltage: " + data.cpu_voltage + "V "
+web.status.1.content.1.line.3="Scaling governor: " + data.scaling_governor + " "
+
+web.statistics.1.content.1.name=CPU Loads
+web.statistics.1.content.1.graph.1=load1
+web.statistics.1.content.1.graph.2=load5
+web.statistics.1.content.1.graph.3=load15
+web.statistics.1.content.1.ds_graph_options.load1.label=Load 1min
+web.statistics.1.content.1.ds_graph_options.load5.label=Load 5min
+web.statistics.1.content.1.ds_graph_options.load15.label=Load 15min
diff --git a/rpimonitor/template/dht11.conf b/rpimonitor/template/dht11.conf
index 0442719..e2bb56b 100644
--- a/rpimonitor/template/dht11.conf
+++ b/rpimonitor/template/dht11.conf
@@ -1,66 +1,45 @@
########################################################################
-# Living root temperature and humidity added in dedicated pages
-########################################################################
-dynamic.16.name=living_room_temp
-dynamic.16.source=/sys/devices/w1_bus_master1/28-000004fe1847/w1_slave
-dynamic.16.regexp=t=(\d+)$
-dynamic.16.postprocess=$1/1000
-dynamic.16.rrd=GAUGE
-
+# Extract temperature and humidity from DHT11/DHT22
+# Page: 2
+# Information Status Statistics
+# - tempetature - yes - yes
+# - humidity - yes - yes
+#######################################################################
+# Add new pages (number 2)
web.status.2.name=Living room
+web.statistics.2.name=Living room
+
+# Get dynamic data
+dynamic.1.name=living_room_temp
+dynamic.1.source=/sys/devices/w1_bus_master1/28-000004fe1847/w1_slave
+dynamic.1.regexp=t=(\d+)$
+dynamic.1.postprocess=$1/1000
+dynamic.1.rrd=GAUGE
+
+dynamic.2.name=humidity
+dynamic.2.source=Adafruit_DHT 11 27
+dynamic.2.regexp=Hum = (\S+)
+dynamic.2.postprocess=
+dynamic.2.rrd=GAUGE
+
+# Add a line of status in page number 2
web.status.2.content.1.name=Temperature
web.status.2.content.1.icon=cpu_temp.png
web.status.2.content.1.line.1="Ambiant Temperature: "+data.living_room_temp+"°C "
+web.status.2.content.1.line.2="Ambiant Humidity: "+data.humidity+"% "
-web.statistics.2.name=Living room
+# Add a statistic graph (with 2 curves suing separate scales) in page number 2
web.statistics.2.content.1.name=Temperature
web.statistics.2.content.1.graph.1=living_room_temp
-web.statistics.2.content.1.ds_graph_options.living_room_temp.label=Ambient temp. (deg C)
-
-dynamic.17.name=humidity
-dynamic.17.source=Adafruit_DHT 11 27
-dynamic.17.regexp=Hum = (\S+)
-dynamic.17.postprocess=
-dynamic.17.rrd=GAUGE
-
web.statistics.2.content.1.graph.2=humidity
+web.statistics.2.content.1.ds_graph_options.living_room_temp.label=Ambient temp. (deg C)
web.statistics.2.content.1.ds_graph_options.humidity.label=Humidity (%)
web.statistics.2.content.1.ds_graph_options.humidity.yaxis=2
#web.statistics.2.content.1.graph_options.legend= { position: "sw"}
web.statistics.2.content.1.graph_options.y2axis={ position: "right", min: 0, max: 100 }
-########################################################################
-# Graph WLAN
-########################################################################
-dynamic.18.name=wifi_received
-dynamic.18.source=/sys/class/net/wlan0/statistics/rx_bytes
-dynamic.18.regexp=(.*)
-dynamic.18.postprocess=$1*-1
-dynamic.18.rrd=DERIVE
-dynamic.18.max=0
-
-dynamic.19.name=wifi_send
-dynamic.19.source=/sys/class/net/wlan0/statistics/tx_bytes
-dynamic.19.regexp=(.*)
-dynamic.19.postprocess=
-dynamic.19.rrd=DERIVE
-dynamic.19.min=0
-
-web.status.1.content.9.name=WiFi
-web.status.1.content.9.icon=wifi.png
-web.status.1.content.9.line.1="WiFi Sent: "+KMG(data.wifi_send)+" Received: "+KMG(Math.abs(data.wifi_received)) + " "
-web.statistics.1.content.9.name=WiFi
-web.statistics.1.content.9.graph.1=wifi_send
-web.statistics.1.content.9.graph.2=wifi_received
-web.statistics.1.content.9.graph_options.yaxis={ tickFormatter: function (v) { if (Math.abs(v) > 1048576) return (Math.round(v*10/1024/1024)/10) + " MiB/s" ; if (Math.abs(v) > 1024) return (Math.round(v*10/1024)/10) + " KiB/s" ; else return v + " B/s" }, }
-web.statistics.1.content.9.ds_graph_options.wifi_send.label=Upload bandwidth (bits)
-web.statistics.1.content.9.ds_graph_options.wifi_send.lines={ fill: true }
-web.statistics.1.content.9.ds_graph_options.wifi_send.color="#FF7777"
-web.statistics.1.content.9.ds_graph_options.wifi_received.label=Download bandwidth (bits)
-web.statistics.1.content.9.ds_graph_options.wifi_received.lines={ fill: true }
-web.statistics.1.content.9.ds_graph_options.wifi_received.color="#77FF77"
diff --git a/rpimonitor/template/memory.conf b/rpimonitor/template/memory.conf
new file mode 100644
index 0000000..f4533bf
--- /dev/null
+++ b/rpimonitor/template/memory.conf
@@ -0,0 +1,39 @@
+########################################################################
+# Extract Memory information
+# Page: 1
+# Information Status Statistics
+# - memory total - yes - yes
+# - memory free - yes - yes
+# - memory available - yes - yes
+########################################################################
+static.5.name=memory_total
+static.5.source=/proc/meminfo
+static.5.regexp=MemTotal:\s+(\d+)
+static.5.postprocess=$1/1024
+
+dynamic.9.name=memory_free
+dynamic.9.source=/proc/meminfo
+dynamic.9.regexp=MemFree:\s+(\d+)
+dynamic.9.postprocess=$1/1024
+dynamic.9.rrd=GAUGE
+
+dynamic.15.name=memory_available
+dynamic.15.source=/usr/bin/free -mk
+dynamic.15.regexp=^-\/\+ buffers\/cache:\s+\d+\s+(\d+)
+dynamic.15.postprocess=$1/1024
+dynamic.15.rrd=GAUGE
+
+web.status.1.content.5.name=Memory
+web.status.1.content.5.icon=memory.png
+web.status.1.content.5.line.1="Used: " + KMG(data.memory_total-data.memory_available,'M') + " (" + Percent(data.memory_total-data.memory_available,data.memory_total,'M') + " ) Available: " + KMG(data.memory_available,'M') + " Total: " + KMG(data.memory_total,'M') + " "
+web.status.1.content.5.line.2=ProgressBar(data.memory_total-data.memory_available,data.memory_total)
+
+web.statistics.1.content.6.name=Memory
+web.statistics.1.content.6.graph.1=memory_total
+web.statistics.1.content.6.graph.2=memory_free
+web.statistics.1.content.6.graph.3=memory_available
+web.statistics.1.content.6.ds_graph_options.memory_total.label=Total Memory(MB)
+web.statistics.1.content.6.ds_graph_options.memory_free.label=Free Memory (MB)
+web.statistics.1.content.6.ds_graph_options.memory_free.color="#7777FF"
+web.statistics.1.content.6.ds_graph_options.memory_available.label=Available Memory (MB)
+web.statistics.1.content.6.ds_graph_options.memory_available.color="#77FF77"
diff --git a/rpimonitor/template/network.conf b/rpimonitor/template/network.conf
new file mode 100644
index 0000000..f0fd730
--- /dev/null
+++ b/rpimonitor/template/network.conf
@@ -0,0 +1,35 @@
+########################################################################
+# Extract Network information
+# Page: 1
+# Information Status Statistics
+# - recieved - yes - yes
+# - send - yes - yes
+########################################################################
+dynamic.10.name=net_received
+dynamic.10.source=/sys/class/net/eth0/statistics/rx_bytes
+dynamic.10.regexp=(.*)
+dynamic.10.postprocess=$1*-1
+dynamic.10.rrd=DERIVE
+dynamic.10.max=0
+
+dynamic.11.name=net_send
+dynamic.11.source=/sys/class/net/eth0/statistics/tx_bytes
+dynamic.11.regexp=(.*)
+dynamic.11.postprocess=
+dynamic.11.rrd=DERIVE
+dynamic.11.min=0
+
+web.status.1.content.8.name=Network
+web.status.1.content.8.icon=network.png
+web.status.1.content.8.line.1="Ethernet Sent: "+KMG(data.net_send)+" Received: "+KMG(Math.abs(data.net_received)) + " "
+
+web.statistics.1.content.2.name=Network
+web.statistics.1.content.2.graph.1=net_send
+web.statistics.1.content.2.graph.2=net_received
+web.statistics.1.content.2.graph_options.yaxis={ tickFormatter: function (v) { if (Math.abs(v) > 1048576) return (Math.round(v*10/1024/1024)/10) + " MiB/s" ; if (Math.abs(v) > 1024) return (Math.round(v*10/1024)/10) + " KiB/s" ; else return v + " B/s" }, }
+web.statistics.1.content.2.ds_graph_options.net_send.label=Upload bandwidth (bytes)
+web.statistics.1.content.2.ds_graph_options.net_send.lines={ fill: true }
+web.statistics.1.content.2.ds_graph_options.net_send.color="#FF7777"
+web.statistics.1.content.2.ds_graph_options.net_received.label=Download bandwidth (bytes)
+web.statistics.1.content.2.ds_graph_options.net_received.lines={ fill: true }
+web.statistics.1.content.2.ds_graph_options.net_received.color="#77FF77"
diff --git a/rpimonitor/template/printer.conf b/rpimonitor/template/printer.conf
index 048665c..84dfb87 100644
--- a/rpimonitor/template/printer.conf
+++ b/rpimonitor/template/printer.conf
@@ -1,4 +1,16 @@
+########################################################################
+# Extract Printer information
+# Page: 1
+# Information Status Statistics
+# - copie - yes - yes
+# - magenta - yes - yes
+# - cyan - yes - yes
+# - yellow - yes - yes
+# - black - yes - yes
+#
+# Note: snmp is required to get number of copies.
# sudo apt-get install snmp
+########################################################################
dynamic.1.name=copies
dynamic.1.source=snmpget -On -v2c -cpublic 192.168.0.14 .1.3.6.1.2.1.43.10.2.1.4.1.1
dynamic.1.regexp=.* (\d+)$
diff --git a/rpimonitor/template/raspbian.conf b/rpimonitor/template/raspbian.conf
index 7615f5a..607338f 100644
--- a/rpimonitor/template/raspbian.conf
+++ b/rpimonitor/template/raspbian.conf
@@ -1,20 +1,29 @@
########################################################################
-# KPI extraction configuration
#
+# KPI extraction configuration
+#
# This part of the configuration file is defining which data to
-# extract how to extract then and when.
-#
+# extract how to extract them and when.
+#
+# Specific 'include' keyword is available to add a file at the end of
+# the list of configuration files to be loaded.
+#
+# include=
+# is the full path to the
+# configuration file to add at the end of the list of configuration
+# files to be loaded.
+#
# Static KPI are extracted once at rpimonitord startup. Each statistic
# is identified into the conf file by a line stating with the keyword
# static and an identifier
-#
+#
# Each static KPI is defined by an id and with 4 parameters
-#
+#
# static..name=
# is a string representing the KPI or the list of KPI
# separated by comma. Each name has to be unique.
# Only alpha numerical charter and underscore are accepted.
-#
+#
# static..source=
# is a file or an executable file within the path.
# If the file exists, rpimonitord will read its content. If the file
@@ -22,24 +31,24 @@
# the output.
# Warning: specifying an executable by its absolute name will tell
# rpimonitord to read the content of the executable.1.graph.
-#
+#
# static..regexp=
# is the regular expression extracting information from
# data source. Regexp groups () has to be used to extract the data
# In case of KPI list, each group will be affected to a KPI name.
-#
+#
# static..postprocess=
# is an expression defining the postprocessing to
# be applied on result. KPI are idendified by $1. In case of list,
# other KPI are identified by $2, $3 .graph..
# This parameter will be evaluate by the command eval of perl.
-#
+#
# Dynamic KPI are extracted periodically (defined by daemon.delay)
# Each statistic is identified into the conf file by a line stating
# with the keyword dynamic and an identifier
-#
+#
# Each dynamic KPI is defined by an id and with 5 parameters
-#
+#
# dynamic..name=
# dynamic..source=
# dynamic..regexp=
@@ -47,7 +56,7 @@
# , , ,
# This 4 first parameters have the same signification as for static
# parameters.
-#
+#
# dynamic..rrd=<|GAUGE|COUNTER|DERIVE|ABSOLUTE|COMPUTE>
# The 5th parameter is defining if the KPI has to be stored into a RRD
# database and how <|GAUGE|COUNTER|DERIVE|ABSOLUTE|COMPUTE>. If the
@@ -62,187 +71,66 @@
# value, it will be stored int RRD database as unknown.
# These limits are usefull to handle counter that fall down to 0 when
# they reach their limit (Ex: network graphs)
-#
+#
# Note: Static values are accessible for the post processing using the
# variable $this->{'static'}->{'static_data_name'} and can be used.
# You can refer to swap data extraction to see an example.
#
########################################################################
-static.1.name=distribution
-static.1.source=/etc/os-release
-static.1.regexp=PRETTY_NAME.\"(.*)\"
-static.1.postprocess=
-
-static.2.name=kernel_version
-static.2.source=uname -msr
-static.2.regexp=(.*)
-static.2.postprocess=
-
-static.3.name=firmware
-static.3.source=/proc/version
-static.3.regexp=(#\d+)
-static.3.postprocess=
-
-static.4.name=processor
-static.4.source=/proc/cpuinfo
-static.4.regexp=(?:Processor|model name)\s+: (.*)
-static.4.postprocess=
-
-static.5.name=memory_total
-static.5.source=/proc/meminfo
-static.5.regexp=MemTotal:\s+(\d+)
-static.5.postprocess=$1/1024
-
-static.6.name=swap_total
-static.6.source=/proc/meminfo
-static.6.regexp=SwapTotal:\s+(\d+)
-static.6.postprocess=$1/1024
-
-static.7.name=sdcard_root_total
-static.7.source=df /
-static.7.regexp=\S+\s+(\d+).*\/$
-static.7.postprocess=$1/1024
-
-static.8.name=sdcard_boot_total
-static.8.source=df /boot
-static.8.regexp=\S+\s+(\d+).*\/boot$
-static.8.postprocess=$1/1024
-
-##############################################################################
-dynamic.1.name=upgrade
-dynamic.1.source=/var/lib/rpimonitor/updatestatus.txt
-dynamic.1.regexp=(\d+ upgraded, \d+ .*|.* .*)
-dynamic.1.postprocess=
-dynamic.1.rrd=
-
-dynamic.2.name=packages
-dynamic.2.source=/var/lib/rpimonitor/updatestatus.txt
-dynamic.2.regexp=^ (.*)\d+ upgraded,
-dynamic.2.postprocess=
-dynamic.2.rrd=
-
-dynamic.3.name=cpu_frequency
-dynamic.3.source=/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
-dynamic.3.regexp=(.*)
-dynamic.3.postprocess=$1/1000
-dynamic.3.rrd=
-
-dynamic.4.name=cpu_voltage
-dynamic.4.source=vcgencmd measure_volts core
-dynamic.4.regexp=(\d+.\d+)V
-dynamic.4.postprocess=
-dynamic.4.rrd=
-
-dynamic.5.name=load1,load5,load15
-dynamic.5.source=/proc/loadavg
-dynamic.5.regexp=^(\S+)\s(\S+)\s(\S+)
-dynamic.5.postprocess=
-dynamic.5.rrd=GAUGE
-
-dynamic.6.name=sdcard_root_used
-dynamic.6.source=df /
-dynamic.6.regexp=\S+\s+\d+\s+(\d+).*\/$
-dynamic.6.postprocess=$1/1024
-dynamic.6.rrd=GAUGE
-
-dynamic.7.name=sdcard_boot_used
-dynamic.7.source=df /boot
-dynamic.7.regexp=\S+\s+\d+\s+(\d+).*\/boot$
-dynamic.7.postprocess=$1/1024
-dynamic.7.rrd=GAUGE
-
-dynamic.8.name=swap_used
-dynamic.8.source=/proc/meminfo
-dynamic.8.regexp=SwapFree:\s+(\d+)
-dynamic.8.postprocess=$this->{'static'}->{'swap_total'} - ($1/1024)
-dynamic.8.rrd=GAUGE
-
-dynamic.9.name=memory_free
-dynamic.9.source=/proc/meminfo
-dynamic.9.regexp=MemFree:\s+(\d+)
-dynamic.9.postprocess=$1/1024
-dynamic.9.rrd=GAUGE
-
-dynamic.10.name=net_received
-dynamic.10.source=/sys/class/net/eth0/statistics/rx_bytes
-dynamic.10.regexp=(.*)
-dynamic.10.postprocess=$1*-1
-dynamic.10.rrd=DERIVE
-dynamic.10.max=0
-
-dynamic.11.name=net_send
-dynamic.11.source=/sys/class/net/eth0/statistics/tx_bytes
-dynamic.11.regexp=(.*)
-dynamic.11.postprocess=
-dynamic.11.rrd=DERIVE
-dynamic.11.min=0
-
-dynamic.12.name=soc_temp
-dynamic.12.source=/sys/devices/virtual/thermal/thermal_zone0/temp
-dynamic.12.regexp=(.*)
-dynamic.12.postprocess=$1/1000
-dynamic.12.rrd=GAUGE
-
-dynamic.13.name=uptime
-dynamic.13.source=/proc/uptime
-dynamic.13.regexp=(^\S+)
-dynamic.13.postprocess=
-dynamic.13.rrd=GAUGE
-
-dynamic.14.name=scaling_governor
-dynamic.14.source=/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
-dynamic.14.regexp=(.*)
-dynamic.14.postprocess=
-dynamic.14.rrd=
-
-dynamic.15.name=memory_available
-dynamic.15.source=/usr/bin/free -mk
-dynamic.15.regexp=^-\/\+ buffers\/cache:\s+\d+\s+(\d+)
-dynamic.15.postprocess=$1/1024
-dynamic.15.rrd=GAUGE
-
-
-########################################################################
-# Web interface configuration
#
+# Web interface configuration
+#
# Friends are defining a displayed name and a link reachable from a
# top left menu visible if at least one friends is configured. Each
# friend is identified by its and is described by the 2 following
# parameters
-#
+#
# web.friends..name=
# web.friends..link=
-#
+#
# web.friends..name=
# is the name printed into the drop down menu
-#
+#
# web.friends..link=
# is the link to another RPi-Monitor running
# into the friend machine.
-#
-#
+#
+# web.page.icon=
+# is the path and filename of
+# the icon to be displayed into RPi-Monitor title bar
+#
+# web.page.menutitle=
+# javascript code defining the text displayed into
+# RPi-Monotor title bar. This code can use status information with
+# the keyword 'data' including the 'data.hostname' available natively
+#
+# web.page.pagetitle=
+# javascript code defining the text displayed into
+# tab and window title bar. This code can use status information with
+# the keyword 'data' including the 'data.hostname' available natively
+#
# The status page is fully configurable.
# It is possible to define multiple pages. Each page is identified by
# its .
-#
+#
# web.status..name=
# name of the page displayed into the drop down menu in
# case of multiple pages.
-#
+#
# Status page is split in strips displaying information. Each status
# strip is identified by a unique . Each status strip is
# defined by a name, an icon and a serie of lines described as follow:
-#
+#
# web.status..content..name=
# web.status..content..icon=
# web.status..content..line.=
-#
+#
# web.status..content..name=
# Name displayed as title of the strip
-#
+#
# web.status..content..icon=
# Icon of the strip
-#
+#
# web.status..content..line.=
# represent the position of the line within the strip.
# This number has to be unique within the strip.
@@ -253,73 +141,73 @@ dynamic.15.rrd=GAUGE
# functions that could be used inside the parameter. The object data
# is also available and contains the result of dynamic and static
# extracted as described in the KPI extraction section.
-#
+#
# Functions provided by RPi-Monitor are the following:
-#
+#
# Uptime(uptime in sec)
# Print the uptime from seconds to the following format:
# XX year XX days XX hours XX minutes XX seconds
-#
+#
# Pad(value)
# Add a prefixed 0 for number smaller than 10
-#
+#
# KMG(value, pre)
# Print value in kilo, Mega, Giga, Peta.
# pre can be 'k', 'M', 'G' or 'P' depending on the value.
-#
+#
# Percent(value,total)
# Print percentage of value compared to total
-#
+#
# ProgressBar(value,total)
# Draw a progressbar representing the value compared to total.
# [=========------------]
-#
+#
# Plural (value)
# Print 's ' if value > 1 or ' ' if not.
-#
+#
# Clock(data.localtime)
# This function is a little bit particular and should be written
# and should be written exactly as in the upper line. It will
# display on screen the current time and will simulate the
# seconds by incrementing them periodically.
-#
+#
# Label(data,formula, text, LEVEL)
-# This function will write a label with a defined background color
-# if the formula return TRUE.
+# Badge(data,formula, text, LEVEL)
+# This function will write a label/badge with a defined
+# background color if the formula return TRUE.
# data : data to use with the formula
# formula : formula evaluated in regards to data to determine
-# if label has to be printed
+# if label/badge has to be printed
# text : text to be displayed
-# LEVEL : 'label-default' or 'label-success' or 'label-warning'
-# or 'label-important' or 'label-info' or or 'label-inverse'
-#
-#
+# LEVEL : 'default' or 'success' or 'warning' or 'important'
+# or 'info' or or 'inverse'
+#
# The statistic page is fully configurable.
# It is possible to define multiple pages. Each page is identified by
# its .
-#
+#
# web.status..name=
# name of the page displayed into the drop down menu in
# case of multiple pages.
-#
+#
# The statistic page displays statistics graphs. The graphs are
# identified an unique and by the following parameters.
-#
+#
# web.statistics..content..name=
# is the name of the statistics displayed in the
# top left drop down list.
-#
+#
# web.statistics..content..graph.=
# is identifying the graph and is unique per
# is the name of the dynamic and static extracted as
# described in the KPI extraction section.
-#
+#
# web.statistics..content..ds_graph_options..label=
# same as the previous
# Label to display in legends. It is possible to setup other parameters
# of ds_graph_options. Refer to the following web page for details:
# http://javascriptrrd.sourceforge.net/docs/javascriptrrd_v0.5.0/doc/lib/rrdFlot_js.html
-#
+#
# web.statistics..content..graph_options.=
# and can be find into the same web page as previous
# parameter. This allow to customize the graph and axis.
@@ -330,126 +218,27 @@ dynamic.15.rrd=GAUGE
#web.friends.1.link=http://192.168.0.123/
#web.friends.2.name=Shuttle
#web.friends.2.link=http://192.168.0.2/
-#web.friends.3.name=Laptop
+#web.friends.3.name=Netbook
#web.friends.3.link=http://192.168.0.38/
-#######################################################################
-
web.page.icon='img/logo.png'
web.page.menutitle='RPi-Monitor ('+data.hostname+') '
web.page.pagetitle='RPi-Monitor ('+data.hostname+')'
-#######################################################################
web.status.1.name=Raspberry Pi
-web.status.1.content.1.name=Version
-web.status.1.content.1.icon=version.png
-web.status.1.content.1.line.1='Processor: ' + data.processor + ' '
-web.status.1.content.1.line.2='Distribution: '+ data.distribution + ' '
-web.status.1.content.1.line.3='Kernel version: ' + data.kernel_version + ' '
-web.status.1.content.1.line.4='Firmware: ' + data.firmware + ' '
-web.status.1.content.1.line.5='Package(s) to be: ' + data.upgrade + ' ' + ShowInfo('packages','Package update',data.packages)
-
-web.status.1.content.2.name=Uptime
-web.status.1.content.2.icon=uptime.png
-web.status.1.content.2.line.1='Raspberry Pi time: ' + Clock( data.localtime) + " "
-web.status.1.content.2.line.2="Uptime: " + Uptime(data.uptime)
-
-web.status.1.content.3.name=CPU
-web.status.1.content.3.icon=cpu.png
-web.status.1.content.3.line.1="Loads: " + data.load1 + " [1min] - " + data.load5 + " [5min] - " + data.load15 + " [15min]"
-web.status.1.content.3.line.2="CPU frequency: " + data.cpu_frequency + "MHz Voltage: " + data.cpu_voltage + "V "
-web.status.1.content.3.line.3="Scaling governor: " + data.scaling_governor + " "
-
-web.status.1.content.4.name=Temperature
-web.status.1.content.4.icon=cpu_temp.png
-web.status.1.content.4.line.1="CPU Temperature: "+data.soc_temp+"°C "
-
-web.status.1.content.5.name=Memory
-web.status.1.content.5.icon=memory.png
-web.status.1.content.5.line.1="Used: " + KMG(data.memory_total-data.memory_available,'M') + " (" + Percent(data.memory_total-data.memory_available,data.memory_total,'M') + " ) Available: " + KMG(data.memory_available,'M') + " Total: " + KMG(data.memory_total,'M') + " "
-web.status.1.content.5.line.2=ProgressBar(data.memory_total-data.memory_available,data.memory_total)
-
-web.status.1.content.6.name=Swap
-web.status.1.content.6.icon=swap.png
-web.status.1.content.6.line.1="Used: "+KMG(data.swap_used,'M')+" ("+Percent(data.swap_used,data.swap_total,'M')+" ) Free: "+KMG(data.swap_total-data.swap_used,'M')+ " Total: "+ KMG(data.swap_total,'M') + " "
-web.status.1.content.6.line.2=ProgressBar(data.swap_used,data.swap_total)
-
-web.status.1.content.7.name=SD card
-web.status.1.content.7.icon=sd.png
-web.status.1.content.7.line.1="/boot Used: "+KMG(data.sdcard_boot_used,'M')+" ("+Percent(data.sdcard_boot_used,data.sdcard_boot_total,'M')+" ) Free: "+KMG(data.sdcard_boot_total-data.sdcard_boot_used,'M')+ " Total: "+ KMG(data.sdcard_boot_total,'M') +" "
-web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
-web.status.1.content.7.line.3="/ Used: "+KMG(data.sdcard_root_used,'M') + " (" + Percent(data.sdcard_root_used,data.sdcard_root_total,'M')+" ) Free: "+KMG(data.sdcard_root_total-data.sdcard_root_used,'M')+ " Total: "+ KMG(data.sdcard_root_total,'M') + " "
-web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
-
-web.status.1.content.8.name=Network
-web.status.1.content.8.icon=network.png
-web.status.1.content.8.line.1="Ethernet Sent: "+KMG(data.net_send)+" Received: "+KMG(Math.abs(data.net_received)) + " "
-
-#######################################################################
web.statistics.1.name=Raspberry Pi
-web.statistics.1.content.1.name=CPU Loads
-web.statistics.1.content.1.graph.1=load1
-web.statistics.1.content.1.graph.2=load5
-web.statistics.1.content.1.graph.3=load15
-web.statistics.1.content.1.ds_graph_options.load1.label=Load 1min
-web.statistics.1.content.1.ds_graph_options.load5.label=Load 5min
-web.statistics.1.content.1.ds_graph_options.load15.label=Load 15min
-
-web.statistics.1.content.2.name=Network
-web.statistics.1.content.2.graph.1=net_send
-web.statistics.1.content.2.graph.2=net_received
-web.statistics.1.content.2.graph_options.yaxis={ tickFormatter: function (v) { if (Math.abs(v) > 1048576) return (Math.round(v*10/1024/1024)/10) + " MiB/s" ; if (Math.abs(v) > 1024) return (Math.round(v*10/1024)/10) + " KiB/s" ; else return v + " B/s" }, }
-web.statistics.1.content.2.ds_graph_options.net_send.label=Upload bandwidth (bytes)
-web.statistics.1.content.2.ds_graph_options.net_send.lines={ fill: true }
-web.statistics.1.content.2.ds_graph_options.net_send.color="#FF7777"
-web.statistics.1.content.2.ds_graph_options.net_received.label=Download bandwidth (bytes)
-web.statistics.1.content.2.ds_graph_options.net_received.lines={ fill: true }
-web.statistics.1.content.2.ds_graph_options.net_received.color="#77FF77"
-
-web.statistics.1.content.3.name=Disks - boot
-web.statistics.1.content.3.graph.1=sdcard_boot_total
-web.statistics.1.content.3.graph.2=sdcard_boot_used
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.label=Size of /boot (MB)
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.color="#FF7777"
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.label=Used on /boot (MB)
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.lines={ fill: true }
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.color="#7777FF"
-
-web.statistics.1.content.4.name=Disks - root
-web.statistics.1.content.4.graph.1=sdcard_root_total
-web.statistics.1.content.4.graph.2=sdcard_root_used
-web.statistics.1.content.4.ds_graph_options.sdcard_root_total.label=Size of / (MB)
-web.statistics.1.content.4.ds_graph_options.sdcard_root_total.color="#FF7777"
-web.statistics.1.content.4.ds_graph_options.sdcard_root_used.label=Used on / (MB)
-web.statistics.1.content.4.ds_graph_options.sdcard_root_used.lines={ fill: true }
-web.statistics.1.content.4.ds_graph_options.sdcard_root_used.color="#7777FF"
-
-web.statistics.1.content.5.name=Swap
-web.statistics.1.content.5.graph.1=swap_total
-web.statistics.1.content.5.graph.2=swap_used
-web.statistics.1.content.5.ds_graph_options.swap_total.label=Swap size (MB)
-web.statistics.1.content.5.ds_graph_options.swap_total.color="#FF7777"
-web.statistics.1.content.5.ds_graph_options.swap_used.label=Swap used (MB)
-web.statistics.1.content.5.ds_graph_options.swap_used.lines={ fill: true }
-web.statistics.1.content.5.ds_graph_options.swap_used.color="#7777FF"
-
-web.statistics.1.content.6.name=Memory
-web.statistics.1.content.6.graph.1=memory_total
-web.statistics.1.content.6.graph.2=memory_free
-web.statistics.1.content.6.graph.3=memory_available
-web.statistics.1.content.6.ds_graph_options.memory_total.label=Total Memory(MB)
-web.statistics.1.content.6.ds_graph_options.memory_free.label=Free Memory (MB)
-web.statistics.1.content.6.ds_graph_options.memory_free.color="#7777FF"
-web.statistics.1.content.6.ds_graph_options.memory_available.label=Available Memory (MB)
-web.statistics.1.content.6.ds_graph_options.memory_available.color="#77FF77"
-
-web.statistics.1.content.7.name=Uptime
-web.statistics.1.content.7.graph.1=uptime
-web.statistics.1.content.7.graph_options.yaxis={ min:0, tickFormatter: function (v) { if (v > 86400) return (Math.round(v*10/60/60/24)/10) + " d" ; if (v > 3600) return (Math.round(v*10/60/60)/10) + " h" ; else return v + " s" }, }
-web.statistics.1.content.7.ds_graph_options.uptime.label=Uptime (s/h/d)
-
-web.statistics.1.content.8.name=Temperature
-web.statistics.1.content.8.graph.1=soc_temp
-web.statistics.1.content.8.ds_graph_options.soc_temp.label=Core temperature (deg C)
-include=/etc/rpimonitor/template/services.conf
+include=/etc/rpimonitor/template/version.conf
+include=/etc/rpimonitor/template/uptime.conf
+include=/etc/rpimonitor/template/cpu.conf
+include=/etc/rpimonitor/template/temperature.conf
+include=/etc/rpimonitor/template/memory.conf
+include=/etc/rpimonitor/template/swap.conf
+include=/etc/rpimonitor/template/sdcard.conf
+include=/etc/rpimonitor/template/network.conf
+
+# Examples
+include=/etc/rpimonitor/template/printer.conf
+#include=/etc/rpimonitor/template/storage.conf
+#include=/etc/rpimonitor/template/services.conf
+#include=/etc/rpimonitor/template/wlan.conf
diff --git a/rpimonitor/template/raspbmc.conf b/rpimonitor/template/raspbmc.conf
index 0124f7b..b1d059d 100644
--- a/rpimonitor/template/raspbmc.conf
+++ b/rpimonitor/template/raspbmc.conf
@@ -1,411 +1,24 @@
-########################################################################
-# KPI extraction configuration
-#
-# This part of the configuration file is defining which data to
-# extract how to extract then and when.
-#
-# Static KPI are extracted once at rpimonitord startup. Each statistic
-# is identified into the conf file by a line stating with the keyword
-# static and an identifier
-#
-# Each static KPI is defined by an id and with 4 parameters
-#
-# static..name=
-# is a string representing the KPI or the list of KPI
-# separated by comma. Each name has to be unique.
-# Only alpha numerical charter and underscore are accepted.
-#
-# static..source=
-# is a file or an executable file within the path.
-# If the file exists, rpimonitord will read its content. If the file
-# is not existing, rpimonirotd will try to execute it and will parse
-# the output.
-# Warning: specifying an executable by its absolute name will tell
-# rpimonitord to read the content of the executable.1.graph.
-#
-# static..regexp=
-# is the regular expression extracting information from
-# data source. Regexp groups () has to be used to extract the data
-# In case of KPI list, each group will be affected to a KPI name.
-#
-# static..postprocess=
-# is an expression defining the postprocessing to
-# be applied on result. KPI are idendified by $1. In case of list,
-# other KPI are identified by $2, $3 .graph..
-# This parameter will be evaluate by the command eval of perl.
-#
-# Dynamic KPI are extracted periodically (defined by daemon.delay)
-# Each statistic is identified into the conf file by a line stating
-# with the keyword dynamic and an identifier
-#
-# Each dynamic KPI is defined by an id and with 5 parameters
-#
-# dynamic..name=
-# dynamic..source=
-# dynamic..regexp=
-# dynamic..postprocess=
-# , , ,
-# This 4 first parameters have the same signification as for static
-# parameters.
-#
-# dynamic..rrd=<|GAUGE|COUNTER|DERIVE|ABSOLUTE|COMPUTE>
-# The 5th parameter is defining if the KPI has to be stored into a RRD
-# database and how <|GAUGE|COUNTER|DERIVE|ABSOLUTE|COMPUTE>. If the
-# parameter is defined as empty, no RRD database will be created. If
-# this parameter is defined, a RRD database will be created and data
-# will be stored at every extraction.
-# Ref http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html for RRD
-# parameter description.
-# dynamic..min=
-# dynamic..max=
-# If a value extracted by is less than minimal of greater than maximal
-# value, it will be stored int RRD database as unknown.
-# These limits are usefull to handle counter that fall down to 0 when
-# they reach their limit (Ex: network graphs)
-#
-# Note: Static values are accessible for the post processing using the
-# variable $this->{'static'}->{'static_data_name'} and can be used.
-#
-########################################################################
-static.1.name=distribution
-static.1.source=/etc/os-release
-static.1.regexp=PRETTY_NAME.\"(.*)\"
-static.1.postprocess=
-
-static.2.name=kernel_version
-static.2.source=uname -msr
-static.2.regexp=(.*)
-static.2.postprocess=
-
-static.3.name=firmware
-static.3.source=/proc/version
-static.3.regexp=(#\d+)
-static.3.postprocess=
-
-static.4.name=processor
-static.4.source=/proc/cpuinfo
-static.4.regexp=(?:Processor|model name)\s+: (.*)
-static.4.postprocess=
-
-static.5.name=memory_total
-static.5.source=/proc/meminfo
-static.5.regexp=MemTotal:\s+(\d+)
-static.5.postprocess=$1/1024
-
-static.6.name=sdcard_root_total
-static.6.source=df -t ext4
-static.6.regexp=mmcblk0p.\s+(\d+).*\/$
-static.6.postprocess=$1/1024
-
-static.7.name=sdcard_boot_total
-static.7.source=df -t vfat
-static.7.regexp=mmcblk0p.\s+(\d+).*\/boot$
-static.7.postprocess=$1/1024
-
-##############################################################################
-dynamic.1.name=upgrade
-dynamic.1.source=/var/lib/rpimonitor/updatestatus.txt
-dynamic.1.regexp=(\d+ upgraded, \d+ .*|.* .*)
-dynamic.1.postprocess=
-dynamic.1.rrd=
-
-dynamic.2.name=packages
-dynamic.2.source=/var/lib/rpimonitor/updatestatus.txt
-dynamic.2.regexp=^ (.*)\d+ upgraded,
-dynamic.2.postprocess=
-dynamic.2.rrd=
-
-dynamic.3.name=cpu_frequency
-dynamic.3.source=/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
-dynamic.3.regexp=(.*)
-dynamic.3.postprocess=$1/1000
-dynamic.3.rrd=
-
-dynamic.4.name=cpu_voltage
-dynamic.4.source=vcgencmd measure_volts core
-dynamic.4.regexp=(\d+.\d+)V
-dynamic.4.postprocess=
-dynamic.4.rrd=
-
-dynamic.5.name=load1,load5,load15
-dynamic.5.source=/proc/loadavg
-dynamic.5.regexp=^(\S+)\s(\S+)\s(\S+)
-dynamic.5.postprocess=
-dynamic.5.rrd=GAUGE
-
-dynamic.6.name=sdcard_root_used
-dynamic.6.source=df -t ext4
-dynamic.6.regexp=mmcblk0p.\s+\d+\s+(\d+).*\/$
-dynamic.6.postprocess=$1/1024
-dynamic.6.rrd=GAUGE
-
-dynamic.7.name=sdcard_boot_used
-dynamic.7.source=df -t vfat
-dynamic.7.regexp=mmcblk0p.\s+\d+\s+(\d+).*\/boot$
-dynamic.7.postprocess=$1/1024
-dynamic.7.rrd=GAUGE
-
-dynamic.8.name=memory_free
-dynamic.8.source=/proc/meminfo
-dynamic.8.regexp=MemFree:\s+(\d+)
-dynamic.8.postprocess=$1/1024
-dynamic.8.rrd=GAUGE
-
-dynamic.9.name=net_received
-dynamic.9.source=/sys/class/net/eth0/statistics/rx_bytes
-dynamic.9.regexp=(.*)
-dynamic.9.postprocess=$1*-1
-dynamic.9.rrd=DERIVE
-dynamic.9.max=0
-
-dynamic.10.name=net_send
-dynamic.10.source=/sys/class/net/eth0/statistics/tx_bytes
-dynamic.10.regexp=(.*)
-dynamic.10.postprocess=
-dynamic.10.rrd=DERIVE
-dynamic.10.min=0
-
-dynamic.11.name=soc_temp
-dynamic.11.source=/sys/devices/virtual/thermal/thermal_zone0/temp
-dynamic.11.regexp=(.*)
-dynamic.11.postprocess=$1/1000
-dynamic.11.rrd=GAUGE
-
-dynamic.12.name=uptime
-dynamic.12.source=/proc/uptime
-dynamic.12.regexp=(^\S+)
-dynamic.12.postprocess=
-dynamic.12.rrd=GAUGE
-
-dynamic.13.name=scaling_governor
-dynamic.13.source=/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
-dynamic.13.regexp=(.*)
-dynamic.13.postprocess=
-dynamic.13.rrd=
-
-dynamic.14.name=memory_available
-dynamic.14.source=/usr/bin/free -mk
-dynamic.14.regexp=^-\/\+ buffers\/cache:\s+\d+\s+(\d+)
-dynamic.14.postprocess=$1/1024
-dynamic.14.rrd=GAUGE
-
-
-########################################################################
-# Web interface configuration
-#
-# Friends are defining a displayed name and a link reachable from a
-# top left menu visible if at least one friends is configured. Each
-# friend is identified by its and is described by the 2 following
-# parameters
-#
-# web.friends..name=
-# web.friends..link=
-#
-# web.friends..name=
-# is the name printed into the drop down menu
-#
-# web.friends..link=
-# is the link to another RPi-Monitor running
-# into the friend machine.
-#
-#
-# The status page is fully configurable.
-# It is possible to define multiple pages. Each page is identified by
-# its .
-#
-# web.status..name=
-# name of the page displayed into the drop down menu in
-# case of multiple pages.
-#
-# Status page is split in strips displaying information. Each status
-# strip is identified by a unique . Each status strip is
-# defined by a name, an icon and a serie of lines described as follow:
-#
-# web.status..content..name=
-# web.status..content..icon=
-# web.status..content..line.=
-#
-# web.status..content..name=
-# Name displayed as title of the strip
-#
-# web.status..content..icon=
-# Icon of the strip
-#
-# web.status..content..line.=
-# represent the position of the line within the strip.
-# This number has to be unique within the strip.
-# is describing the content of the line. This parameter
-# will be evaluated by the javascript command with the function
-# eval() theirfore parameter should be valid javacript.
-# To have clean rendering, RPi-Monitor web interface provides some
-# functions that could be used inside the parameter. The object data
-# is also available and contains the result of dynamic and static
-# extracted as described in the KPI extraction section.
-#
-# Functions provided by RPi-Monitor are the following:
-#
-# Uptime(uptime in sec)
-# Print the uptime from seconds to the following format:
-# XX year XX days XX hours XX minutes XX seconds
-#
-# Pad(value)
-# Add a prefixed 0 for number smaller than 10
-#
-# KMG(value, pre)
-# Print value in kilo, Mega, Giga, Peta.
-# pre can be 'k', 'M', 'G' or 'P' depending on the value.
-#
-# Percent(value,total)
-# Print percentage of value compared to total
-#
-# ProgressBar(value,total)
-# Draw a progressbar representing the value compared to total.
-# [=========------------]
-#
-# Plural (value)
-# Print 's ' if value > 1 or ' ' if not.
-#
-# Clock(data.localtime)
-# This function is a little bit particular and should be written
-# and should be written exactly as in the upper line. It will
-# display on screen the current time and will simulate the
-# seconds by incrementing them tperiodically.
-#
-#
-# The statistic page is fully configurable.
-# It is possible to define multiple pages. Each page is identified by
-# its .
-#
-# web.status..name=
-# name of the page displayed into the drop down menu in
-# case of multiple pages.
-#
-# The statistic page displays statistics graphs. The graphs are
-# identified an unique and by the following parameters.
-#
-# web.statistics..content..name=
-# is the name of the statistics displayed in the
-# top left drop down list.
-#
-# web.statistics..content..graph.=
-# is identifying the graph and is unique per
-# is the name of the dynamic and static extracted as
-# described in the KPI extraction section.
-#
-# web.statistics..content..ds_graph_options..label=
-# same as the previous
-# Label to display in legends. It is possible to setup other parameters
-# of ds_graph_options. Refer to the following web page for details:
-# http://javascriptrrd.sourceforge.net/docs/javascriptrrd_v0.5.0/doc/lib/rrdFlot_js.html
-#
-# web.statistics..content..graph_options.=
-# and can be find into the same web page as previous
-# parameter. This allow to customize the graph and axis.
-#
#######################################################################
-
-#web.friends.1.name=Raspberry Pi
-#web.friends.1.link=http://192.168.0.123/
-#web.friends.2.name=Shuttle
-#web.friends.2.link=http://192.168.0.2/
-#web.friends.3.name=Laptop
-#web.friends.3.link=http://192.168.0.38/
-
+# Configuration file for raspbmc
+# ref. raspbian.conf or execute 'man rpimonitor.conf' for help
#######################################################################
-web.status.1.name=Raspberry Pi
-web.status.1.content.1.name=Version
-web.status.1.content.1.icon=version.png
-web.status.1.content.1.line.1='Processor: ' + data.processor + ' '
-web.status.1.content.1.line.2='Distribution: '+ data.distribution + ' '
-web.status.1.content.1.line.3='Kernel version: ' + data.kernel_version + ' '
-web.status.1.content.1.line.4='Firmware: ' + data.firmware + ' '
-web.status.1.content.1.line.5='Package(s) to be: ' + data.upgrade + ' ' + ShowInfo('packages','Package update',data.packages)
-
-web.status.1.content.2.name=Uptime
-web.status.1.content.2.icon=uptime.png
-web.status.1.content.2.line.1='Raspberry Pi time: ' + Clock( data.localtime) + " "
-web.status.1.content.2.line.2="Uptime: " + Uptime(data.uptime)
-
-web.status.1.content.3.name=CPU
-web.status.1.content.3.icon=cpu.png
-web.status.1.content.3.line.1="Loads: " + data.load1 + " [1min] - " + data.load5 + " [5min] - " + data.load15 + " [15min]"
-web.status.1.content.3.line.2="CPU frequency: " + data.cpu_frequency + "MHz Voltage: " + data.cpu_voltage + "V "
-web.status.1.content.3.line.3="Scaling governor: " + data.scaling_governor + " "
-
-web.status.1.content.4.name=Temperature
-web.status.1.content.4.icon=cpu_temp.png
-web.status.1.content.4.line.1="CPU Temperature: "+data.soc_temp+"°C "
-
-web.status.1.content.5.name=Memory
-web.status.1.content.5.icon=memory.png
-web.status.1.content.5.line.1="Used: " + KMG(data.memory_total-data.memory_available,'M') + " (" + Percent(data.memory_total-data.memory_available,data.memory_total,'M') + " ) Available: " + KMG(data.memory_available,'M') + " Total: " + KMG(data.memory_total,'M') + " "
-web.status.1.content.5.line.2=ProgressBar(data.memory_total-data.memory_available,data.memory_total)
-
-web.status.1.content.6.name=SD card
-web.status.1.content.6.icon=sd.png
-web.status.1.content.6.line.1="/boot Used: "+KMG(data.sdcard_boot_used,'M')+" ("+Percent(data.sdcard_boot_used,data.sdcard_boot_total,'M')+" ) Free: "+KMG(data.sdcard_boot_total-data.sdcard_boot_used,'M')+ " Total: "+ KMG(data.sdcard_boot_total,'M') +" "
-web.status.1.content.6.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
-web.status.1.content.6.line.3="/ Used: "+KMG(data.sdcard_root_used,'M') + " (" + Percent(data.sdcard_root_used,data.sdcard_root_total,'M')+" ) Free: "+KMG(data.sdcard_root_total-data.sdcard_root_used,'M')+ " Total: "+ KMG(data.sdcard_root_total,'M') + " "
-web.status.1.content.6.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
+web.page.icon='img/logo.png'
+web.page.menutitle='RPi-Monitor ('+data.hostname+') '
+web.page.pagetitle='RPi-Monitor ('+data.hostname+')'
-web.status.1.content.7.name=Network
-web.status.1.content.7.icon=network.png
-web.status.1.content.7.line.1="Ethernet Sent: "+KMG(data.net_send)+" Received: "+KMG(Math.abs(data.net_received)) + " "
-
-#######################################################################
+web.status.1.name=Raspberry Pi
web.statistics.1.name=Raspberry Pi
-web.statistics.1.content.1.name=CPU Loads
-web.statistics.1.content.1.graph.1=load1
-web.statistics.1.content.1.graph.2=load5
-web.statistics.1.content.1.graph.3=load15
-web.statistics.1.content.1.ds_graph_options.load1.label=Load 1min
-web.statistics.1.content.1.ds_graph_options.load5.label=Load 5min
-web.statistics.1.content.1.ds_graph_options.load15.label=Load 15min
-
-web.statistics.1.content.2.name=Network
-web.statistics.1.content.2.graph.1=net_send
-web.statistics.1.content.2.graph.2=net_received
-web.statistics.1.content.2.graph_options.yaxis={ tickFormatter: function (v) { if (Math.abs(v) > 1048576) return (Math.round(v*10/1024/1024)/10) + " MiB/s" ; if (Math.abs(v) > 1024) return (Math.round(v*10/1024)/10) + " KiB/s" ; else return v + " B/s" }, }
-web.statistics.1.content.2.ds_graph_options.net_send.label=Upload bandwidth (bytes)
-web.statistics.1.content.2.ds_graph_options.net_send.lines={ fill: true }
-web.statistics.1.content.2.ds_graph_options.net_send.color="#FF7777"
-web.statistics.1.content.2.ds_graph_options.net_received.label=Download bandwidth (bytes)
-web.statistics.1.content.2.ds_graph_options.net_received.lines={ fill: true }
-web.statistics.1.content.2.ds_graph_options.net_received.color="#77FF77"
-
-web.statistics.1.content.3.name=Disks - boot
-web.statistics.1.content.3.graph.1=sdcard_boot_total
-web.statistics.1.content.3.graph.2=sdcard_boot_used
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.label=Size of /boot (MB)
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.color="#FF7777"
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.label=Used on /boot (MB)
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.lines={ fill: true }
-web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.color="#7777FF"
-
-web.statistics.1.content.4.name=Disks - root
-web.statistics.1.content.4.graph.1=sdcard_root_total
-web.statistics.1.content.4.graph.2=sdcard_root_used
-web.statistics.1.content.4.ds_graph_options.sdcard_root_total.label=Size of / (MB)
-web.statistics.1.content.4.ds_graph_options.sdcard_root_total.color="#FF7777"
-web.statistics.1.content.4.ds_graph_options.sdcard_root_used.label=Used on / (MB)
-web.statistics.1.content.4.ds_graph_options.sdcard_root_used.lines={ fill: true }
-web.statistics.1.content.4.ds_graph_options.sdcard_root_used.color="#7777FF"
-
-web.statistics.1.content.7.graph.1=memory_total
-web.statistics.1.content.7.graph.2=memory_free
-web.statistics.1.content.7.graph.3=memory_available
-web.statistics.1.content.7.ds_graph_options.memory_total.label=Total Memory(MB)
-web.statistics.1.content.7.ds_graph_options.memory_free.label=Free Memory (MB)
-web.statistics.1.content.7.ds_graph_options.memory_free.color="#7777FF"
-web.statistics.1.content.7.ds_graph_options.memory_available.label=Available Memory (MB)
-web.statistics.1.content.7.ds_graph_options.memory_available.color="#77FF77"
-
-web.statistics.1.content.8.name=Uptime
-web.statistics.1.content.8.graph.1=uptime
-web.statistics.1.content.8.graph_options.yaxis={ min:0, tickFormatter: function (v) { if (v > 86400) return (Math.round(v*10/60/60/24)/10) + " d" ; if (v > 3600) return (Math.round(v*10/60/60)/10) + " h" ; else return v + " s" }, }
-web.statistics.1.content.8.ds_graph_options.uptime.label=Uptime (s/h/d)
-
-web.statistics.1.content.9.name=Temperature
-web.statistics.1.content.9.graph.1=soc_temp
-web.statistics.1.content.9.ds_graph_options.soc_temp.label=Core temperature (deg C)
+include=/etc/rpimonitor/template/version.conf
+include=/etc/rpimonitor/template/uptime.conf
+include=/etc/rpimonitor/template/cpu.conf
+include=/etc/rpimonitor/template/temperature.conf
+include=/etc/rpimonitor/template/memory.conf
+include=/etc/rpimonitor/template/sdcard_raspbmc.conf
+include=/etc/rpimonitor/template/network.conf
+
+# Examples
+#include=/etc/rpimonitor/template/printer.conf
+#include=/etc/rpimonitor/template/storage.conf
+#include=/etc/rpimonitor/template/services.conf
+#include=/etc/rpimonitor/template/wlan.conf
diff --git a/rpimonitor/template/sdcard.conf b/rpimonitor/template/sdcard.conf
new file mode 100644
index 0000000..08b5f48
--- /dev/null
+++ b/rpimonitor/template/sdcard.conf
@@ -0,0 +1,55 @@
+########################################################################
+# Extract SDCard information
+# Page: 1
+# Information Status Statistics
+# - root total - yes - yes
+# - root used - yes - yes
+# - boot total - yes - yes
+# - boot used - yes - yes
+########################################################################
+static.7.name=sdcard_root_total
+static.7.source=df /
+static.7.regexp=\S+\s+(\d+).*\/$
+static.7.postprocess=$1/1024
+
+static.8.name=sdcard_boot_total
+static.8.source=df /boot
+static.8.regexp=\S+\s+(\d+).*\/boot$
+static.8.postprocess=$1/1024
+
+dynamic.6.name=sdcard_root_used
+dynamic.6.source=df /
+dynamic.6.regexp=\S+\s+\d+\s+(\d+).*\/$
+dynamic.6.postprocess=$1/1024
+dynamic.6.rrd=GAUGE
+
+dynamic.7.name=sdcard_boot_used
+dynamic.7.source=df /boot
+dynamic.7.regexp=\S+\s+\d+\s+(\d+).*\/boot$
+dynamic.7.postprocess=$1/1024
+dynamic.7.rrd=GAUGE
+
+web.status.1.content.7.name=SD card
+web.status.1.content.7.icon=sd.png
+web.status.1.content.7.line.1="/boot Used: "+KMG(data.sdcard_boot_used,'M')+" ("+Percent(data.sdcard_boot_used,data.sdcard_boot_total,'M')+" ) Free: "+KMG(data.sdcard_boot_total-data.sdcard_boot_used,'M')+ " Total: "+ KMG(data.sdcard_boot_total,'M') +" "
+web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
+web.status.1.content.7.line.3="/ Used: "+KMG(data.sdcard_root_used,'M') + " (" + Percent(data.sdcard_root_used,data.sdcard_root_total,'M')+" ) Free: "+KMG(data.sdcard_root_total-data.sdcard_root_used,'M')+ " Total: "+ KMG(data.sdcard_root_total,'M') + " "
+web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
+
+web.statistics.1.content.3.name=Disks - boot
+web.statistics.1.content.3.graph.1=sdcard_boot_total
+web.statistics.1.content.3.graph.2=sdcard_boot_used
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.label=Size of /boot (MB)
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.color="#FF7777"
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.label=Used on /boot (MB)
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.lines={ fill: true }
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.color="#7777FF"
+
+web.statistics.1.content.4.name=Disks - root
+web.statistics.1.content.4.graph.1=sdcard_root_total
+web.statistics.1.content.4.graph.2=sdcard_root_used
+web.statistics.1.content.4.ds_graph_options.sdcard_root_total.label=Size of / (MB)
+web.statistics.1.content.4.ds_graph_options.sdcard_root_total.color="#FF7777"
+web.statistics.1.content.4.ds_graph_options.sdcard_root_used.label=Used on / (MB)
+web.statistics.1.content.4.ds_graph_options.sdcard_root_used.lines={ fill: true }
+web.statistics.1.content.4.ds_graph_options.sdcard_root_used.color="#7777FF"
diff --git a/rpimonitor/template/sdcard_raspbmc.conf b/rpimonitor/template/sdcard_raspbmc.conf
new file mode 100644
index 0000000..6973d9c
--- /dev/null
+++ b/rpimonitor/template/sdcard_raspbmc.conf
@@ -0,0 +1,56 @@
+########################################################################
+# Extract SDCard information for Raspbmc
+# Page: 1
+# Information Status Statistics
+# - root total - yes - yes
+# - root used - yes - yes
+# - boot total - yes - yes
+# - boot used - yes - yes
+########################################################################
+static.6.name=sdcard_root_total
+static.6.source=df -t ext4
+static.6.regexp=mmcblk0p.\s+(\d+).*\/$
+static.6.postprocess=$1/1024
+
+static.7.name=sdcard_boot_total
+static.7.source=df -t vfat
+static.7.regexp=mmcblk0p.\s+(\d+).*\/boot$
+static.7.postprocess=$1/1024
+
+dynamic.6.name=sdcard_root_used
+dynamic.6.source=df -t ext4
+dynamic.6.regexp=mmcblk0p.\s+\d+\s+(\d+).*\/$
+dynamic.6.postprocess=$1/1024
+dynamic.6.rrd=GAUGE
+
+dynamic.7.name=sdcard_boot_used
+dynamic.7.source=df -t vfat
+dynamic.7.regexp=mmcblk0p.\s+\d+\s+(\d+).*\/boot$
+dynamic.7.postprocess=$1/1024
+dynamic.7.rrd=GAUGE
+
+
+web.status.1.content.7.name=SD card
+web.status.1.content.7.icon=sd.png
+web.status.1.content.7.line.1="/boot Used: "+KMG(data.sdcard_boot_used,'M')+" ("+Percent(data.sdcard_boot_used,data.sdcard_boot_total,'M')+" ) Free: "+KMG(data.sdcard_boot_total-data.sdcard_boot_used,'M')+ " Total: "+ KMG(data.sdcard_boot_total,'M') +" "
+web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
+web.status.1.content.7.line.3="/ Used: "+KMG(data.sdcard_root_used,'M') + " (" + Percent(data.sdcard_root_used,data.sdcard_root_total,'M')+" ) Free: "+KMG(data.sdcard_root_total-data.sdcard_root_used,'M')+ " Total: "+ KMG(data.sdcard_root_total,'M') + " "
+web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
+
+web.statistics.1.content.3.name=Disks - boot
+web.statistics.1.content.3.graph.1=sdcard_boot_total
+web.statistics.1.content.3.graph.2=sdcard_boot_used
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.label=Size of /boot (MB)
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.color="#FF7777"
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.label=Used on /boot (MB)
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.lines={ fill: true }
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.color="#7777FF"
+
+web.statistics.1.content.4.name=Disks - root
+web.statistics.1.content.4.graph.1=sdcard_root_total
+web.statistics.1.content.4.graph.2=sdcard_root_used
+web.statistics.1.content.4.ds_graph_options.sdcard_root_total.label=Size of / (MB)
+web.statistics.1.content.4.ds_graph_options.sdcard_root_total.color="#FF7777"
+web.statistics.1.content.4.ds_graph_options.sdcard_root_used.label=Used on / (MB)
+web.statistics.1.content.4.ds_graph_options.sdcard_root_used.lines={ fill: true }
+web.statistics.1.content.4.ds_graph_options.sdcard_root_used.color="#7777FF"
diff --git a/rpimonitor/template/sdcard_xbian.conf b/rpimonitor/template/sdcard_xbian.conf
new file mode 100644
index 0000000..244a809
--- /dev/null
+++ b/rpimonitor/template/sdcard_xbian.conf
@@ -0,0 +1,55 @@
+########################################################################
+# Extract SDCard information for Xbian
+# Page: 1
+# Information Status Statistics
+# - root total - yes - yes
+# - root used - yes - yes
+# - boot total - yes - yes
+# - boot used - yes - yes
+########################################################################
+static.7.name=sdcard_root_total
+static.7.source=df -t btrfs
+static.7.regexp=mmcblk0p.\s+(\d+).*\/$
+static.7.postprocess=$1/1024
+
+static.8.name=sdcard_boot_total
+static.8.source=df -t vfat
+static.8.regexp=mmcblk0p.\s+(\d+).*\/boot$
+static.8.postprocess=$1/1024
+
+dynamic.6.name=sdcard_root_used
+dynamic.6.source=df -t btrfs
+dynamic.6.regexp=mmcblk0p.\s+\d+\s+(\d+).*\/$
+dynamic.6.postprocess=$1/1024
+dynamic.6.rrd=GAUGE
+
+dynamic.7.name=sdcard_boot_used
+dynamic.7.source=df -t vfat
+dynamic.7.regexp=mmcblk0p.\s+\d+\s+(\d+).*\/boot$
+dynamic.7.postprocess=$1/1024
+dynamic.7.rrd=GAUGE
+
+web.status.1.content.7.name=SD card
+web.status.1.content.7.icon=sd.png
+web.status.1.content.7.line.1="/boot Used: "+KMG(data.sdcard_boot_used,'M')+" ("+Percent(data.sdcard_boot_used,data.sdcard_boot_total,'M')+" ) Free: "+KMG(data.sdcard_boot_total-data.sdcard_boot_used,'M')+ " Total: "+ KMG(data.sdcard_boot_total,'M') +" "
+web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
+web.status.1.content.7.line.3="/ Used: "+KMG(data.sdcard_root_used,'M') + " (" + Percent(data.sdcard_root_used,data.sdcard_root_total,'M')+" ) Free: "+KMG(data.sdcard_root_total-data.sdcard_root_used,'M')+ " Total: "+ KMG(data.sdcard_root_total,'M') + " "
+web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
+
+web.statistics.1.content.3.name=Disks - boot
+web.statistics.1.content.3.graph.1=sdcard_boot_total
+web.statistics.1.content.3.graph.2=sdcard_boot_used
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.label=Size of /boot (MB)
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.color="#FF7777"
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.label=Used on /boot (MB)
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.lines={ fill: true }
+web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.color="#7777FF"
+
+web.statistics.1.content.4.name=Disks - root
+web.statistics.1.content.4.graph.1=sdcard_root_total
+web.statistics.1.content.4.graph.2=sdcard_root_used
+web.statistics.1.content.4.ds_graph_options.sdcard_root_total.label=Size of / (MB)
+web.statistics.1.content.4.ds_graph_options.sdcard_root_total.color="#FF7777"
+web.statistics.1.content.4.ds_graph_options.sdcard_root_used.label=Used on / (MB)
+web.statistics.1.content.4.ds_graph_options.sdcard_root_used.lines={ fill: true }
+web.statistics.1.content.4.ds_graph_options.sdcard_root_used.color="#7777FF"
diff --git a/rpimonitor/template/services.conf b/rpimonitor/template/services.conf
index a8e11ef..cd427b7 100644
--- a/rpimonitor/template/services.conf
+++ b/rpimonitor/template/services.conf
@@ -1,6 +1,14 @@
########################################################################
-# External daemons information added into Raspberry Pi page
-# http://www.iconseeker.com/search-icon/crystal-project-application/daemons.html
+# Extract information about Opened Port
+# Page: 1
+# Information Status Statistics
+# - ssh port (22) - yes - no
+# - rpimonotor port (8888) - yes - no
+# - http port (80) - yes - yes
+# - https port (443) - yes - yes
+#
+# Note:
+# Icon from http://www.iconseeker.com/search-icon/crystal-project-application/daemons.html
########################################################################
dynamic.1.name=ssh
dynamic.1.source=netstat -nlt
diff --git a/rpimonitor/template/storage.conf b/rpimonitor/template/storage.conf
index b421bd6..dd1068c 100644
--- a/rpimonitor/template/storage.conf
+++ b/rpimonitor/template/storage.conf
@@ -1,5 +1,11 @@
########################################################################
-# External HDD information added into Raspberry Pi page
+# Extract Storage (1-sda1, 2-sda3) information
+# Page: 1
+# Information Status Statistics
+# - storage1 total - yes - yes
+# - storage1 used - yes - yes
+# - storage2 total - yes - yes
+# - storage2 used - yes - yes
########################################################################
static.10.name=storage1_total
static.10.source=df -t ext2
diff --git a/rpimonitor/template/swap.conf b/rpimonitor/template/swap.conf
new file mode 100644
index 0000000..3df0599
--- /dev/null
+++ b/rpimonitor/template/swap.conf
@@ -0,0 +1,31 @@
+########################################################################
+# Extract Swap information
+# Page: 1
+# Information Status Statistics
+# - swap total - yes - yes
+# - swap used - yes - yes
+########################################################################
+static.6.name=swap_total
+static.6.source=/proc/meminfo
+static.6.regexp=SwapTotal:\s+(\d+)
+static.6.postprocess=$1/1024
+
+dynamic.8.name=swap_used
+dynamic.8.source=/proc/meminfo
+dynamic.8.regexp=SwapFree:\s+(\d+)
+dynamic.8.postprocess=$this->{'static'}->{'swap_total'} - ($1/1024)
+dynamic.8.rrd=GAUGE
+
+web.status.1.content.6.name=Swap
+web.status.1.content.6.icon=swap.png
+web.status.1.content.6.line.1="Used: "+KMG(data.swap_used,'M')+" ("+Percent(data.swap_used,data.swap_total,'M')+" ) Free: "+KMG(data.swap_total-data.swap_used,'M')+ " Total: "+ KMG(data.swap_total,'M') + " "
+web.status.1.content.6.line.2=ProgressBar(data.swap_used,data.swap_total)
+
+web.statistics.1.content.5.name=Swap
+web.statistics.1.content.5.graph.1=swap_total
+web.statistics.1.content.5.graph.2=swap_used
+web.statistics.1.content.5.ds_graph_options.swap_total.label=Swap size (MB)
+web.statistics.1.content.5.ds_graph_options.swap_total.color="#FF7777"
+web.statistics.1.content.5.ds_graph_options.swap_used.label=Swap used (MB)
+web.statistics.1.content.5.ds_graph_options.swap_used.lines={ fill: true }
+web.statistics.1.content.5.ds_graph_options.swap_used.color="#7777FF"
diff --git a/rpimonitor/template/temperature.conf b/rpimonitor/template/temperature.conf
new file mode 100644
index 0000000..fbf663f
--- /dev/null
+++ b/rpimonitor/template/temperature.conf
@@ -0,0 +1,19 @@
+########################################################################
+# Extract CPU Temperature information
+# Page: 1
+# Information Status Statistics
+# - cpu temperature - yes - yes
+########################################################################
+dynamic.12.name=soc_temp
+dynamic.12.source=/sys/devices/virtual/thermal/thermal_zone0/temp
+dynamic.12.regexp=(.*)
+dynamic.12.postprocess=$1/1000
+dynamic.12.rrd=GAUGE
+
+web.status.1.content.4.name=Temperature
+web.status.1.content.4.icon=cpu_temp.png
+web.status.1.content.4.line.1="CPU Temperature: "+data.soc_temp+"°C "
+
+web.statistics.1.content.8.name=Temperature
+web.statistics.1.content.8.graph.1=soc_temp
+web.statistics.1.content.8.ds_graph_options.soc_temp.label=Core temperature (deg C)
diff --git a/rpimonitor/template/temperature_xbian.conf b/rpimonitor/template/temperature_xbian.conf
new file mode 100644
index 0000000..ffd1a02
--- /dev/null
+++ b/rpimonitor/template/temperature_xbian.conf
@@ -0,0 +1,19 @@
+########################################################################
+# Extract CPU Temperature information for Xbian
+# Page: 1
+# Information Status Statistics
+# - cpu temperature - yes - yes
+########################################################################
+dynamic.12.name=soc_temp
+dynamic.12.source=/sys/devices/virtual/thermal/thermal_zone0/temp
+dynamic.12.regexp=(.*)
+dynamic.12.postprocess=$1/1000
+dynamic.12.rrd=GAUGE
+
+web.status.1.content.4.name=Temperature
+web.status.1.content.4.icon=cpu_temp.png
+web.status.1.content.4.line.1="CPU Temperature: "+data.soc_temp+"°C "
+
+web.statistics.1.content.8.name=Temperature
+web.statistics.1.content.8.graph.1=soc_temp
+web.statistics.1.content.8.ds_graph_options.soc_temp.label=Core temperature (deg C)
diff --git a/rpimonitor/template/uptime.conf b/rpimonitor/template/uptime.conf
new file mode 100644
index 0000000..66b1b0e
--- /dev/null
+++ b/rpimonitor/template/uptime.conf
@@ -0,0 +1,21 @@
+########################################################################
+# Extract Uptime information
+# Page: 1
+# Information Status Statistics
+# - uptime - yes - yes
+########################################################################
+dynamic.1.name=uptime
+dynamic.1.source=/proc/uptime
+dynamic.1.regexp=(^\S+)
+dynamic.1.postprocess=
+dynamic.1.rrd=GAUGE
+
+web.status.1.content.2.name=Uptime
+web.status.1.content.2.icon=uptime.png
+web.status.1.content.2.line.1='Raspberry Pi time: ' + Clock( data.localtime) + " "
+web.status.1.content.2.line.2="Uptime: " + Uptime(data.uptime)
+
+web.statistics.1.content.7.name=Uptime
+web.statistics.1.content.7.graph.1=uptime
+web.statistics.1.content.7.graph_options.yaxis={ min:0, tickFormatter: function (v) { if (v > 86400) return (Math.round(v*10/60/60/24)/10) + " d" ; if (v > 3600) return (Math.round(v*10/60/60)/10) + " h" ; else return v + " s" }, }
+web.statistics.1.content.7.ds_graph_options.uptime.label=Uptime (s/h/d)
diff --git a/rpimonitor/template/version.conf b/rpimonitor/template/version.conf
new file mode 100644
index 0000000..97bbf0e
--- /dev/null
+++ b/rpimonitor/template/version.conf
@@ -0,0 +1,50 @@
+########################################################################
+# Extract System information
+# Page: 1
+# Information Status Statistics
+# - distribution name - yes - no
+# - kernel version - yes - no
+# - firmware version - yes - no
+# - processor model - yes - no
+# - num of pkg upgradable - yes - no
+# - list of pkg upgradable - yes - no
+########################################################################
+static.1.name=distribution
+static.1.source=/etc/os-release
+static.1.regexp=PRETTY_NAME.\"(.*)\"
+static.1.postprocess=
+
+static.2.name=kernel_version
+static.2.source=uname -msr
+static.2.regexp=(.*)
+static.2.postprocess=
+
+static.3.name=firmware
+static.3.source=/proc/version
+static.3.regexp=(#\d+)
+static.3.postprocess=
+
+static.4.name=processor
+static.4.source=/proc/cpuinfo
+static.4.regexp=(?:Processor|model name)\s+: (.*)
+static.4.postprocess=
+
+dynamic.1.name=upgrade
+dynamic.1.source=/var/lib/rpimonitor/updatestatus.txt
+dynamic.1.regexp=(\d+ upgraded, \d+ .*|.* .*)
+dynamic.1.postprocess=
+dynamic.1.rrd=
+
+dynamic.2.name=packages
+dynamic.2.source=/var/lib/rpimonitor/updatestatus.txt
+dynamic.2.regexp=^ (.*)\d+ upgraded,
+dynamic.2.postprocess=
+dynamic.2.rrd=
+
+web.status.1.content.1.name=Version
+web.status.1.content.1.icon=version.png
+web.status.1.content.1.line.1='Processor: ' + data.processor + ' '
+web.status.1.content.1.line.2='Distribution: '+ data.distribution + ' '
+web.status.1.content.1.line.3='Kernel version: ' + data.kernel_version + ' '
+web.status.1.content.1.line.4='Firmware: ' + data.firmware + ' '
+web.status.1.content.1.line.5='Package(s) to be: ' + data.upgrade + ' ' + ShowInfo('packages','Package update',data.packages)
diff --git a/rpimonitor/template/wlan.conf b/rpimonitor/template/wlan.conf
new file mode 100644
index 0000000..2ad279c
--- /dev/null
+++ b/rpimonitor/template/wlan.conf
@@ -0,0 +1,35 @@
+########################################################################
+# Extract WiFi information
+# Page: 1
+# Information Status Statistics
+# - recieved - yes - yes
+# - sent - yes - yes
+########################################################################
+dynamic.18.name=wifi_received
+dynamic.18.source=/sys/class/net/wlan0/statistics/rx_bytes
+dynamic.18.regexp=(.*)
+dynamic.18.postprocess=$1*-1
+dynamic.18.rrd=DERIVE
+dynamic.18.max=0
+
+dynamic.19.name=wifi_send
+dynamic.19.source=/sys/class/net/wlan0/statistics/tx_bytes
+dynamic.19.regexp=(.*)
+dynamic.19.postprocess=
+dynamic.19.rrd=DERIVE
+dynamic.19.min=0
+
+web.status.1.content.9.name=WiFi
+web.status.1.content.9.icon=wifi.png
+web.status.1.content.9.line.1="WiFi Sent: "+KMG(data.wifi_send)+" Received: "+KMG(Math.abs(data.wifi_received)) + " "
+
+web.statistics.1.content.9.name=WiFi
+web.statistics.1.content.9.graph.1=wifi_send
+web.statistics.1.content.9.graph.2=wifi_received
+web.statistics.1.content.9.graph_options.yaxis={ tickFormatter: function (v) { if (Math.abs(v) > 1048576) return (Math.round(v*10/1024/1024)/10) + " MiB/s" ; if (Math.abs(v) > 1024) return (Math.round(v*10/1024)/10) + " KiB/s" ; else return v + " B/s" }, }
+web.statistics.1.content.9.ds_graph_options.wifi_send.label=Upload bandwidth (bits)
+web.statistics.1.content.9.ds_graph_options.wifi_send.lines={ fill: true }
+web.statistics.1.content.9.ds_graph_options.wifi_send.color="#FF7777"
+web.statistics.1.content.9.ds_graph_options.wifi_received.label=Download bandwidth (bits)
+web.statistics.1.content.9.ds_graph_options.wifi_received.lines={ fill: true }
+web.statistics.1.content.9.ds_graph_options.wifi_received.color="#77FF77"
diff --git a/rpimonitor/template/xbian.conf b/rpimonitor/template/xbian.conf
index 0a59b36..93beb0d 100644
--- a/rpimonitor/template/xbian.conf
+++ b/rpimonitor/template/xbian.conf
@@ -1,438 +1,25 @@
-########################################################################
-# KPI extraction configuration
-#
-# This part of the configuration file is defining which data to
-# extract how to extract then and when.
-#
-# Static KPI are extracted once at rpimonitord startup. Each statistic
-# is identified into the conf file by a line stating with the keyword
-# static and an identifier
-#
-# Each static KPI is defined by an id and with 4 parameters
-#
-# static..name=
-# is a string representing the KPI or the list of KPI
-# separated by comma. Each name has to be unique.
-# Only alpha numerical charter and underscore are accepted.
-#
-# static..source=
-# is a file or an executable file within the path.
-# If the file exists, rpimonitord will read its content. If the file
-# is not existing, rpimonirotd will try to execute it and will parse
-# the output.
-# Warning: specifying an executable by its absolute name will tell
-# rpimonitord to read the content of the executable.1.graph.
-#
-# static..regexp=
-# is the regular expression extracting information from
-# data source. Regexp groups () has to be used to extract the data
-# In case of KPI list, each group will be affected to a KPI name.
-#
-# static..postprocess=
-# is an expression defining the postprocessing to
-# be applied on result. KPI are idendified by $1. In case of list,
-# other KPI are identified by $2, $3 .graph..
-# This parameter will be evaluate by the command eval of perl.
-#
-# Dynamic KPI are extracted periodically (defined by daemon.delay)
-# Each statistic is identified into the conf file by a line stating
-# with the keyword dynamic and an identifier
-#
-# Each dynamic KPI is defined by an id and with 5 parameters
-#
-# dynamic..name=
-# dynamic..source=
-# dynamic..regexp=
-# dynamic..postprocess=
-# , , ,
-# This 4 first parameters have the same signification as for static
-# parameters.
-#
-# dynamic..rrd=<|GAUGE|COUNTER|DERIVE|ABSOLUTE|COMPUTE>
-# The 5th parameter is defining if the KPI has to be stored into a RRD
-# database and how <|GAUGE|COUNTER|DERIVE|ABSOLUTE|COMPUTE>. If the
-# parameter is defined as empty, no RRD database will be created. If
-# this parameter is defined, a RRD database will be created and data
-# will be stored at every extraction.
-# Ref http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html for RRD
-# parameter description.
-# dynamic..min=
-# dynamic..max=
-# If a value extracted by is less than minimal of greater than maximal
-# value, it will be stored int RRD database as unknown.
-# These limits are usefull to handle counter that fall down to 0 when
-# they reach their limit (Ex: network graphs)
-#
-# Note: Static values are accessible for the post processing using the
-# variable $this->{'static'}->{'static_data_name'} and can be used.
-# You can refer to swap data extraction to see an example.
-#
-########################################################################
-static.1.name=distribution
-static.1.source=/etc/os-release
-static.1.regexp=PRETTY_NAME.\"(.*)\"
-static.1.postprocess=
-
-static.2.name=kernel_version
-static.2.source=uname -msr
-static.2.regexp=(.*)
-static.2.postprocess=
-
-static.3.name=firmware
-static.3.source=/proc/version
-static.3.regexp=(#\d+)
-static.3.postprocess=
-
-static.4.name=processor
-static.4.source=/proc/cpuinfo
-static.4.regexp=(?:Processor|model name)\s+: (.*)
-static.4.postprocess=
-
-static.5.name=memory_total
-static.5.source=/proc/meminfo
-static.5.regexp=MemTotal:\s+(\d+)
-static.5.postprocess=$1/1024
-
-static.6.name=swap_total
-static.6.source=/proc/meminfo
-static.6.regexp=SwapTotal:\s+(\d+)
-static.6.postprocess=$1/1024
-
-static.7.name=sdcard_root_total
-static.7.source=df -t btrfs
-static.7.regexp=mmcblk0p.\s+(\d+).*\/$
-static.7.postprocess=$1/1024
-
-static.8.name=sdcard_boot_total
-static.8.source=df -t vfat
-static.8.regexp=mmcblk0p.\s+(\d+).*\/boot$
-static.8.postprocess=$1/1024
-
-##############################################################################
-dynamic.1.name=upgrade
-dynamic.1.source=/var/lib/rpimonitor/updatestatus.txt
-dynamic.1.regexp=(\d+ upgraded, \d+ .*|.* .*)
-dynamic.1.postprocess=
-dynamic.1.rrd=
-
-dynamic.2.name=packages
-dynamic.2.source=/var/lib/rpimonitor/updatestatus.txt
-dynamic.2.regexp=^ (.*)\d+ upgraded,
-dynamic.2.postprocess=
-dynamic.2.rrd=
-
-dynamic.3.name=cpu_frequency
-dynamic.3.source=/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
-dynamic.3.regexp=(.*)
-dynamic.3.postprocess=$1/1000
-dynamic.3.rrd=
-
-dynamic.4.name=cpu_voltage
-dynamic.4.source=vcgencmd measure_volts core
-dynamic.4.regexp=(\d+.\d+)V
-dynamic.4.postprocess=
-dynamic.4.rrd=
-
-dynamic.5.name=load1,load5,load15
-dynamic.5.source=/proc/loadavg
-dynamic.5.regexp=^(\S+)\s(\S+)\s(\S+)
-dynamic.5.postprocess=
-dynamic.5.rrd=GAUGE
-
-dynamic.6.name=sdcard_root_used
-dynamic.6.source=df -t btrfs
-dynamic.6.regexp=mmcblk0p.\s+\d+\s+(\d+).*\/$
-dynamic.6.postprocess=$1/1024
-dynamic.6.rrd=GAUGE
-
-dynamic.7.name=sdcard_boot_used
-dynamic.7.source=df -t vfat
-dynamic.7.regexp=mmcblk0p.\s+\d+\s+(\d+).*\/boot$
-dynamic.7.postprocess=$1/1024
-dynamic.7.rrd=GAUGE
-
-dynamic.8.name=swap_used
-dynamic.8.source=/proc/meminfo
-dynamic.8.regexp=SwapFree:\s+(\d+)
-dynamic.8.postprocess=$this->{'static'}->{'swap_total'} - ($1/1024)
-dynamic.8.rrd=GAUGE
-
-dynamic.9.name=memory_free
-dynamic.9.source=/proc/meminfo
-dynamic.9.regexp=MemFree:\s+(\d+)
-dynamic.9.postprocess=$1/1024
-dynamic.9.rrd=GAUGE
-
-dynamic.10.name=net_received
-dynamic.10.source=/sys/class/net/eth0/statistics/rx_bytes
-dynamic.10.regexp=(.*)
-dynamic.10.postprocess=$1*-1
-dynamic.10.rrd=DERIVE
-dynamic.10.max=0
-
-dynamic.11.name=net_send
-dynamic.11.source=/sys/class/net/eth0/statistics/tx_bytes
-dynamic.11.regexp=(.*)
-dynamic.11.postprocess=
-dynamic.11.rrd=DERIVE
-dynamic.11.min=0
-
-dynamic.12.name=soc_temp
-dynamic.12.source=/opt/vc/bin/vcgencmd measure_temp
-dynamic.12.regexp=(\d+.\d+)
-dynamic.12.postprocess=
-dynamic.12.rrd=GAUGE
-
-dynamic.13.name=uptime
-dynamic.13.source=/proc/uptime
-dynamic.13.regexp=(^\S+)
-dynamic.13.postprocess=
-dynamic.13.rrd=GAUGE
-
-dynamic.14.name=scaling_governor
-dynamic.14.source=/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
-dynamic.14.regexp=(.*)
-dynamic.14.postprocess=
-dynamic.14.rrd=
-
-dynamic.15.name=memory_available
-dynamic.15.source=/usr/bin/free -mk
-dynamic.15.regexp=^-\/\+ buffers\/cache:\s+\d+\s+(\d+)
-dynamic.15.postprocess=$1/1024
-dynamic.15.rrd=GAUGE
-
-
-########################################################################
-# Web interface configuration
-#
-# Friends are defining a displayed name and a link reachable from a
-# top left menu visible if at least one friends is configured. Each
-# friend is identified by its and is described by the 2 following
-# parameters
-#
-# web.friends..name=
-# web.friends..link=
-#
-# web.friends..name=
-# is the name printed into the drop down menu
-#
-# web.friends..link=