Raspberry Pi – Center for monitoring

My previous post was about how to measure temperature using the Raspberry Pi. This time we add more power to the system, and create our monitoring center with munin. Release the crow!

Munin is a lightweight server-agent based monitoring system which can be simply expanded with self written plugins. Each monitored host has it’s own munin-node installed, which opens a port (by default 4949) on which it can be accessed. The munin master goes through all the hosts defined in it’s config file, and collects the data provided by the nodes.  The data is collected in every 5 minutes, so it is not real time, but for monitoring slowly changing values, it is nearly perfect.

There are plugins nearly for everything (mysql, disk usage,  eth traffic, SMART data…) and there is a plugin also for openwrt (muninlite). But what we need, the monitoring tools for our temperature sensing, is not yet implemented. But today I will show you how monitor the 1-wire temperatures.

Software requirements (on a raspbian):

sudo apt-get install munin munin-node apache2 git

Later I will show you how to use lighttpd instead of apache, but that is not for today.

Some config files must be edited before the page can be accessed:

sudo nano /etc/apache2/conf.d/munin

Modify the lines containin ‘Allow from localhost’ to ‘Allow from localhost 192.168.0.0/16′

sudo service apache2 restart

And we are finished, with the munin server setup. You can now access the monitoring page at http://RPI-IP-address/munin.

Use a custom plugin:

Here is my git repository. There are some much needed munin plugins for the Raspberry Pi. We will use now only 3 of them:

  • rpi-internal-freq – A plugin for monitoring the frequency changes, if you have the overclocking enabled.
  • rpi-internal-temp – A plugin for monitoring the CPU+GPU temperature on the Pi.
  • rpi-w1-temp – A plugin, which collects data from all connected 1-wire temperature sensor.
git clone https://github.com/gajdipajti/munin-rpi-temp.git
sudo ln -s /home/pi/rpi-internal-freq /etc/munin/plugins/rpi-internal-freq
sudo ln -s /home/pi/rpi-internal-temp /etc/munin/plugins/rpi-internal-temp
sudo ln -s /home/pi/rpi-w1-temp /etc/munin/plugins/rpi-w1-temp
sudo chmod +x /etc/munin/plugins/rpi-*
sudo service munin-node restart

Test the plugins with:

sudo munin-run rpi-internal-freq
sudo munin-run rpi-internal-temp
sudo munin-run rpi-w1-temp

The outputs:

cpu.value 950
temp.value 48.692
temp1.value 25.937
temp2.value 26.437
temp3.value 29.562

My last post was about how to measure temperature using the Raspberry Pi. This time we add more power to the system, and create our monitoring center with munin. Release the crow!

Munin is a lightweight server-agent based monitoring system which can be simply expanded with self written plugins. Each monitored host has it’s own munin-node installed, which opens a port (by default 4949) on which it can be accessed. The munin master goes through all the hosts defined in it’s config file, and collects the data provided by the nodes.  The data is collected in every 5 minutes, so it is not real time, but for monitoring slowly changing values, it is nearly perfect.

There are plugins nearly for everything (mysql, disk usage,  eth traffic, SMART data…) and there is a plugin also for openwrt (muninlite). But what we need, the monitoring tools for our temperature sensing, is not yet implemented. But today I will show you how monitor the 1-wire temperatures.

Software requirements (on a raspbian):

sudo apt-get install munin munin-node apache2 git

Later I will show you how to use lighttpd instead of apache, but that is not for today.

Some config files must be edited before the page can be accessed:

sudo nano /etc/apache2/conf.d/munin

Modify the lines containin ‘Allow from localhost’ to ‘Allow from localhost 192.168.0.0/16′

sudo service apache2 restart

And we are finished, with the munin server setup. You can now access the monitoring page at http://RPI-IP-address/munin.

Use a custom plugin:

Here is my git repository. There are some much needed munin plugins for the Raspberry Pi. We will use now only 3 of them:

  • rpi-internal-freq – A plugin for monitoring the frequency changes, if you have the overclocking enabled.
  • rpi-internal-temp – A plugin for monitoring the CPU+GPU temperature on the Pi.
  • rpi-w1-temp – A plugin, which collects data from all connected 1-wire temperature sensor.
git clone https://github.com/gajdipajti/munin-rpi-temp.git
sudo ln -s /home/pi/rpi-internal-freq /etc/munin/plugins/rpi-internal-freq
sudo ln -s /home/pi/rpi-internal-temp /etc/munin/plugins/rpi-internal-temp
sudo ln -s /home/pi/rpi-w1-temp /etc/munin/plugins/rpi-w1-temp
sudo chmod +x /etc/munin/plugins/rpi-*
sudo service munin-node restart

Test the plugins with:

sudo munin-run rpi-internal-freq
sudo munin-run rpi-internal-temp
sudo munin-run rpi-w1-temp

The outputs (I have 3 DS18B20 sensors connected at the moment):

cpu.value 950
temp.value 48.692
temp1.value 25.937
temp2.value 26.437
temp3.value 29.562

My first results from december (I was monitoring the heater temperature)

76219_rpi_w1_temp-day

And from today, with the final version:

rpi_w1_temp-pinpoint=1405235242,1405343242

I want to mention a user from Prague: http://raspi.myslenka.net/
And some other related projects if you want to use something different:
[Python based] [hungarian]

My results: munin

The code frozen and released as v1.00. The development will continue some time in the future. Besides some data loss, and sensor order change this is good chart.

rpi_w1_temp-pinpoint=1389559104,1424119104Lost all the sensors after a kernel update? Switch to overlays!

Advertisements

Author: Gajdos Tamás

A "barefoot physicist" with some IT skills in system administration.

1 thought on “Raspberry Pi – Center for monitoring”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s