Raspberry Pi monitor: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 110: | Line 110: | ||
= Tweaking = | = Tweaking = | ||
== Edit services.conf to check for running apache webservice == | |||
<syntaxhighlight lang=bash> | |||
sudo nano /etc/rpimonitor/template/services.conf | |||
</syntaxhighlight> | |||
<blockquote> | |||
<syntaxhighlight lang=css> | |||
dynamic.3.name=http | |||
dynamic.3.source=systemctl show -p SubState --value apache2 | |||
dynamic.3.regexp=(.*) | |||
web.status.1.content.1.line.1= Label(data.http,"=='running'","Apache","success") + Label(data.http,"!='running'","apache","danger") | |||
</syntaxhighlight> | |||
</blockquote> | |||
== Edit cpu.conf to include CPU throttling == | == Edit cpu.conf to include CPU throttling == | ||
Revision as of 08:09, 21 September 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.
- http://rpi-experiences.blogspot.nl/p/rpi-monitor-installation.html
- https://github.com/XavierBerger/RPi-Monitor
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 services.conf to check for running apache webservice
sudo nano /etc/rpimonitor/template/services.conf
dynamic.3.name=http dynamic.3.source=systemctl show -p SubState --value apache2 dynamic.3.regexp=(.*) web.status.1.content.1.line.1= Label(data.http,"=='running'","Apache","success") + Label(data.http,"!='running'","apache","danger")
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>