Skip to content

Debian/Ubuntu Installation

Compatible Distributions

This guide is compatible with the following distributions. We recommend using the most recent to avoid compatibility issues.

  • Ubuntu 18.04, 20.04, 22.04
  • Debian 9, 10, 11, 12

Automated Installation

Observium has an automated install script for use on Ubuntu and Debian systems.

Using the automated installation script is as easy as downloading it, running it and answering a few simple questions, start with:

wget http://www.observium.org/observium_installscript.sh
chmod +x observium_installscript.sh
./observium_installscript.sh

You may need to install wget on bare installations

apt install wget

Manual Installation

If you'd prefer to do a manual installation, you can follow the manual install guide below.

Install Dependencies

Install the packages we need to run Observium:

Distribution Versions

We strongly recommend using the latest version of your distribution.

On Debian 12 we install PHP 8.2

apt install libapache2-mod-php8.2 php8.2-cli php8.2-mysql php8.2-gd  php8.2-bcmath php8.2-mbstring \
php8.2-opcache php8.2-apcu php8.2-curl php-json php-pear snmp fping mariadb-server \
mariadb-client python3-mysqldb  python-is-python3 python3-pymysql rrdtool subversion whois mtr-tiny \
ipmitool graphviz imagemagick apache2

On Ubuntu 22.04 we install PHP8.1

apt install libapache2-mod-php8.1 php8.1-cli php8.1-mysql php8.1-gd php8.1-bcmath php8.1-mbstring \
php8.1-opcache php8.1-curl php-apcu php-pear snmp fping mysql-server mysql-client rrdtool subversion \
whois mtr-tiny ipmitool graphviz imagemagick apache2 python3-mysqldb python3-pymysql python-is-python3

On Debian 11 we install PHP 7.4

apt install libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-gd php7.4-json php7.4-bcmath \
php7.4-mbstring php7.4-opcache php7.4-apcu php7.4-curl php-pear snmp fping rrdtool whois \
mariadb-server mariadb-client subversion mtr-tiny ipmitool graphviz imagemagick apache2 \
python3-mysqldb python3-pymysql python-is-python3

On Debian 10 we install PHP 7.3

apt install libapache2-mod-php7.3 php7.3-cli php7.3-mysql php7.3-gd php7.3-json php7.3-bcmath \
php7.3-mbstring php7.3-opcache php7.3-apcu php7.3-curl php-pear snmp fping rrdtool whois \
mariadb-server mariadb-client subversion mtr-tiny ipmitool graphviz imagemagick apache2 python-mysqldb

On Ubuntu 22.04 we install PHP 7.4

apt install libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-gd php7.4-json php7.4-bcmath \
php7.4-mbstring php7.4-opcache php7.4-curl php-apcu php-pear snmp fping rrdtool whois \
mysql-server mysql-client subversion mtr-tiny ipmitool graphviz imagemagick apache2 \
python3-mysqldb python3-pymysql python-is-python3

On Ubuntu 18.04 we install PHP 7.2

Enable the universe and multiverse repositories first

apt-add-repository universe
apt-add-repository multiverse
apt-get install libapache2-mod-php7.2 php7.2-cli php7.2-mysql php7.2-gd php7.2-json php7.2-bcmath \
php7.2-mbstring php7.2-opcache php7.2-curl php-apcu php-pear snmp fping rrdtool whois \
mysql-server mysql-client subversion mtr-tiny ipmitool graphviz imagemagick apache2 python-mysqldb

Below minimum requirements

Debian 9 ships with a PHP release that is no longer supported by Observium.

On Debian 9 we install PHP 7.0. This is now below the minimum requirements for Observium.

apt-get install libapache2-mod-php7.0 php7.0-cli php7.0-mysql php7.0-gd php7.0-libsodium php7.0-mcrypt php7.0-json php7.0-bcmath \
php7.0-mbstring php7.0-opcache php7.0-apcu php7.0-curl php-pear snmp fping rrdtool whois \
mariadb-server mariadb-client subversion mtr-tiny ipmitool graphviz imagemagick apache2 python-mysqldb

Below minimum requirements

Ubuntu 16.04 and Debian 8 ship with a PHP release that is no longer supported by Observium.

On Ubuntu 16.04 and Debian 8 we install PHP 7.0. This is now below the minimum requirements for Observium.

apt-get install libapache2-mod-php7.0 php7.0-cli php7.0-mysql php7.0-gd php7.0-mcrypt php7.0-json php7.0-bcmath \
php7.0-mbstring php7.0-curl php-apcu php-pear snmp fping rrdtool whois \
mysql-server mysql-client subversion mtr-tiny ipmitool graphviz imagemagick apache2 python-mysqldb

Virtual Machines

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

```apt-get install libvirt-bin```

```apt install libvirt-clients```

Download Observium

First, create a directory for Observium to live in:

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

Observium Editions

Observium comes in two editions, an Open Source Community Edition released on a biannual cycle, and a Subscription Edition with additional features, rapid bug fixes and feature improvements on a daily basis and an easy to use SVN-based update mechanism.

Observium Community Edition

If you would like to install the Community Edition, please install using the most recent .tar.gz release.

Download the latest .tar.gz of Observium and unpack:

wget http://www.observium.org/observium-community-latest.tar.gz
tar zxvf observium-community-latest.tar.gz

Observium Subscription Editions

If you have a valid Observium subscription, please use one of the automated SVN release repositories.

We recommend the stable train for people who intend to use automated updates to keep their Observium installation up to date.

For the current train:

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

For the stable train:

svn co https://svn.observium.org/svn/observium/branches/stable observium

Configuration

Change into the new install directory:

cd observium

Create the MySQL database and user

You will see the MySQL version upon logging on to the MySQL monitor with mysql -u root -p.

MySQL Credentials

Here you'll set the username and password for Observium to access the database. The username is observium and the password will be the text you insert in place of .

mysql -u root -p
<mysql root password>
mysql> CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE USER 'observium'@'localhost' identified by '<db password>';
mysql> GRANT ALL ON observium.* TO 'observium'@'localhost';
mysql -u root -p
<mysql root password>
mysql> CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY '<db password>';

Configuration

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

cp config.php.default config.php

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

MySQL Credentials

You must change the MySQL username and password using the settings from the previous step. Most other settings can be left as default.

Setup the MySQL database and insert the default schema:

./discovery.php -u

It is OK to have some errors in the SQL revisions

Create required directories

Create the directory Observium will store its logs in:

mkdir logs

Alternatively you can create a directory somewhere else and point the log_dir directive in the configuration to that directory.

Create the directory to store RRDs in:

mkdir rrd
chown www-data:www-data rrd

Apache Configuration

Ubuntu newer than 14.04 and newer versions of Debian use Apache 2.4. You can check your version of Apache with the following command:

dpkg -l apache2

If you're using Apache 2.4 (Ubuntu 14.04 or newer Debian), you need to use this alternative format :

The required file is now /etc/apache2/sites-available/000-default.conf on some installations, such as Ubuntu 16.04.

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /opt/observium/html
    <FilesMatch \.php$>
      SetHandler application/x-httpd-php
    </FilesMatch>
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /opt/observium/html/>
            DirectoryIndex index.php
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Require all granted
    </Directory>
    ErrorLog  ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    CustomLog  ${APACHE_LOG_DIR}/access.log combined
    ServerSignature On
</VirtualHost>

If you're using Apache 2.2 the server will be running only Observium, change /etc/apache2/sites-available/default to :

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /opt/observium/html
    <FilesMatch \.php$>
      SetHandler application/x-httpd-php
    </FilesMatch>
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /opt/observium/html/>
            DirectoryIndex index.php
            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>

Non-dedicated server with virtual host

Alternatively you can create a vhost just for Observium (see the bottom of the page)

Enable php mcrypt module if it's installed (ignore if it isn't):

phpenmod mcrypt

On newer distros (Ubuntu 16.04 and above), enable PHP and switch to mpm_prefork. The php version will match that installed at the top of the guide.

a2dismod mpm_event
a2enmod mpm_prefork
a2enmod php7.0

Enable mod_rewrite for Observium's URLs:

a2enmod rewrite
apache2ctl restart

Add Initial User and Device

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

./adduser.php <username> <password> <level>

Add a first device to monitor:

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

Perform Initial Discovery and Poll

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:

Cron Usage

The below example includes a username, so will only work in /etc/crontab or /etc/cron.d/observium. It will NOT work in a user crontab edited with crontab -e without removing the username.

Polling Interval

Observium operates on a fixed poller frequency of 5 minutes or 300 seconds. The poller-wrapper process must be run at this frequency will NOT work otherwise.

# Run a complete discovery of all devices once every 6 hours
33  */6   * * *   root    /opt/observium/observium-wrapper discovery >> /dev/null 2>&1

# Run automated discovery of newly added devices every 5 minutes
*/5 *     * * *   root    /opt/observium/observium-wrapper discovery --host new >> /dev/null 2>&1

# Run multithreaded poller wrapper every 5 minutes
*/5 *     * * *   root    /opt/observium/observium-wrapper poller >> /dev/null 2>&1

# Run housekeeping script daily for syslog, eventlog and alert log
13 5 * * * root /opt/observium/housekeeping.php -ysel >> /dev/null 2>&1

# Run housekeeping script daily for rrds, ports, orphaned entries in the database and performance data
47 4 * * * root /opt/observium/housekeeping.php -yrptb >> /dev/null 2>&1

Poller Performance

Please note running four poller instances 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 browser to your server's IP address or hostname and access the Observium web interface.

Updating

Updating Observium has been designed to be as quick and painless as possible. Using our SVN delivery mechanism, it can even be automated. Because we have a rapid development and model, we recommend that you update frequently, at least once per month, though once or twice per week is better and many users update daily via an automated CRON job.

See Updating the Subscription Edition for a short explanation on how to update the Subscription Edition of Observium.

Apache Virtual Host

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

If you're using Debian, due to the decision of Debian to no longer ship SNMP MIBs with the distribution, you need to direct the snmp utilities to use Observium's MIBs in order to suppress some annoying error output.

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

mibs :

Replace it with this :

mibs : /opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp

This is one of the many self-imposed Debian issues that make Ubuntu generally a better choice for overall maintainability.

Problems

When running poller.php or discovery.php you may see 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 make sure you've followed the install guide closely, check the FAQs, then join our IRC channel or Mailing Lists and ask for help.