Skip to content

Commit ec83554

Browse files
committed
Merge pull request #61 from XavierBerger/devel
Version 2.9
2 parents a037249 + 8027dec commit ec83554

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+9915
-335
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.8
1+
2.9

rpimonitor/rpimonitord

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/perl
22
#
3-
# Copyright 2013 - Xavier Berger - http://rpi-experiences.blogspot.fr/
3+
# Copyright 2013-2014 - Xavier Berger - http://rpi-experiences.blogspot.fr/
44
#
55
# This program is free software: you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License as published by
@@ -292,7 +292,11 @@ sub new
292292

293293
"/css/rpimonitor.css",
294294
"/css/bootstrap.min.css",
295-
"/css/bootstrap-responsive.min.css",
295+
296+
"/fonts/glyphicons-halflings-regular.eot",
297+
"/fonts/glyphicons-halflings-regular.ttf",
298+
"/fonts/glyphicons-halflings-regular.svg",
299+
"/fonts/glyphicons-halflings-regular.woff",
296300

297301
"/stat/empty.rrd",
298302

@@ -304,6 +308,8 @@ sub new
304308
"/js/rpimonitor.index.js",
305309
"/js/rpimonitor.js",
306310
"/js/jsqrencode.min.js",
311+
"/js/raphael.2.1.0.min.js",
312+
"/js/justgage.1.0.1.min.js",
307313
"/js/jquery.min.js",
308314
"/js/bootstrap.min.js",
309315
"/js/flot/jquery.flot.min.js",

rpimonitor/template/cpu.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ dynamic.4.rrd=
3333

3434
web.status.1.content.1.name=CPU
3535
web.status.1.content.1.icon=cpu.png
36-
web.status.1.content.1.line.1="Loads: <b>" + data.load1 + "</b> [1min] - <b>" + data.load5 + "</b> [5min] - <b>" + data.load15 + "</b> [15min]"
36+
#web.status.1.content.1.line.1="Loads: <b>" + data.load1 + "</b> [1min] - <b>" + data.load5 + "</b> [5min] - <b>" + data.load15 + "</b> [15min]"
37+
web.status.1.content.1.line.1=JustGageBar("Load", "1min", 0, data.load1, 3, 100, 80)+" "+JustGageBar("Load", "5min", 0, data.load5, 3, 100, 80)+" "+JustGageBar("Load", "15min", 0, data.load15, 3, 100, 80)
3738
web.status.1.content.1.line.2="CPU frequency: <b>" + data.cpu_frequency + "MHz</b> Voltage: <b>" + data.cpu_voltage + "V</b>"
3839
web.status.1.content.1.line.3="Scaling governor: <b>" + data.scaling_governor + "</b>"
3940

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
########################################################################
2+
# Example how to use Labels and Badges in status page
3+
# Page: 1
4+
# Information Status Statistics
5+
# - example static data - yes -no
6+
#
7+
# Note:
8+
# Icon from http://goo.gl/TTYP62
9+
########################################################################
10+
web.status.1.content.1.name=Labels/Badges
11+
web.status.1.content.1.icon=daemons.png
12+
web.status.1.content.1.line.1="Labels: "+Label(1,"==1","default","default")+" "+Label(1,"==1","primary","primary")+" "+Label(1,"==1","success","success")+" "+Label(1,"==1","info","info")+" "+Label(1,"==1","warning","warning")+" "+Label(1,"==1","danger","danger")
13+
web.status.1.content.1.line.2="Badges: "+Badge(1,"==1","default","default")+" "+Badge(1,"==1","primary","primary")+" "+Badge(1,"==1","success","success")+" "+Badge(1,"==1","info","info")+" "+Badge(1,"==1","warning","warning")+" "+Badge(1,"==1","danger","danger")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
########################################################################
2+
# Example how to use JustGageBar in status page
3+
# Page: 1
4+
# Information Status Statistics
5+
# - example static data - yes -no
6+
########################################################################
7+
web.status.1.content.1.name=JustGageBar
8+
web.status.1.content.1.icon=version.png
9+
web.status.1.content.1.line.1='<b>JustGageBar default configuration</b>'
10+
web.status.1.content.1.line.2=JustGageBar("Normal", "No Colors",0, 25, 100)+" "+JustGageBar("Warning", "No Colors",0, 50, 100)+" "+JustGageBar("Critical", "No Colors",0, 75, 100)
11+
web.status.1.content.1.line.3='<b>JustGageBar custom colors</b>'
12+
web.status.1.content.1.line.4=JustGageBar("Normal", "Colors",0, 25, 100,100,80,[ "#0ba9d7", "#02f9c8", "#00ff00" ])+" "+JustGageBar("Warning", "Colors",0, 50, 100,100,80,[ "#0ba9d7", "#02f9c8", "#00ff00" ])+" "+JustGageBar("Critical", "Colors",0, 75, 100,100,80,[ "#0ba9d7", "#02f9c8", "#00ff00" ])
13+
web.status.1.content.1.line.5='<b>JustGageBar custom level for warning and critical level</b>'
14+
web.status.1.content.1.line.6=JustGageBar("Normal", "WarnCrit",0, 5, 100,100,80,percentColors,10,50)+" "+JustGageBar("Warning", "WarnCrit",0, 15, 100,100,80,percentColors,10,50)+" "+JustGageBar("Critical", "WarnCrit",0, 51, 100,100,80,percentColors,10,50)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
########################################################################
2+
# Example how to use progressbar in status page
3+
# Page: 1
4+
# Information Status Statistics
5+
# - example static data - yes -no
6+
########################################################################
7+
web.status.1.content.1.name=ProgressBar
8+
web.status.1.content.1.icon=version.png
9+
web.status.1.content.1.line.1='<b>ProgressBar without warning or critical</b>'
10+
web.status.1.content.1.line.2=ProgressBar(33, 100)
11+
web.status.1.content.1.line.3='<b>ProgressBar with warning lower than critical (Example: disk usage)</b>'
12+
web.status.1.content.1.line.4=ProgressBar(10, 100, 33, 66)
13+
web.status.1.content.1.line.5=ProgressBar(50, 100, 33, 66)
14+
web.status.1.content.1.line.6=ProgressBar(75, 100, 33, 66)
15+
web.status.1.content.1.line.7='<b>ProgressBar with warning higher than critical (Example: ink cartridge)</b>'
16+
web.status.1.content.1.line.8=ProgressBar(75, 100, 66, 33)
17+
web.status.1.content.1.line.9=ProgressBar(50, 100, 66, 33)
18+
web.status.1.content.1.line.10=ProgressBar(10, 100, 66, 33)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
########################################################################
2+
# Example how to manage visibility of status information
3+
# Page: 1
4+
# Information Status Statistics
5+
# - visibility - yes - no
6+
# This proof of concept is behaving has follow:
7+
# If minute number is odd the row is visible
8+
# If minute number is even the row is hidden
9+
# The parameter visibility should be a valid javascript formula returning
10+
# - 0 to hide the row
11+
# - anything else but 0 to show the row
12+
########################################################################
13+
dynamic.1.name=visibility
14+
dynamic.1.source=date +"%M"
15+
dynamic.1.regexp=(.*)
16+
dynamic.1.postprocess=$1%2
17+
dynamic.1.rrd=
18+
19+
web.status.1.content.1.name=Visibility
20+
web.status.1.content.1.icon=version.png
21+
web.status.1.content.1.visibility=data.visibility
22+
web.status.1.content.1.line.1='Visibility: <b>Control row visibility</b>'

rpimonitor/template/raspbian.conf

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@
121121
# strip is identified by a unique <status id>. Each status strip is
122122
# defined by a name, an icon and a serie of lines described as follow:
123123
#
124+
# web.status.<page id>.visibility=<visibility formula>
125+
#
126+
# <visibility forlula> should be a valid javascript formula returning
127+
# 0: to hide the row
128+
# anything else but 0: show the row
129+
#
124130
# web.status.<page id>.content.<status id>.name=<display name>
125131
# web.status.<page id>.content.<status id>.icon=<display icon>
126132
# web.status.<page id>.content.<status id>.line.<line number>=<parameter>
@@ -158,10 +164,31 @@
158164
# Percent(value,total)
159165
# Print percentage of value compared to total
160166
#
161-
# ProgressBar(value,total)
167+
# ProgressBar(value,total,warning, danger)
162168
# Draw a progressbar representing the value compared to total.
163169
# [=========------------]
164-
#
170+
# The default color of pregressbar is blue.
171+
# If warning value is lower than critical, progressbar color will
172+
# be orange if percentage is higher than warning value and red
173+
# if the percentage is higher than danger value
174+
# If warning value is higher than critical, progressbar color will
175+
# be orange if percentage is lower than warning value and red
176+
# if the percentage is lower than danger value
177+
#
178+
# JustGageBar(title, label,min, value, max, width, height, levelColors, warning, critical)
179+
# Draw a half-circular gauge
180+
# title : Title of the gauge (located on to of the gauge)
181+
# label : Label of the gauge (located under the value)
182+
# min : min value of the gauge
183+
# value : value to be drawn
184+
# max : max value of the gauge
185+
# width, height : size of the gauge
186+
# levelColors : Array defining colors of each level [normal,warning,critical]
187+
# (in Hex format), default: green, orange and red.
188+
# Default colors are available into the array 'percentColors'.
189+
# warning : Warning level (in %) used to define color (default: 33)
190+
# critical : Critical level (in %) used to define color (default: 66)
191+
#
165192
# Plural (value)
166193
# Print 's ' if value > 1 or ' ' if not.
167194
#
@@ -171,16 +198,17 @@
171198
# display on screen the current time and will simulate the
172199
# seconds by incrementing them periodically.
173200
#
174-
# Label(data,formula, text, LEVEL)
175-
# Badge(data,formula, text, LEVEL)
201+
# Label(data,formula, text, level)
202+
# Badge(data,formula, text, level)
176203
# This function will write a label/badge with a defined
177204
# background color if the formula return TRUE.
178205
# data : data to use with the formula
179206
# formula : formula evaluated in regards to data to determine
180207
# if label/badge has to be printed
181208
# text : text to be displayed
182-
# LEVEL : 'default' or 'success' or 'warning' or 'important'
183-
# or 'info' or or 'inverse'
209+
# level : 'default' (grey), 'primary' (blue label/grey badge),
210+
# 'success' (green), 'info' (cyan), 'warning' (orange)
211+
# or 'danger' (red)
184212
#
185213
# The statistic page is fully configurable.
186214
# It is possible to define multiple pages. Each page is identified by
@@ -212,6 +240,12 @@
212240
# <parameter> and <value> can be find into the same web page as previous
213241
# parameter. This allow to customize the graph and axis.
214242
#
243+
# Example file are available in the template directory (prefixed by 'example').
244+
# To understand how a feature is behaving, you can include this example file
245+
# using the 'include' directive.
246+
# These include directive are already written (commented) into the default
247+
# configuration file: raspbian.conf
248+
# When configuration files change, it is required to restart rpimonitor.
215249
#######################################################################
216250

217251
#web.friends.1.name=Raspberry Pi
@@ -228,6 +262,11 @@ web.page.pagetitle='RPi-Monitor ('+data.hostname+')'
228262
web.status.1.name=Raspberry Pi
229263
web.statistics.1.name=Raspberry Pi
230264

265+
#include=/etc/rpimonitor/template/example.justgage.conf
266+
#include=/etc/rpimonitor/template/example.badge_and_label.conf
267+
#include=/etc/rpimonitor/template/example.progressbar.conf
268+
#include=/etc/rpimonitor/template/example.visibility.conf
269+
231270
include=/etc/rpimonitor/template/version.conf
232271
include=/etc/rpimonitor/template/uptime.conf
233272
include=/etc/rpimonitor/template/cpu.conf
@@ -241,3 +280,6 @@ include=/etc/rpimonitor/template/network.conf
241280
#include=/etc/rpimonitor/template/storage.conf
242281
#include=/etc/rpimonitor/template/services.conf
243282
#include=/etc/rpimonitor/template/wlan.conf
283+
#include=/etc/rpimonitor/template/dht11.conf
284+
285+

rpimonitor/template/sdcard.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ dynamic.7.rrd=GAUGE
3232
web.status.1.content.7.name=SD card
3333
web.status.1.content.7.icon=sd.png
3434
web.status.1.content.7.line.1="<b>/boot</b> Used: <b>"+KMG(data.sdcard_boot_used,'M')+"</b> (<b>"+Percent(data.sdcard_boot_used,data.sdcard_boot_total,'M')+"</b>) Free: <b>"+KMG(data.sdcard_boot_total-data.sdcard_boot_used,'M')+ "</b> Total: <b>"+ KMG(data.sdcard_boot_total,'M') +"</b>"
35-
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
35+
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total,60,80)
3636
web.status.1.content.7.line.3="<b>/</b> Used: <b>"+KMG(data.sdcard_root_used,'M') + "</b> (<b>" + Percent(data.sdcard_root_used,data.sdcard_root_total,'M')+"</b>) Free: <b>"+KMG(data.sdcard_root_total-data.sdcard_root_used,'M')+ "</b> Total: <b>"+ KMG(data.sdcard_root_total,'M') + "</b>"
37-
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
37+
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total,60,80)
3838

3939
web.statistics.1.content.3.name=Disks - boot
4040
web.statistics.1.content.3.graph.1=sdcard_boot_total

rpimonitor/template/sdcard_raspbmc.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ dynamic.7.rrd=GAUGE
3333
web.status.1.content.7.name=SD card
3434
web.status.1.content.7.icon=sd.png
3535
web.status.1.content.7.line.1="<b>/boot</b> Used: <b>"+KMG(data.sdcard_boot_used,'M')+"</b> (<b>"+Percent(data.sdcard_boot_used,data.sdcard_boot_total,'M')+"</b>) Free: <b>"+KMG(data.sdcard_boot_total-data.sdcard_boot_used,'M')+ "</b> Total: <b>"+ KMG(data.sdcard_boot_total,'M') +"</b>"
36-
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
36+
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total,60,80)
3737
web.status.1.content.7.line.3="<b>/</b> Used: <b>"+KMG(data.sdcard_root_used,'M') + "</b> (<b>" + Percent(data.sdcard_root_used,data.sdcard_root_total,'M')+"</b>) Free: <b>"+KMG(data.sdcard_root_total-data.sdcard_root_used,'M')+ "</b> Total: <b>"+ KMG(data.sdcard_root_total,'M') + "</b>"
38-
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
38+
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total,60,80)
3939

4040
web.statistics.1.content.3.name=Disks - boot
4141
web.statistics.1.content.3.graph.1=sdcard_boot_total

0 commit comments

Comments
 (0)