Monday, July 21, 2014

Raspberry Pi Monitor

Use RRDTool monitor Raspberry Pi, include CPU temperture, Memory usage, Disk I/O, Network I/O...


install packages

sudo apt-get install libcairo2-dev libpango1.0-dev libglib2.0-dev libxml2-dev librrd-dev python2.7-dev rrdtool python-rrdtool
tar xf psutil-2.1.1.tar.gz
cd psutil-2.1.1
sudo python install

Download or clone rpi-monitor on github

Setup Crontab

By defualt, the cron.log is disabled in Raspbian. To enable it:

sudo vi /etc/rsyslog.conf

find the line and uncomment it.

# cron.*                          /var/log/cron.log

Restart rsyslog via:

sudo /etc/init.d/rsyslog restart

Modify crontab

crontab -e

Add schedule as below

#data collection every 5 minutes
*/5 * * * * /path/to/rpi-monitor/
#generate daily graph report at 00:01
1 0 * * * /path/to/rpi-monitor/ -1d
#generate weekly graph report at 00:03 on Monday
3 0 * * 1 /path/to/rpi-monitor/ -1w  

Report example

Raspberry Pi Hardware

CPU Temperture

The temperture drop to 44 because I add a fan on CPU.

CPU Used Percentage

PID Count

Memory Usage

Mount point Usage

Mount Point Percentage


eth0 I/O

eth1 I/O