Monitor OpenELEC with Graphite
March 16, 2014Recently I have started consolidating metrics for all my machines into Graphite. I keep a couple of Raspberry Pis around the house and one of them runs OpenELEC, my favourite way for running XBMC on Raspberry Pi.
This is a quick guide on how to monitor uptime and load average on OpenELEC and send it to Graphite.
Before you start, make sure your time is accurate, since Graphite relies on timestamps for storing the information:
OpenELEC uses BusyBox and does not come with a package manager. Fortunately screen is quite portable and it is simple to manually extract it from Raspbians packages and drop in the binaries.
Either copy the files from an existing Raspbian system or use the commands below on a Debian based system to extract the files.
Both screen and the script is going to run out of /storage/
Grab a copy of screen
Grab a copy of libpam and libaudit
Create a wrapper for screen
Now that all files are in place in /storage/. Create screen.sh
Create the monitoring script
Create stats.sh
:
Start and detach screen
Detach with CTRL + A + D
.