This post originated from an RSS feed registered with Python Buzz
by Aaron Brady.
Original Post: Graphing Raspberry Pi internal temperature with collectd
Feed Title: insom.me.uk
Feed URL: http://feeds2.feedburner.com/insommeuk
Feed Description: Posts related to using Python. Some tricks and tips, observations, hacks, and the Brand New Things.
I’m a big fan of collectd, the pluggable metrics collection daemon, and I
came across this post about checking the temperature, so I decided to get
collectd up and running on my Pi and pull some graphs out to see if there are
any trends.
Because collectd defaults to a 10 second quantum, it will either keep my USB
disk drive awake the whole time or wear out my SD card. One option would be
to use the ‘network‘ plugin for collectd and ship the readings off to
a bigger machine, but in the interests of being self contained, I’ll use
a tmpfs filesystem (which is basically a RAM disk).
sudo apt-get install collectd-core
sudo mount -t tmpfs tmpfs /var/lib/collectd/
It won’t start because it’s missing a configuration, so lets put a basic one
together, in /etc/collectd/collectd.conf:
You can see a commented out section referencing the thermal plugin-
unfortunately this was broken in the version of collectd that is currently in
Raspian Wheezy. The fix is in this
commit,
but I didn’t really want to build collect from source, for instead I’m using
the table plugin, and cheating by omitting the PrefixFrom parameter.
Start collectd with sudo /etc/init.d/collectd start and within a few seconds
you should see files start to appear in /var/lib/collectd/<your hostname>/table-thermal/.
If you don’t have a collectd graphing utility, you can generate one using rrdtool.
(I use my own dashboard that I wrote at work usually, but it’s not been
updated for collectd 5.1, as Ubuntu still ships 4.10 in their LTS releases).
An example rrdtool incantation, and the graph to go with it: