Skip to content

Install rhel6

Introduction

This guide will show you how to perform an Observium installation on an CentOS/RHEL/Scientific Linux (referred to collectively as Enterprise Linux or EL) release 6 system.

Enterprise Linux 7

This guide was written for Enterprise Linux 6. There is another installation guide for Enterprise Linux 7. We strongly recommend running Observium on the most recent release of your chosen distribution.

In this example, we use a clean installation of EL.

Repositories

For more extended packagelist, we first install the RPM Forge and EPEL repositories:

  • x86_64
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
  • i386
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i386.rpm
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

EL release 4 and 5 are explicitly unsupported by Observium due to incompatibilities with their old packages.

Packages

Now let's install the needed packages for Observium:

  • x86_64
yum install wget.x86_64 httpd.x86_64 php.x86_64 php-mysql.x86_64 php-gd.x86_64 php-posix.x86_64 \
    php-mcrypt.x86_64 php-pear.noarch vixie-cron.x86_64 net-snmp.x86_64 net-snmp-utils.x86_64 fping.x86_64 \
    mysql-server.x86_64 mysql.x86_64 MySQL-python.x86_64 rrdtool.x86_64 subversion.x86_64 jwhois.x86_64 \
    ipmitool.x86_64 graphviz.x86_64 ImageMagick.x86_64
  • i386
yum install wget httpd php php-mysql php-gd php-posix php-mcrypt php-pear php-pear.noarch \
    vixie-cron net-snmp net-snmp-utils fping mysql-server mysql MySQL-python rrdtool subversion \
    jwhois ipmitool graphviz ImageMagick

If you want to be able to monitor libvirt virtual machines, install libvirt:

yum install libvirt

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 6 month 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 Edition

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

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. Most other settings can be left as default.

MySQL Database

Create the MySQL database:

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 '<observium db password>';

Disable strict mode

MySQL STRICT mode

Before proceeding of further actions, make sure that you have not enabled STRICT mode in MySQL server (in MySQL 5.7 it enabled by default).

Skip this step for latest Pro editions (since revision 7766)

Since revision 7766 (version 0.16.4.7766) notes about STRICT sql mode not relevant.

Check if STRICT_TRANS_TABLES not exist in MySQL modes list:

mysql> SELECT @@GLOBAL.sql_mode;
+--------------------------------------------+
| @@GLOBAL.sql_mode                          |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+

If you see STRICT_TRANS_TABLES in modes list, make the following changes in the "my.ini/my.cnf":

  • Look for the following line:
    sql-mode = "STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
    
  • Change it to (blank):
    sql-mode=""
    
  • Restart the MySQL service.

For more details on Strict SQL Mode you may refer - http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-strict

Setup the MySQL database and insert the default schema:

./discovery.php -u

Old Observium editions

If your current edition does not support -u argument, than this is time to upgrade your install. But still, you can use the old way of DB schema install/update: php ./includes/update/update.php

It is OK to have some errors in the SQL revisions

Enterprise Linux Specifics

Explaining SELinux and how to make Observium work within it is beyond the scope of this guide, so we will disable it. If you are competent enough to maintain SELinux, then that is possible too, but is an even more unsupported configuration than RHEL/CentOS themselves.

Firstly, disable SELinux. You can do this temporarily with the following command:

setenforce 0

We need to disable SELinux permanently, so you also need to change /etc/selinux/config so that the SELINUX option is set to permissive

 SELINUX=permissive

Add an entry for fping to config.php as the location is different on RHEL:

$config['fping'] = "/usr/sbin/fping";

System

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 rrd directory to store RRDs in:

 mkdir rrd
 chown apache:apache rrd

If the server will be running only Observium, change /etc/httpd/conf/httpd.conf default to :

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

Create logs directory for apache

mkdir /opt/observium/logs
chown apache:apache /opt/observium/logs

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

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

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

Cron

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.

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

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

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

# Run housekeeping script daily for syslog, eventlog and alert log
13 5 * * * root /opt/observium/housekeeping.php -ysel

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

And reload the cron process:

/etc/init.d/cron reload

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.

Final Points

You should now be able to see http://

If everything works, let's set the httpd and mysqld to startup when we reboot the server:

chkconfig mysqld on
chkconfig httpd on

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.

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/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 or IRC.