OpenHAB’s systeminfo binding on a Raspberry Pi 2

OpenHAB is a great application that allows you to create a Smart Home.  It connects with almost any smart device.  This article assumes you already have OpenHAB installed on your Raspberry Pi 2 and are looking at installing the systeminfo binding to monitor some local stats on your server.

 Installing the OpenHAB binding

# apt-get install openhab-addon-binding-systeminfo

This will install the binding but there is an issues with the library on the Raspberry Pi.  It needs the SIGAR library manually installed.

# mkdir -p /usr/src/
# wget
# tar -xvpzf hyperic-sigar-1.6.4-src.tar.gz

The SIGAR library need to be compiled.  The collowing things need to be installed:

Oracle JDK 7
Ant 1.6.5 or higher
Perl 5.6.1 or higher
C compiler (I use GCC)

Most of the prerequesets where alredy on my system.  The only thing I had to install was ant.

# apt-get install ant

Compile up the library

# cd /usr/src/hyperic-sigar-1.6.4-src/bindings/java
# ant

Test the install

# java -jar sigar-bin/lib/sigar.jar

If this work you should see a sigar> prompt.  Type exit to get out of it.  Now move the sigar.jar and the into the OpenHAB lib directory.

# service openhab stop
# mkdir -p /usr/share/openhab/lib
# cp sigar.jar /usr/share/openhab/lib/
# chown -R openhab:openhab /usr/share/openhab/lib
# service openhab start

 A lot of this information was taken from here.

Here is some information on the systeminfo binding.

Leave a Comment

Your email address will not be published. Required fields are marked *