Skip to content

Commit

Permalink
Merge pull request #61 from XavierBerger/devel
Browse files Browse the repository at this point in the history
Version 2.9
  • Loading branch information
XavierBerger committed Oct 12, 2014
2 parents a037249 + 8027dec commit ec83554
Show file tree
Hide file tree
Showing 53 changed files with 9,915 additions and 335 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8
2.9
10 changes: 8 additions & 2 deletions rpimonitor/rpimonitord
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# Copyright 2013 - Xavier Berger - http://rpi-experiences.blogspot.fr/
# Copyright 2013-2014 - Xavier Berger - http://rpi-experiences.blogspot.fr/
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -292,7 +292,11 @@ sub new

"/css/rpimonitor.css",
"/css/bootstrap.min.css",
"/css/bootstrap-responsive.min.css",

"/fonts/glyphicons-halflings-regular.eot",
"/fonts/glyphicons-halflings-regular.ttf",
"/fonts/glyphicons-halflings-regular.svg",
"/fonts/glyphicons-halflings-regular.woff",

"/stat/empty.rrd",

Expand All @@ -304,6 +308,8 @@ sub new
"/js/rpimonitor.index.js",
"/js/rpimonitor.js",
"/js/jsqrencode.min.js",
"/js/raphael.2.1.0.min.js",
"/js/justgage.1.0.1.min.js",
"/js/jquery.min.js",
"/js/bootstrap.min.js",
"/js/flot/jquery.flot.min.js",
Expand Down
3 changes: 2 additions & 1 deletion rpimonitor/template/cpu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ 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: <b>" + data.load1 + "</b> [1min] - <b>" + data.load5 + "</b> [5min] - <b>" + data.load15 + "</b> [15min]"
#web.status.1.content.1.line.1="Loads: <b>" + data.load1 + "</b> [1min] - <b>" + data.load5 + "</b> [5min] - <b>" + data.load15 + "</b> [15min]"
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)
web.status.1.content.1.line.2="CPU frequency: <b>" + data.cpu_frequency + "MHz</b> Voltage: <b>" + data.cpu_voltage + "V</b>"
web.status.1.content.1.line.3="Scaling governor: <b>" + data.scaling_governor + "</b>"

Expand Down
13 changes: 13 additions & 0 deletions rpimonitor/template/example.badge_and_label.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
########################################################################
# Example how to use Labels and Badges in status page
# Page: 1
# Information Status Statistics
# - example static data - yes -no
#
# Note:
# Icon from http://goo.gl/TTYP62
########################################################################
web.status.1.content.1.name=Labels/Badges
web.status.1.content.1.icon=daemons.png
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")
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")
14 changes: 14 additions & 0 deletions rpimonitor/template/example.justgage.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
########################################################################
# Example how to use JustGageBar in status page
# Page: 1
# Information Status Statistics
# - example static data - yes -no
########################################################################
web.status.1.content.1.name=JustGageBar
web.status.1.content.1.icon=version.png
web.status.1.content.1.line.1='<b>JustGageBar default configuration</b>'
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)
web.status.1.content.1.line.3='<b>JustGageBar custom colors</b>'
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" ])
web.status.1.content.1.line.5='<b>JustGageBar custom level for warning and critical level</b>'
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)
18 changes: 18 additions & 0 deletions rpimonitor/template/example.progressbar.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
########################################################################
# Example how to use progressbar in status page
# Page: 1
# Information Status Statistics
# - example static data - yes -no
########################################################################
web.status.1.content.1.name=ProgressBar
web.status.1.content.1.icon=version.png
web.status.1.content.1.line.1='<b>ProgressBar without warning or critical</b>'
web.status.1.content.1.line.2=ProgressBar(33, 100)
web.status.1.content.1.line.3='<b>ProgressBar with warning lower than critical (Example: disk usage)</b>'
web.status.1.content.1.line.4=ProgressBar(10, 100, 33, 66)
web.status.1.content.1.line.5=ProgressBar(50, 100, 33, 66)
web.status.1.content.1.line.6=ProgressBar(75, 100, 33, 66)
web.status.1.content.1.line.7='<b>ProgressBar with warning higher than critical (Example: ink cartridge)</b>'
web.status.1.content.1.line.8=ProgressBar(75, 100, 66, 33)
web.status.1.content.1.line.9=ProgressBar(50, 100, 66, 33)
web.status.1.content.1.line.10=ProgressBar(10, 100, 66, 33)
22 changes: 22 additions & 0 deletions rpimonitor/template/example.visibility.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
########################################################################
# Example how to manage visibility of status information
# Page: 1
# Information Status Statistics
# - visibility - yes - no
# This proof of concept is behaving has follow:
# If minute number is odd the row is visible
# If minute number is even the row is hidden
# The parameter visibility should be a valid javascript formula returning
# - 0 to hide the row
# - anything else but 0 to show the row
########################################################################
dynamic.1.name=visibility
dynamic.1.source=date +"%M"
dynamic.1.regexp=(.*)
dynamic.1.postprocess=$1%2
dynamic.1.rrd=

web.status.1.content.1.name=Visibility
web.status.1.content.1.icon=version.png
web.status.1.content.1.visibility=data.visibility
web.status.1.content.1.line.1='Visibility: <b>Control row visibility</b>'
54 changes: 48 additions & 6 deletions rpimonitor/template/raspbian.conf
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@
# strip is identified by a unique <status id>. Each status strip is
# defined by a name, an icon and a serie of lines described as follow:
#
# web.status.<page id>.visibility=<visibility formula>
#
# <visibility forlula> should be a valid javascript formula returning
# 0: to hide the row
# anything else but 0: show the row
#
# web.status.<page id>.content.<status id>.name=<display name>
# web.status.<page id>.content.<status id>.icon=<display icon>
# web.status.<page id>.content.<status id>.line.<line number>=<parameter>
Expand Down Expand Up @@ -158,10 +164,31 @@
# Percent(value,total)
# Print percentage of value compared to total
#
# ProgressBar(value,total)
# ProgressBar(value,total,warning, danger)
# Draw a progressbar representing the value compared to total.
# [=========------------]
#
# The default color of pregressbar is blue.
# If warning value is lower than critical, progressbar color will
# be orange if percentage is higher than warning value and red
# if the percentage is higher than danger value
# If warning value is higher than critical, progressbar color will
# be orange if percentage is lower than warning value and red
# if the percentage is lower than danger value
#
# JustGageBar(title, label,min, value, max, width, height, levelColors, warning, critical)
# Draw a half-circular gauge
# title : Title of the gauge (located on to of the gauge)
# label : Label of the gauge (located under the value)
# min : min value of the gauge
# value : value to be drawn
# max : max value of the gauge
# width, height : size of the gauge
# levelColors : Array defining colors of each level [normal,warning,critical]
# (in Hex format), default: green, orange and red.
# Default colors are available into the array 'percentColors'.
# warning : Warning level (in %) used to define color (default: 33)
# critical : Critical level (in %) used to define color (default: 66)
#
# Plural (value)
# Print 's ' if value > 1 or ' ' if not.
#
Expand All @@ -171,16 +198,17 @@
# display on screen the current time and will simulate the
# seconds by incrementing them periodically.
#
# Label(data,formula, text, LEVEL)
# Badge(data,formula, text, LEVEL)
# Label(data,formula, text, level)
# 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/badge has to be printed
# text : text to be displayed
# LEVEL : 'default' or 'success' or 'warning' or 'important'
# or 'info' or or 'inverse'
# level : 'default' (grey), 'primary' (blue label/grey badge),
# 'success' (green), 'info' (cyan), 'warning' (orange)
# or 'danger' (red)
#
# The statistic page is fully configurable.
# It is possible to define multiple pages. Each page is identified by
Expand Down Expand Up @@ -212,6 +240,12 @@
# <parameter> and <value> can be find into the same web page as previous
# parameter. This allow to customize the graph and axis.
#
# Example file are available in the template directory (prefixed by 'example').
# To understand how a feature is behaving, you can include this example file
# using the 'include' directive.
# These include directive are already written (commented) into the default
# configuration file: raspbian.conf
# When configuration files change, it is required to restart rpimonitor.
#######################################################################

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

#include=/etc/rpimonitor/template/example.justgage.conf
#include=/etc/rpimonitor/template/example.badge_and_label.conf
#include=/etc/rpimonitor/template/example.progressbar.conf
#include=/etc/rpimonitor/template/example.visibility.conf

include=/etc/rpimonitor/template/version.conf
include=/etc/rpimonitor/template/uptime.conf
include=/etc/rpimonitor/template/cpu.conf
Expand All @@ -241,3 +280,6 @@ include=/etc/rpimonitor/template/network.conf
#include=/etc/rpimonitor/template/storage.conf
#include=/etc/rpimonitor/template/services.conf
#include=/etc/rpimonitor/template/wlan.conf
#include=/etc/rpimonitor/template/dht11.conf


4 changes: 2 additions & 2 deletions rpimonitor/template/sdcard.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ 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="<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>"
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total,60,80)
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>"
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total,60,80)

web.statistics.1.content.3.name=Disks - boot
web.statistics.1.content.3.graph.1=sdcard_boot_total
Expand Down
4 changes: 2 additions & 2 deletions rpimonitor/template/sdcard_raspbmc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ 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="<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>"
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total,60,80)
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>"
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total,60,80)

web.statistics.1.content.3.name=Disks - boot
web.statistics.1.content.3.graph.1=sdcard_boot_total
Expand Down
4 changes: 2 additions & 2 deletions rpimonitor/template/sdcard_xbian.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ 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="<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>"
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total)
web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total,60,80)
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>"
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total)
web.status.1.content.7.line.4=ProgressBar(data.sdcard_root_used,data.sdcard_root_total,60,80)

web.statistics.1.content.3.name=Disks - boot
web.statistics.1.content.3.graph.1=sdcard_boot_total
Expand Down
6 changes: 1 addition & 5 deletions rpimonitor/template/services.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# - 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
Expand All @@ -28,5 +25,4 @@ dynamic.4.regexp=tcp .*:(443).*LISTEN

web.status.1.content.1.name=Servers
web.status.1.content.1.icon=daemons.png
web.status.1.content.1.line.1="<b>ssh</b> : "+Label(data.ssh,"==22","OK","success")+Label(data.ssh,"!=22","KO","important")+" <b>rpimonitor</b> : "+Label(data.rpimonitor,"==8888","OK","success")+Label(data.rpimonitor,"!=8888","KO","important")+" <b>nginx http</b> : "+Label(data.http,"==80","OK","success")+Label(data.http,"!=80","KO","important")+" <b>nginx https</b> : "+Label(data.https,"==443","OK","success")+Label(data.https,"!=443","KO","important")
web.status.1.content.1.line.2="<b>ssh</b> : "+Badge(data.ssh,"==22","OK","success")+Badge(data.ssh,"!=22","KO","important")+" <b>rpimonitor</b> : "+Badge(data.rpimonitor,"==8888","OK","success")+Badge(data.rpimonitor,"!=8888","KO","important")+" <b>nginx http</b> : "+Badge(data.http,"==80","OK","success")+Badge(data.http,"!=80","KO","important")+" <b>nginx https</b> : "+Badge(data.https,"==443","OK","success")+Badge(data.https,"!=443","KO","important")
web.status.1.content.1.line.1="<b>ssh</b> : "+Label(data.ssh,"==22","OK","success")+Label(data.ssh,"!=22","KO","danger")+" <b>rpimonitor</b> : "+Label(data.rpimonitor,"==8888","OK","success")+Label(data.rpimonitor,"!=8888","KO","danger")+" <b>nginx http</b> : "+Label(data.http,"==80","OK","success")+Label(data.http,"!=80","KO","danger")+" <b>nginx https</b> : "+Label(data.https,"==443","OK","success")+Label(data.https,"!=443","KO","danger")
6 changes: 4 additions & 2 deletions rpimonitor/template/temperature.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ 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: <b>"+data.soc_temp+"&deg;C</b>"
#web.status.1.content.4.line.1="CPU Temperature: <b>"+data.soc_temp+"&deg;C</b>"
#web.status.1.content.4.line.1=JustGageBar("CPU Temperature", data.soc_temp+"�C", 40, data.soc_temp, 80, 100, 80)
web.status.1.content.4.line.1=JustGageBar("Temperature", "�C", 40, data.soc_temp, 80, 100, 80)

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)
web.statistics.1.content.8.ds_graph_options.soc_temp.label=Core temperature (C)
9 changes: 0 additions & 9 deletions rpimonitor/web/css/bootstrap-responsive.min.css

This file was deleted.

Loading

0 comments on commit ec83554

Please sign in to comment.