Raspberry Pi monitor: Difference between revisions

From WickyWiki
mNo edit summary
Line 128: Line 128:
dynamic.1.postprocess=$1/1000000
dynamic.1.postprocess=$1/1000000
dynamic.1.rrd=
dynamic.1.rrd=
</syntaxhighlight>
</blockquote>
== Reduce main page width (experimental) ==
Search for the file we know to contain style we want to change:
<syntaxhighlight lang=bash>
find / -name "rpimonitor.css" 2>/dev/null
</syntaxhighlight>
# changed <u>width: 518px;</u> into <u>width: 300px;</u>:
# changed <u>nowrap</u> into <u>normal</u>:
<syntaxhighlight lang=bash>
sudo nano -l +63 /usr/share/rpimonitor/web/css/rpimonitor.css
</syntaxhighlight>
<blockquote>
<syntaxhighlight lang=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;
}
</syntaxhighlight>
</blockquote>
== Reduce graph width (experimental) ==
Changed <u>graph_width:"750px"</u> into <u>graph_width:"400px"</u>:
<syntaxhighlight lang=bash>
sudo nano -l +174 /usr/share/rpimonitor/web/js/rpimonitor.statistics.js
</syntaxhighlight>
<blockquote>
<syntaxhighlight lang=js>
...
rrdflot_defaults={ graph_width:"400px",graph_height:"285px", scale_width:"350px", scale_height:"90px", use_rra:true, rra:active_rra };
...
</syntaxhighlight>
</syntaxhighlight>
</blockquote>
</blockquote>
Line 180: Line 133:
== Link from the main page directly to the corresponding graph ==
== Link from the main page directly to the corresponding graph ==


* Included in v2.13+
* Included in new version v2.13+


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

Revision as of 20:23, 20 August 2018


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

Documentation

man rpimonitord
man rpimonitord.conf
rpimonitord -i

Main configuration files

Main configuration-file with possible references to the other templates:

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

Configuration of the daemon:

sudo nano /etc/rpimonitor/daemon.conf

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

Backup modified files

zip ~/rpi-monitor-files.zip /etc/rpimonitor/daemon.conf 
zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/raspbian.conf

zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/services.conf
zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/version.conf 
zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/uptime.conf 
zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/cpu.conf 
zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/temperature.conf 
zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/memory.conf 
zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/swap.conf 
zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/sdcard.conf 
zip ~/rpi-monitor-files.zip /etc/rpimonitor/template/network.conf 
zip ~/rpi-monitor-files.zip /usr/share/rpimonitor/web/js/rpimonitor.statistics.js

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=

Link from the main page directly to the corresponding graph

  • Included in new version 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>