Tuesday, October 15, 2013

RPi-Monitor: Version 2.5.1 is available

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

The version 2.5.1 of RPi-Monitor has been released (replacing the version 2.5 due to issue #22).

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

Photo from Flickr by todbot AttributionNoncommercial cc-by-nc 

What's new in this version?
Some users have pushed their Raspberry Pi to its limits and found some side effect in RPi-Monitor. This version comes with improvement to fix such side effects. Thanks to allo the contributoirs which help me to improve RPi-Monitor.

Here is the changelog of version 2.5.1:

  • Update rrd graph with unkown data if fetched information is not a valid number
  • Fix issue #22 : empty.rrd file not properly generated

And changelog of version 2.5:
  • Fix issue #16: (v2.4) Network Graph displaying Bytes/s not in bits/s (wrong Legend) (From deMattin)
  • Update configuration to be compatible with NOOBS as proposed in issue #17 (From deMattin)
  • Implement modification for small screen proposed in issue #18 (From deMattin)
  • Change footer to better fit with small screens
  • Implement pull request #20: Counting buffers and cache as available memory (From Harbulot)
  • Add the possibility to set Min and Max values for rrd graphs in configuration file (issue #19 #21)


Installation

Download it from the official repository in Github:
    sudo wget http://goo.gl/yv46v3 -O rpimonitor_2.5.1-1_all.deb

Install the dependencies by executing the following command (be careful, the file in red is a new dependency):
    sudo apt-get install librrds-perl libhttp-daemon-perl libjson-perl libipc-sharelite-perl

Installation or upgrade can be done with the command:
    sudo dpkg -i rpimonitor_2.5.1-1_all.deb


Upgrade

If you are doing an upgrade and want to remove the strange peak you may see in network graphs, you should adjust the min and max values of RRD database storing network information.
This can be done with the two following commands:

rrdtool tune /usr/share/rpimonitor/web/stat/net_received.rrd -a net_received:0 
rrdtool tune /usr/share/rpimonitor/web/stat/net_send.rrd -i net_send:0

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

Man pages are also available in the wiki.

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! ;-). 

35 comments :

  1. Hello ! First, thanks a lot for this simple and cool app.

    Posting my request here, hopping that nobody mind.
    When overflying a graph with the mouse, a popup shows a precise data. Coud it be possible to also show the precise time related to it ?

    Thanks, Rdn

    ReplyDelete
    Replies
    1. Hello,

      Yes, it should be. It is in my todolist.

      Cheers, Xavier

      Delete
    2. Great, this is exactly what I was missing as well!

      Delete
  2. Hello,
    I am a novice.
    What is the command to install the rrdtool package. In order to correct the strange peak.

    thank you.
    Jacky

    ReplyDelete
    Replies
    1. The command is
      sudo apt-get install rrdtool

      Note, applying the command described upper will not fix existing "strange peak" but only avoid them in the future.

      To remove "strange peak", it is required to directly work on RRD database. In such a situation, the best thing to use this tool is to refer to rrdtool web site: http://oss.oetiker.ch/rrdtool/.

      Delete
  3. Hello,

    Thank you for your reply and for all the details.

    Congratulations for your excellent work.
    Jacky

    ReplyDelete
  4. Hi Xavier

    Like your work. Nice piece of work.
    Encounter 2 problems and hope you can direct me to the fix.

    1. When view Statistics.
    Error "file stat/sdcard_root_total.rrd is not a valid RRD archive!"
    Reboot does not clear the error.

    3. Shellinabox does not work. Have installed Shellinabox.

    Thanks for your kind reply.
    Boon

    ReplyDelete
    Replies
    1. Version 2.5.1 is fixing the issue of statistics, upgrading your installation should fix this issue.
      For Shellinabox, you should first try to see if it works in standalone and then configure RPi-Monitor to point to this address.

      Delete
  5. Bonjour,
    Tout d'abord merci pour ce soft !!!
    Je viens de faire la mise à jour vers la 2.5.1. Il me semble qu'un nouveau paramètre vient de faire son apparition dans la partie "Mémoire" : Available Memory (MB)
    Quel est la différence avec l'ancien paramètre (toujours présent) : Free Memory (MB)

    Merci,

    Cedric

    ===================

    Hi
    First, thank you very much for this app !!!
    I'd just migrate to 2.5.1. It seem there is a new parameter in "Memory" section : Available Memory (MB)
    What's the difference between this one, and the older (still present) : Free Memory (MB)

    Thank you,

    Cedric

    ReplyDelete
    Replies
    1. Bonjour Cédric,

      In Linux, the memory which has been use by a process but is no more needed by this process is not deleted so it is not counted as free but available (free is memory never used). It means that if the kernel need to assign a memory to a new process, it can use this available area and the previous data will be overwritten.
      If there is no more available/free memory, the system will use swap. That why, to know if a system is overloaded or not, it is common to just check if swap was used or not.

      Cheers,

      Xavier

      Delete
  6. Hi Xavier,
    i just saw, that the Graphs dealing with memor (sd and ram) are showing a wrong Date and time. All other Graphs, including my own defined Graphs for temp and humidity (according to your article) Show the correct time and date. The time is about 2h in advance.
    What am i doing wrong?

    Regards Christoph

    ReplyDelete
  7. Sorry,
    I have to edit my last post about the shown time of the Graphs. Not only the time is wrong, even the date is totally in history. This issue leads me to the question, how to check the last stored date in the rrd-file.
    Christoph

    ReplyDelete
  8. Hi Xavier,
    please can you tell me how to reset all data stored in rrd. Is it ok to delete all data files?
    Regards, Christoph

    ReplyDelete
    Replies
    1. Hello Christoph,
      To reset the graph, you can delete the rrd files stored in /usr/share/rpimonitor/web/stat/ and restart rpimonitor (sudo service rpimonitor restart). All the graphs will be recreated and it should fix your issue.
      Regards, Xavier

      Delete
    2. Hello Xavier,
      after some tries, i have found a solution for my issue!
      It was my fault, i didn't knew that firefox will not read the page from my server, when i click on the 'Statistis' Link in your page! So i used Ctrl+F5 to reload and: the graph is _newly_ loaded and of course the graph is correct. I changed the firefox cache behaviour and i hope the graphs will be updated every time i click the link.

      Thank you very much for your help, and excuse my silly quastions!
      Regards, Christoph

      Delete
  9. Xavier,

    I use you're RpiMonitor for reading DHT22 sensors.
    I noticed that with 2.5.1.1 when the data from the sensors is empty it's logged as 0, with 2.4.1 that did not happen, how can i prevent this?
    My graphs are very messy with 2.5.1.1

    Is this due to the following fix in 2.5.1.1:?

    Update rrd graph with unkown data if fetched information is not a valid number

    I reinstalled 2.4.1 now.

    Regards,

    Henk

    ReplyDelete
    Replies
    1. Hi Henk,

      I already answer this question but I don't find where :-( so I'll answer again...

      In version 2.5.1, when an unknown value is read, it is stored as unknown.
      This ensure that the graph will be correct.
      In previous version, the value was not stored. The web interface is doing some calculation and rewrite data. In such a situation, it is not possible to ensure that the data displayed are the correct data (even if the graph looks beautiful).
      The side effect you saw can be fixed in the script you are using to read the DHT22. I would advised to create a script writing the data from DHT22 into a file only if the value is valid and to configure RPi-Monitor to read this file. In such a situation, if the value is wrong, the graph will be flat.

      Regards,

      Xavier

      Delete
    2. If it helps - I am using this python script to get valid values and store them in a file. The script is run every minute with a crontab. This is my first python script so excuse any rough coding. The script was modified from an Adafruit library.

      __________________________________________________________

      Crontab below:

      #run dht22 python program
      * * * * * /usr/bin/python /home/pi/dht22/dht22.py >/dev/null/ 2>&1
      __________________________________________________________
      script is placed in: /home/pi/dht22/dht22.py

      requires Adafruit_DHT to be in same folder

      script attempts to read the temp & humidity 3 times until successfull
      if successful it writes the output to a file called dht22.dat
      if not script ends without updating the dht22.dat file

      ____________________________________________________________________

      #!/usr/bin/python

      import time
      import re
      import subprocess
      import sys

      flag = 1

      while(flag <= 3):
      # Run the DHT program to get the humidity and temperature readings!
      output = subprocess.check_output(["/home/pi/dht22/Adafruit_DHT", "22", "4"]);
      # print output
      #print 'Flag = ',flag

      # search for temperature printout
      matches = re.search("Temp =\s+([0-9.]+)", output)
      if (not matches):
      time.sleep(3)
      flag += 1
      continue
      temp = float(matches.group(1))

      # search for humidity printout
      matches = re.search("Hum =\s+([0-9.]+)", output)
      if (not matches):
      time.sleep(3)
      flag += 1
      continue
      humidity = float(matches.group(1))

      flag = 4

      if (flag == 4):
      # Redirect standard Print
      f = open('/home/pi/dht22/dht22.dat', 'w')
      sys.stdout = f
      # Print output
      localtime = time.asctime( time.localtime(time.time()) )
      print "Last Update :", localtime

      print 'Temp =',temp
      print 'Hum =',humidity

      Delete
  10. I really like this - precise and easy to see what is happening.
    I've running it on Xbian and it all works, with the exception of temperature. It just shows undefined°C.

    Could this be because of the Kernel I am using?

    Distribution: XBian GNU/Linux 7 (wheezy)
    Kernel version: Linux 3.10.12+ armv6l
    Firmware: #61

    ReplyDelete
    Replies
    1. I never installed Xbian that why only Raspbian is supported.
      RPi-Monitor is fully configurable you can adapt it by modifying the configuration file and restarting it. I let you read the tutorials and user comment ti find how to adapt RPi-Monitor to your needs.

      Delete
    2. Thanks Xavier for the reply - it pointed me in the right direction

      If I'm correct, you use /sys/devices/virtual/thermal/thermal_zone0/temp to get the temperature. Whereas Xbian and possibly Raspbmc and Openelec use /opt/vc/bin/vcgencmd measure_temp. I'll have a play on Raspbian and see if this command works as well. If it does, it "might" be worth changing it so that it will work on all RPi distros.

      Thanks again Iridium

      Delete
  11. check the number of spaces in the "Temp =\s+([0-9.]+)" statement - try changing it to "Temp =\s+([0-9.]+)" - the Adafruit_DHT module sends 2 spaces between the "p" and the "=". On my installation the single space in the python code works just fine but this suggestion may fix your problem.

    Also there is an error in the code posted above.
    Change "flag = 4

    if (flag == 4):"

    to

    flag = 6

    if (flag == 6):

    this for me removed the final lot of stray spikes on the graph.

    ReplyDelete
  12. Great piece of Pi.

    It´s allways nice with freinds but I would like to see there name somewhere in the title row.
    And I had to append the portnumber in default.conf for my freinds.

    web.friends.1.name=HomeCore
    web.friends.1.link=http://192.168.0.122:8888/
    #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/


    Thank you very much for a great software.

    ReplyDelete
  13. Hi I'm using rpimonitor to log the temperature fetched with an USB thermometer.
    This is what i'm doing:

    dynamic.19.name=outside_temp
    dynamic.19.source=/usr/local/bin/pcsensor -c
    dynamic.19.regexp=([-+]?[0-9]*\.[0-9]*)
    #dynamic.19.regexp=([-+]?[0-9]*\.?[0-9]*(?:C))
    dynamic.19.postprocess=
    dynamic.19.rrd=GAUGE

    the output of the "pcsensor -c" is:

    013/12/26 14:21:02 Temperature 21.12C

    The regular expression should match "21.12" however the rpimonitor is showing "undefined". What am i doing wrong?

    ReplyDelete
  14. Hi Xavier. First of, thank you for your excelent application!

    I installed RPi-Mon on my RPi and added the configuration settings for the DHT-22 temp sensor. After doing this, the status page stopped show data. Is there any way I can see logs or other way to debug the application to check why it is not show data?

    I also reverted the conf file to the original (the one that comes with the installation package) with no results.

    Here are the changes I made to the configuration file (/etc/rpimonitord.conf.d/default.conf)

    dynamic.16.name=living_room_temp
    dynamic.16.source=Adafruit_DHT 2302 22
    dynamic.16.regexp=Temp = (\S+)
    dynamic.16.postprocess=
    dynamic.16.rrd=GAUGE

    dynamic.17.name=living_room_hum
    dynamic.17.source=Adafruit_DHT 2302 22
    dynamic.17.regexp=Hum = (\S+)
    dynamic.17.postprocess=
    dynamic.17.rrd=GAUGE

    web.status.2.name=Temperatura
    web.status.2.content.1.name=Living
    web.status.2.content.1.icon=cpu_temp.png
    web.status.2.content.1.line.1="Temperatura: "+data.living_room_temp+"°C"
    web.status.2.content.1.line.2="Humedad: "+data.living_room_hum+"culo"

    web.statistics.2.name=Temperatura y Humedad
    web.statistics.2.content.1.name=Living
    web.statistics.2.content.1.graph.1=living_room_hum
    web.statistics.2.content.1.graph.2=living_room_temp
    web.statistics.2.content.1.ds_graph_options.living_room_hum.label=Humedad (%)
    web.statistics.2.content.1.ds_graph_options.living_room_temp.label=Temperatura (*C)
    web.statistics.2.content.1.ds_graph_options.living_room_hum.yaxis=1
    web.statistics.2.content.1.ds_graph_options.living_room_temp.yaxis=2
    web.statistics.2.content.1.graph_options.y1axis={ position: "right", min: 0, max: 100 }
    web.statistics.2.content.1.graph_options.y2axis={ position: "right", min: 0, max: 100 }

    Thank you for your help!

    ReplyDelete
  15. Hi,
    How can I change the storage location rrd database?. For example, to another disk.
    I do not want all of the time the data were stored on the SD card. I'm afraid that after one year of operation, the card may be damaged. I prefer the data to be recorded in another location.

    Thank you for your help!

    ReplyDelete
  16. One important remark about configuration and taking values from shell/perl/other "text" language scripts:

    if you are using as a source of data such kind of script DON'T use full path name to te script just put it somewhere under $PATH and use just name of script in "dynamic.X.source" statement otherwise you always get "0" value.
    That's because Xavier is using "-f" operator to test if he should execute file or just get content of file as a data. It's working for binary files but NOT working for scripts!

    ReplyDelete
  17. And one other important thing. It looks like that rpimonitor "running from init.d script during normal system startup" has no PATH to /usr/local/bin! (drawings that take data from scripts in /usr/local/bin directory have 0 value). Invoking service rpimonitor restart from shell removes problem.

    ReplyDelete
    Replies
    1. Thank you for the posting that /usr/local/bin isn't in the path on system startup. That was my issue.

      Delete
  18. On the status page, under network section
    Ethernet Sent: x.xxGB Received: xxx.xxMB
    Can you send me the linux command to get that info from a ssh terminal?

    ReplyDelete
    Replies
    1. If you look in /etc/rpimonitord.conf.d/default.conf for the dynamic KPIs you will see:
      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

      which is how those values are gather and further in the file you will see:
      web.status.1.content.8.name=Network
      web.status.1.content.8.icon=network.png
      web.status.1.content.8.line.1="Ethernet Sent: ...etc
      which is how they are displayed. I think the "KMG" part changes the value to kB, Mb or Gb (blospot will not let me past tags)

      so to answer your question:
      cat /sys/class/net/eth0/statistics/rx_bytes
      cat /sys/class/net/eth0/statistics/tx_bytes

      Delete
    2. @Creatures Of The Night

      I don't know which method Mr. Xavier has used, although it leads me to believe he is basically using Python.

      May I suggest you this?

      On linux you can achieve it with:

      ifconfig eth0 | grep "RX bytes" | sed 's/(\|)//g' | awk '{print "Ethernet Sent:",$7 $8, "Received: "$3 $4}'

      change eth0 with the proper network adapter interface name, which you want to output. (check ifconfig to list your network adapters)

      On mac OSX:

      netstat -ib | grep en0 | tail -1 | awk '{print "Ethernet en0 Received: " $7/(1024^2) " MB Sent: " $10/(1024^2) " MB"}'

      change en0 with the proper network adapter interface name.

      I'd also suggest you to look further into the awesome awk in order to let you understand it closer.

      Delete
  19. This comment has been removed by the author.

    ReplyDelete