Ubuntu SVN Installation

From Observium

Jump to: navigation, search

Contents

Installation

For this example I'm using a clean Ubuntu 10.04 installation. It should work almost identically on a more recent Ubuntu release or Debian >5.0.

Install the packages we need to run Observium:

aptitude install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp \
php-pear snmp graphviz subversion mysql-server mysql-client rrdtool \
fping imagemagick whois mtr-tiny nmap ipmitool

Install the IPv4 and IPv6 pear libraries:

pear install Net_IPv6
pear install Net_IPv4

You may need to install the development version of the IPv6 library(Net_IPv6-devel) if it doesn't work properly on older installs.

If you want to be able to monitor libvirt virtual machines, install libvirt-bin (beware: this pulls in a whole bunch of dependencies you otherwise probably wouldn't need on your server):

apt-get install libvirt-bin

Create a directory for Observium to live in:

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

Check out the latest version of Observium from the Subversion repository:

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

Change into the new install directory:

cd observium

Copy the default configuration file and edit it for your system:

cp config.php.default config.php

Create the MySQL database:

mysql -u root -p
<mysql root password>
mysql> CREATE DATABASE observium;
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost'
    -> IDENTIFIED BY '<observium db password>';

Edit config.php. Change the options to reflect your installation.

Setup the MySQL database and insert the default schema:

php includes/sql-schema/update.php

It is OK to have some errors in the SQL revisions up to 006.

Create a couple of directories we use to store data in, change their ownership so that the apache process can write to them:

mkdir graphs rrd
chown www-data.www-data graphs rrd

If the server will be running *only* Observium, change /etc/apache2/sites-available/default to :

<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 (see the bottom of the page)

Enable mod_rewrite for Observium's cleaner URLs:

a2enmod rewrite
apache2ctl restart

Add a first user, use level of 10 for admin:

cd /opt/observium
./adduser.php <username> <password> <level>

Add a first device to monitor:

./addhost.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

Add cron jobs, create a new file /etc/cron.d/observium with the following contents:

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.php -h all >> /dev/null 2>&1

Please note running only a single poller instance is good for initial testing, but do check the Performance tuning page for further performance enhancing options once you get going.

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

Updating

See Using SVN for a short explanation on how to update Observium using SVN.

Optional

If you want to create a proper virtual host, something like this:

<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>

You'll need to create an /opt/observium/logs directory with permissions so that Apache can write to it.

Debian > 6.0 and Ubuntu > 11.04

If you're using Debian Squeeze (6.0), due to the decision of Debian not to ship SNMP MIBs with the distribution anymore (in keeping with the free licensing idea), you either have to enabe the non-free repository and install the snmp-mibs-downloader package and having it download the MIBs from the internet, or, you can make the snmp utilities use the MIBs delivered with Observium:

Remove this line in /etc/snmp/snmp.conf:

mibs :

and add the following line:

mibdirs /opt/observium/mibs

Problems

When running eg. poller.php or discovery.php a lot of notices regarding undefined indexes, variables and offsets. To hide these notices you can do the following:

nano /etc/php5/cli/php.ini

Find the line containing:

error_reporting = E_ALL & ~E_DEPRECATED

Change this to:

error_reporting = E_ALL & ~E_NOTICE

If there are problems with this installation tutorial, please ask on the Mailing Lists.