Observium on Raspberry Pi

The Challenge
Install Observium on a Raspberry Pi running a vanilla Raspbian.
Observium – Network monitoring with intuition
Observium is an autodiscovering network monitoring platform supporting a wide range of hardware platforms and operating systems including Cisco, Windows, Linux, HP, Juniper, Dell, FreeBSD, Brocade, Netscaler, NetApp and many more. Observium seeks to provide a powerful yet simple and intuitive interface to the health and status of your network.
More see at: www.observium.org
Raspbian
Raspbian is the Debian 7 adapted for the Raspberry Pi. You can get this directly from the raspberrypi.org site with the installation documentation too. This tutorial depends on a vanilla install of raspbian already done.
Download at: http://downloads.raspberrypi.org/raspbian_latest
Steps to take
Install Raspberian
sudo bash
Install required packages
apt-get install libapache2-mod-php5 \ php5-cli php5-mysql php5-gd \ php5-mcrypt php5-json \ php-pear snmp fping \ mysql-server mysql-client python-mysqldb \ rrdtool subversion whois \ mtr-tiny ipmitool \ graphviz imagemagick mkdir -p /opt/observium && cd /opt
Install required packages
wget http://www.observium.org/observium-community-latest.tar.gz tar zxvf observium-community-latest.tar.gz
%
Installation success
Hamsters harmed
Minutes to install
Amazing Result

Configuration
Configure all necessary services
cd /opt/observium cp config.php.default config.php
Getting the database
mysql -u root -p mysql> CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' -> IDENTIFIED BY '<observium db password>'; mysql> flush privileges; mysql> \q
Edit config.php. Change the options to reflect your installation.
Setup the MySQL database and insert the default schema:
php ./includes/update/update.php
Adding directories
mkdir logs mkdir rrd chown www-data:www-data rrd
Configuration
Configure the apache
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /opt/observium/html <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /opt/observium/html/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined ServerSignature On </VirtualHost>
Alternatively you can create a vhost just for Observium
<VirtualHost *:80> DocumentRoot /opt/observium/html/ ServerName observium.domain.com CustomLog /opt/observium/logs/access_log combined ErrorLog /opt/observium/logs/error_log <Directory "/opt/observium/html/"> AllowOverride All Options FollowSymLinks MultiViews </Directory> </VirtualHost> mkdir -p /opt/observium/logs;chown www-data:www-data /opt/observium/logs
Enable the apache config
php5enmod mcrypt
And now we only have to enable the mod_rewrite module and restart the apache:
a2enmod rewrite apache2ctl restart
Adding the first user to Observium
cd /opt/observium ./adduser.php <username> <password> <level>


Setting up SNMP
Installing the packages
aptitude install snmpd
After that we have to configure it. Change the following lines in the /etc/snmp/snmpd.conf
From: # createUser authOnlyUser MD5 "remember to change this password" To: createUser authOnlyUser MD5 "raspberry" And the sysLocation from: sysLocation Sitting on the Dock of the Bay sysContact Me <me@example.org> To: sysLocation Raspberry Pi sysContact info@linuxpinguin.de
And we have to add the following line to /etc/snmp/snmp.conf to enable the MIBs:
mibdirs /opt/observium/mibs
Now start the SNMPd
service snmpd start update-rc.d snmpd enable snmpwalk -v 3 -a MD5 -u authOnlyUser -A raspberry -l authNoPriv 127.0.0.1 .1
Discover and poll the Raspberry Pi
cd /opt/observium ./discover.php -h all ./poller.php -h all
And now we can add this into the crontab to get regular updates on the devices installed:
vi /etc/cron.d/observium Add these lines: 33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1 */5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1 */5 * * * * root /opt/observium/poller-wrapper.py 2 >> /dev/null 2>&1 And now restart cron: service cron restart