Tuesday, January 6, 2015

RPi-Monitor: Version 2.10 is available

Note: A new version of RPi-Monitor is available: Version 2.11.
All the details about the latest version of Rpi-Monitor are in RPi-Monitor overview


The version 2.10 of RPi-Monitor has been ( really ;-) ) released.

If you don't know yet what RPI-Monitor do, have a look to RPi-Monitor Overview.

Photo from flickr by-nc-nd by little-greene-paint-company

What's new in this version?
This version is coming with internal changes, improvement and bug fixes.

Here is the changelog of version 2.10:
  • Add addons allowing to create custom page
    -
    Top3 addon

    - Example addon
    -
    Shellinabox addon
    -
    Custom addon

    -
    Webcam: use hawkeye and custom addon to display webcam
  • Support UTF-8 fixing issue #43
  • Add BananaPi configuration files (found in BananaPi forum)
Note: A closing parenthesis ' ) ' is missing in the last line of  service.conf .
If you want to use this file as a source of your customisation, remember to add to fix this issue. It is already fixed in github repositories (and future releases).
Installation or upgrade from the repository 

If you already have installed the latest version of RPi-Monitor using the repository, you can execute the following commands to upgrade:


    sudo apt-get update
    sudo apt-get upgrade


If you install RPi-Monitor for the first time, follow to the instruction bellow to install the repository and install RPi-Monitor with the apt-get command.

Activate https transport for apt and add certificate authority:
 

    sudo apt-get install apt-transport-https ca-certificates

Install my public key to trust RPi-Monitor repository:


    sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2C0D3C0F

Execute the following command to add RPi-Monitor into your list of repository: 

    sudo wget http://goo.gl/rsel0F -O /etc/apt/sources.list.d/rpimonitor.list

To install RPi-Monitor, execute the following command: 

    sudo apt-get update
    sudo apt-get install rpimonitor

After installation or upgrade you should excute the following command to update information about upgradable packages:

  sudo /usr/share/rpimonitor/scripts/updatePackagesStatus.pl

Manual installation is still working. Refer to RPi-Monitor Installation page for explaination.


New: Addons and custom pages

RPi-Monitor is now supporting addons. Addons can be custom pages designed to give you the possibility to free your imagination and cutomise RPi-Monitor to your needs.

Addons are html pages, javascript and css directly integrated into RPi-Monitor.

 The activation of an addon is done into RPi-Monitor configuration file. The following line is showing how to activate the default addons explaing addons feature: 

  web.addons.1.name=Addons
  web.addons.1.addons=about


It is possible to use an addon many time into a same configuration file (using different parameters if the addon support them).

The next part of this article will show you some example of addons and is highlighting the possibilities of this new feature.

Top3 Addon 
 
Top3 is showing how to use addons to add additionnal information into status page. This addons is designed to periodically generate HTML content. This content can be accessible from the addons menu (if addon is configured in rpimonotord configuration file) and/or can be inserted into status page using the function InsertHTML().


To activate this addon, add the following line to your configuration file
 
  web.addons.2.name=Top3
  web.addons.2.addons=top3


and configure the cron of your Raspberry Pi to update the HTML content periodically. This can be done with the following lines:

* * * * * root cd /usr/share/rpimonitor/web/addons/top3; ./top3 > top3.html

For deeper details, refer to rpimonitor manpage and to comments available into the script top3.

Example Addon

If you want to develop your own addon, you can refer to the example addons to see how to implement such a feature.
Example addon is providing a HTML page, a javacript and a CSS showing how an addon page can interact with RPi-Monitor.  

Example addon can activate by adding the following lines into the configuration file:

  web.addons.3.name=Addon example
  web.addons.3.addons=example
  web.addons.3.parameter=parameter_example

Shellinabox Addon

Shellinabox is now an addon. It activation should now be activated as an addons
  web.addons.4.name=ShelleInABox
  web.addons.4.addons=shellinabox

The behavior of this addon remain the same as previously embedded feature.

Custom Addon

If you are not confortable with html, javascript and css, the addon custom may help you to customise RPi-Monitor to your wishes. This addons implement an iframe that can display any other web pages.

  web.addons.5.name=Custom addons
  web.addons.5.addons=custom
  web.addons.5.url=/addons/custom/custominfo.html

url is defining the page to be displayed into the iframe. It can be a file reachable from RPi-Monitor internal server or a site available into the Internet.

Webcam

If you want to see the image of your webcam in your brower, you can use hawkeye. Once hawkeye installed, it is very easy to add it into RPi-Monitor interface using the custom addon. The configuration will then be the following:

  web.addons.3.name=Webcam - Hawkeye
  web.addons.3.addons=custom
  web.addons.3.url=http://raspberry_adress:8000/


url parameter point to hawkeye web interface. If you are doing such a configuration, keep in mind about the security of your images. You should use the capacity of hawkeye to restrict the access to the image using a login and a password. You can also have a look to my article showing how to secure the access to RPi-monitor.
 

Customization

RPi-Monitor is fully configurable so if the displayed information doesn't match you need, customize it.
Everything display in status pages or in statistics pages can be modified, tuned and customized to your needs.

To see how to customize it, use the command
    man rpimonitord
and
    man rpimonitord.conf

To define the configuration you can use RPi-Monitor Interactive Configuration Helper whit the command:
    rpimonitord -i

You will find some examples of customization in RPi-Monitor articles.

Usage

Once RPi-Monitor is configured as you wished, browse http://RPiIpAddress:8888/ to access to the web interface.

Note: The graphs rendering may have strange behavior on Google-Chrome on Windows while it works fine on Linux. Internet Explorer is even not able to display statistics, it is then advised to use Firefox on Windows or better... switch to Linux! ;-). 
Note 2: Since RPi-Monitor is now using bootstrap 3, the behavior may have changed. Your comments are welcome.

37 comments :

  1. ERROR: "ssh : "+Label(data.ssh,"==22","OK","success")+Label(data.ssh,"!=22","KO","danger")+" rpimonitor : "+Label(data.rpimonitor,"==8888","OK","success")+Label(data.rpimonitor,"!=8888","KO","danger")+" nginx http : "+Label(data.http,"==80","OK","success")+Label(data.http,"!=80","KO","danger")+" nginx https : "+Label(data.https,"==443","OK","success")+Label(data.https,"!=443","KO","danger")+" mysql : "+Label(data.mysql,"==3306","OK","success")+Label(data.mysql,"!=3306","KO","danger" -> SyntaxError: missing ) after argument list

    ;)

    ReplyDelete
    Replies
    1. A closing parenthesis ' ) ' is missing in the last line of service.conf.
      If you want to use this file as a source of your customisation, remember to add to fix this issue. It is already fixed in github repositories.

      Delete
    2. I exchanged that code anyway, just wanted you to know :)

      Delete
  2. Hello

    I'm not able to add the top3 addon on the status page... Is it due to the innerHTML ? I'm able to add a simple text but not the content of top3.html

    Thank you

    Et encore bravo pour votre travail :)

    ReplyDelete
    Replies
    1. Seeing the default text is a good start. You just have to add the cron line (described upper) in your cron file and it will work... or easier, copy the file /usr/share/rpimonitor/web/addons/top3/top3.cron into /etc/cron.d/

      Delete
    2. No sorry, I'm not able to see the default text of top3.html...
      I know that the cron will update the content, but the problem is that I can't see any content.
      Thx for your answer

      Delete
    3. At the addons->top3 page I only get this:
      undefined

      I activated the addon in the data.conf, in the cpu.conf and copyied the cron file into cron.d. and rebooted.

      Delete
    4. This file display in top3 addons page (be carefull to the id - they should be continuous starting from 1) is /usr/share/rpimonitor/web/addons/top3/top3.html
      This file is updated by the cron script.
      This is this file which is displayed by the function InsertHTML("/addons/top3/top3.html").
      Note the name of the function: InsertHTML and not innerHTML and the path of the file which is relative to the webroot.

      Delete
    5. I obtained the same result : "undefined" on the top3 page.
      The problem was the ids in the data.conf. The examples are "#web.addons.5.name=Top3 #web.addons.5.addons=top3". Because other id are commented, I needed to change 5 to 2.

      Now it works after a restart of rpimonitor.

      I've also changed the variable of process numbers showed in the script top3. Now I can see the top10.

      Thaks for your job Xavier.

      Delete
  3. Hello Xavier,

    first thanks a lot for pushing this great tool to the next level.
    But I'm struggling with the new addon-stuff, while reverse proxiing it thru nginx as suggested here: http://rpi-experiences.blogspot.fr/2013/05/rpi-monitor-security-and-authentication.html
    Browsing rpi-monitor directly via http://RPI_IP:8888 works fine, but via https://RPI_IP/PATH/ doesn't. On the old version 2.9 it worked like a charm.
    Any advise?
    Best regards

    ReplyDelete
    Replies
    1. On my side, RPi-Monitor is working beside nginx proxy expect the new addons feature. I didn't test this this feature in this situation. I'll have some workk for the next release...

      Delete
    2. Fixed in version 2.11... deb already available into devel branch.

      Delete
    3. I switched from path-based reverse proxy to a host-based config, there it works
      with 2.10 also for most stuff. So I can wait for final release of 2.11.

      Delete
  4. Hi Xavier, very nice tool, i'm using since febbruary 2014.
    I have a problem, after update to version 2.10 any my custom .conf file no longer work.
    Even if i use some template conf file, like "wifi.conf", anything is showing in stats or statistics page.
    It's only a my problem? i also tried to reinstall all.

    ReplyDelete
    Replies
    1. Configuration file of version 2 are supposed to be compatible with new release of software. But, as RPi-Monitor is fully configurable it may have some particularity I didn't / can't check. So to fix your issue, you should then reapply your customisation to your files going tep by step...

      Delete
  5. Hi
    I'm running version v2.10,and I configures the storage.conf template to show the used, free and total space of a network drive mapped on the pi, but the total and the free values only show up after restarting the RPI-Monitor with the command
    sudo /etc/init.d/rpimonitor restart

    Even after a pi boots up, the values don't show (they appear as NaN), but the used value appears ok.

    Here is my configuration:

    static.12.name=Popcorn_total
    static.12.source=df -t cifs
    static.12.regexp=//\d+.\d+.\d+.\d+/share\s+(\d+)
    static.12.postprocess=$1/1024

    dynamic.16.name=Popcorn_used
    dynamic.16.source=df -t cifs
    dynamic.16.regexp=//\d+.\d+.\d+.\d+/share\s+(\d+)\s+(\d+)
    dynamic.16.postprocess=$2/1024
    dynamic.16.rrd=GAUGE

    web.status.1.content.9.line.5="/Popcorn Used: "+KMG(data.Popcorn_used,'M')+"("+Percent(data.Popcorn_used,data.Popcorn_total,'M')+") Free: "+KM$
    web.status.1.content.9.line.6=ProgressBar(data.Popcorn_used,data.Popcorn_total)

    web.statistics.1.content.11.name=Popcorn Hour
    web.statistics.1.content.11.graph.1=Popcorn_total
    web.statistics.1.content.11.graph.2=Popcorn_used
    web.statistics.1.content.11.ds_graph_options.Popcorn_total.label=Popcorn Hour total space (MB)
    web.statistics.1.content.11.ds_graph_options.Popcorn_total.color="#FF7777"
    web.statistics.1.content.11.ds_graph_options.Popcorn_used.label=Popcorn Hour used space (MB)
    web.statistics.1.content.11.ds_graph_options.Popcorn_used.lines={ fill: true }
    web.statistics.1.content.11.ds_graph_options.Popcorn_used.color="#7777FF"

    ReplyDelete
    Replies
    1. When RPi-Monitor is started at boot and when it is started manually, the environemental variable are differents. You should then ensure that the command you add in your conf file is not dependant to the environemental variables.

      Delete
    2. I'm a little basic in linux and I didn't fully understood your answer :(
      RPi-Monitor is started automatically as defined in the installation (I guess).
      The mounting of the network drive is done via the /etc/rc.local file, with the line
      sudo mount -t cifs -o user=my_username,password=my_pass,sec=ntlmv2,rw,file_mode=0777,dir_mode=0777 //server_IP_address/share /mnt/popcorn/

      I initially tough that it could be due to the RPi-monitor that could be started first, I guess it's not the case since RPi-Monitor can correctly read the used space, but not the total one.

      I noticed in the rpi configuration that the used space is a static variable(?), while the used one is dynamic one, can this be the issue?

      Thanks Xavier

      Delete
  6. I would like to try to install on Debian GNU/Linux wheezy/sid [running on Android via Linux Deploy].

    The error message:

    $ sudo apt-get install rpimonitor
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    rpimonitor : Depends: libhttp-daemon-perl (>= 6.0.0) but 6.00-1 is to be installed or
    libwww-perl (< 6.0.0) but 6.03-1 is to be installed
    E: Unable to correct problems, you have held broken packages.

    This is a news, virgin system. What is the problem? :) Why can't use it with latest libwww-perl?

    ReplyDelete
    Replies
    1. The package is trying to define the dependencies needed by RPi-Monitor to ensure an automatic installation of required packages. I did test and support Raspbian (and only this OS).
      Your debian running on Androis is not supported. That dosn't mean that RPi-Monitor will not work. You should install the dependencies manually and force to install the package by ignoring the dependencies.

      Delete
  7. Hi Xavier,
    This is an awesome package, had it up and running on my RaspberryPI B+ running raspbian in a couple of minutes and works great. I'm looking forward to seeing usage charts over a couple of days.

    Also, thanks for your comment on openELEC, I was looking into modifying it for running on the media center and was glad to see you have tried but are held up with limitations in openELEC.

    Cheers, Brad

    ReplyDelete
  8. Hi Xavier,

    Nice work !

    For my needs, I wish to add some pages to your web interface to allow me to control power sockets (http://blog.idleman.fr/raspberry-pi-12-allumer-des-prises-distance/).
    Can you give me advices on the best method to add this functionnality ?

    Thanks


    Nils

    ReplyDelete
    Replies
    1. I would say that what you are loking for is "custom addon". Install your oftware then configure "custom addon" to point to the installed page.

      Delete
  9. Hi Xavier,

    I would like to thank you for this monitoring Software,i find it highly interessting and love the easy way to customize it!

    After some struggle with integrating wifi Strenght and Wifi Quality i finally managed to do so and i was able to integrate it into the Graph for Wifi.

    However i didnt find a way to change the tickFormatter for the Mini graph...

    Please have a look at this picture http://www11.pic-upload.de/29.03.15/cf9lmrle3w4r.png

    As you can see the Metric in the Top right for y-Axis 2 is Percent, but in the Mini-Graph it is still B/s from the tickformater from Y-Axis1

    My Tickformater Code looks as follow:
    web.statistics.1.content.9.graph_options.y2axis={tickFormatter: function (w) {return w +"%"},position: "right", min: 0, max: 100}


    Why doesent it affact the Mini Graph? And is there a way to change that behavoir?

    I hope you can reply to me when you find the time.

    Best wishes and Thanks in advance!

    Fabian

    ReplyDelete
    Replies
    1. Hi,
      I did integrate into RPi-Monitor the framework JavascriptRRD: http://javascriptrrd.sourceforge.net/. If you want to customize it, you should have a look to its documentation.
      Good luck.

      Delete
    2. Hi,
      I used JavascriptRRD: http://javascriptrrd.sourceforge.net/ todraw graphs.
      You should refer to its documentation if you need to customize.
      Good luck.

      Delete
  10. Hi,
    I used JavascriptRRD: http://javascriptrrd.sourceforge.net/ todraw graphs.
    You should refer to its documentation if you need to customize.
    Good luck.

    ReplyDelete
  11. Hello Xavier,
    Would it be possible to integrate Highcharts and push the chart generating over to the client browser and off of the Pi?

    ReplyDelete
    Replies
    1. RPi-monitor is already generating chart over the client using javascfiptrrd and off the Pi. It does even better than can do highchart since rrd are sent unchanged and doesn't require a convertion to json by the Pi.

      Delete
    2. Even better then. Thanks for the reply!

      Delete
  12. Hi Xavier

    I do not understand very well what is measured or expressed by %start and %total in the top3 addon. Start of what? Total as "sum of what"?

    Thank you for the very useful rpimonitor!

    ReplyDelete
  13. Hello,

    I would like to integrate RpiMonitor live as a free display in my own website, so that every visitor could see the server status.

    Do you know if it would make some security issues ?
    How could I do that ?

    Thanks for the great work, the software is very useful !

    ReplyDelete
    Replies
    1. RPi-Monitor has been designed to be safe. I don't think it would make some security issue. Have a look to recommendation of shellinabox if you are whilling to add this feature but personnaly I wouldn't use it on a public site.

      Delete
  14. Great little app and I'm very new at this whole thing - but I was wondering if there was a way to make my webpage auto-refresh so that I can see my values change on the fly?

    ReplyDelete
  15. Hi Xavier

    sudo wget http://goo.gl/rsel0F -O /etc/apt/sources.list.d/rpimonitor.list

    fails with the following errors

    sudo wget http://goo.gl/rsel0F -O /etc/apt/sources.list.d/rpimonitor.list
    --2015-12-26 20:56:01-- http://goo.gl/rsel0F
    Resolving goo.gl (goo.gl)... 216.58.213.142, 2a00:1450:4009:811::200e
    Connecting to goo.gl (goo.gl)|216.58.213.142|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://raw.githubusercontent.com/XavierBerger/RPi-Monitor/master/init/apt/sources.list.d/rpimonitor.list [following]
    --2015-12-26 20:56:02-- https://raw.githubusercontent.com/XavierBerger/RPi-Monitor/master/init/apt/sources.list.d/rpimonitor.list
    Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 62.252.172.241
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|62.252.172.241|:443... connected.
    GnuTLS: A TLS fatal alert has been received.
    GnuTLS: received alert [0]: Close notify
    Unable to establish SSL connection.

    ReplyDelete
  16. Hello, is there a docker image for RPI-Monitor?

    ReplyDelete
  17. Hello, is there a docker image for RPI-Monitor?

    ReplyDelete