Observium Professional edition installation on Debian Wheezy

We are going to be installing the Professional edition of Observium, not the Community edition.

I’m starting with a fresh install of Debian Wheezy using the Netinstall iso.  I only install SSH and the standard system utilities.

Much of this comes directly from the Observium installation guide.

Login with SSH. Get root.

Install the packages we need to run Observium:

apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp php-pear \
snmp graphviz php5-mcrypt php5-json subversion mysql-server mysql-client rrdtool \
fping imagemagick whois mtr-tiny nmap ipmitool python-mysqldb

During installation of mysql you will be prompted to enter a password for the root mysql account. You’ll need this later.

Create a directory for Observium to live in:

mkdir -p /opt/observium && cd /opt

If you don’t already have your subversion credentials go ahead and create them now.

root@observium:/opt# htpasswd -nbs username password

Subscribe and then email your credentials to Adam. You want to send the username and SHA line, not the actual password. To ensure that your access is processed quickly, please provide enough information for us to be able to locate your PayPal payment. Usually the email address and name of the payer is sufficient. This is a manual process so it may take between a day or two.

svn co http://svn.observium.org/svn/observium/trunk observium

It’s going to ask for the username and password that you sent to Adam here. Just hit return for the root password and it will ask for username.

root@observium:/opt# svn co http://svn.observium.org/svn/observium/trunk observium
Authentication realm: <http://svn.observium.org:80> Subversion Repository
Password for 'root':
Authentication realm: <http://svn.observium.org:80> Subversion Repository
Username: username
Password for 'username':
ATTENTION!  Your password for authentication realm:
   <http://svn.observium.org:80> Subversion Repository
can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
Store password unencrypted (yes/no)? no

And then installation continues.

Checked out revision 5903.

Make the default config

cd observium
cp config.php.default config.php

Set up the mysql database 

root@observium:/opt/observium# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.5.40-0+wheezy1 (Debian)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE DATABASE observium;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

Edit the config file and update the mysql username and password.

// Database config
$config['db_host'] = 'localhost';
$config['db_user'] = 'observium';
$config['db_pass'] = 'password';
$config['db_name'] = 'observium';

Setup the MySQL database and insert the default schema:

root@observium:/opt/observium# php includes/update/update.php
-- Updating database/file schema
-- Done

Lets move the logs to the standard location.

mkdir -p /var/log/observium

Edit the config file and add the line:

$config['log_dir']       = "/var/log/observium/";

Create the directory to store RRDs in:

mkdir rrd
chown www-data:www-data rrd

Time to set up apache.

root@observium:/opt/observium# cd /etc/apache2/
root@observium:/etc/apache2# rm sites-enabled/000-default 
root@observium:/etc/apache2/# pico sites-enabled/observium

Paste this in there

<VirtualHost *:80>
       ServerAdmin webmaster@localhost
       DocumentRoot /opt/observium/html
       <Directory />
               Options FollowSymLinks
               AllowOverride None
       <Directory /opt/observium/html/>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
       ErrorLog  ${APACHE_LOG_DIR}/error.log
       LogLevel warn
       CustomLog  ${APACHE_LOG_DIR}/access.log combined
       ServerSignature On

Enable mod_rewrite for Observium’s cleaner URLs:

a2enmod rewrite
apache2ctl restart

Add the first user:

root@observium:/etc/apache2/sites-enabled# cd /opt/observium/
root@observium:/opt/observium# ./adduser.php admin password 10
User admin added successfully.

Set up cron

pico /etc/cron.d/observium

Paste this in the file:

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 1 >> /dev/null 2>&1

Add a first device to monitor:

./add_device.php <hostname> <community> v2c

Do an initial discovery and polling run to populate the data for the new device:

./discovery.php -h all
./poller.php -h all

You should now be able to see http://<server ip>

Leave a Reply

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