Raspberry Pi monitor

From WickyWiki


Links

With Rpi-monitor you can monitor various aspects of your Raspberry Pi. The package has its own simple webserver. It works well for smaller screens (mobile phone) and history can be visualized with some graphs. If it still isn't to your liking it allows for some serious tinkering.

Local webservice, access within the local network with:

Install

echo "deb http://www.giteduberger.fr rpimonitor/" | sudo tee /etc/apt/sources.list.d/rpimonitor.list
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2C0D3C0F 
sudo apt-get update
sudo apt-get install rpimonitor

Remove

Repository:

sudo rm /etc/apt/sources.list.d/rpimonitor.list
sudo apt-key del 2C0D3C0F

Monitor package:

sudo apt-get purge rpimonitor
rm -fr /etc/rpimonitor
rm -fr /usr/share/rpimonitor

Configure

cd /etc/rpimonitor/template
ls -l
sudo nano /etc/rpimonitor/template/version.conf
sudo nano /etc/rpimonitor/template/uptime.conf
sudo nano /etc/rpimonitor/template/cpu.conf
sudo nano /etc/rpimonitor/template/temperature.conf
sudo nano /etc/rpimonitor/template/memory.conf
sudo nano /etc/rpimonitor/template/swap.conf
sudo nano /etc/rpimonitor/template/sdcard.conf
sudo nano /etc/rpimonitor/template/network.conf

Documentation

man rpimonitord
man rpimonitord.conf
rpimonitord -i

Modify interval

Default is 10 seconds, changed it to 150 seconds (2.5min).

sudo nano -l +17 /etc/rpimonitor/daemon.conf
daemon.delay=150
sudo systemctl restart rpimonitor

Network monitoring

Uncomment all lines that are commented and comment the lines that contain the configuration message.

sudo nano /etc/rpimonitor/template/network.conf

Tweaking

Edit cpu.conf to include CPU throttling

(Rapberry Pi 3)

sudo nano /etc/rpimonitor/template/cpu.conf
dynamic.1.source=/proc/uptime
dynamic.1.regexp=(^\S+)

dynamic.1.name=cpu_frequency
dynamic.1.source=vcgencmd measure_clock arm | sed -e "s/frequency(45)=//g"
dynamic.1.postprocess=$1/1000000
dynamic.1.rrd=

Reduce main page width (experimental)

Search for the file we know to contain style we want to change:

find / -name "rpimonitor.css" 2>/dev/null
  1. changed width: 518px; into width: 300px;:
  2. changed nowrap into normal:
sudo nano -l +63 /usr/share/rpimonitor/web/css/rpimonitor.css
.Text {
  float: left;
  font-family: Tahoma, Helvetica;
  font-size: 13px;
  line-height: 13px;
  padding-left: 30px;
  padding-right: 30px;
  padding-top: 15px;
  width: 300px; // 518px
  white-space: normal ; // nowrap;
}

Reduce graph width (experimental)

Changed graph_width:"750px" into graph_width:"400px":

sudo nano -l +174 /usr/share/rpimonitor/web/js/rpimonitor.statistics.js
...
rrdflot_defaults={ graph_width:"400px",graph_height:"285px", scale_width:"350px", scale_height:"90px", use_rra:true, rra:active_rra };
...

Link from the main page directly to the corresponding graph

  • Included in v2.13+

Modify the function Start() in "rpimonitor.statistics.js" to read a parameter 'graph':

sudo nano -l +26 /usr/share/rpimonitor/web/js/rpimonitor.statistics.js

// ...

function Start() {
  static = getData('static')
  graphconf = getData('statistics')

  //modified: read activestat from url graph parameter
  activestat = GetURLParameter('graph');
  if (activestat == null){
    activestat = localStorage.getItem('activestat') || 0;
  }

  // ... unchanged ...

  activePage = GetURLParameter('activePage');

  // ...
}

// ...

Then modify "uptime.conf" (graph=0) to include a link to the graph. Same for for "cpu.conf" (graph=1), "temperature.conf" (graph=2), etc:

sudo nano /etc/rpimonitor/template/uptime.conf
web.status.1.content.1.name=<a target=_blank href=statistics.html?graph=0>Uptime</a>