This guide whill show you how to perform an Observium installation on an
CentOS/RHEL/Scientific Linux (referred to collectively as Enterprise
Linux or 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.2-2.el6.rf.x86_64.rpm
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.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.2-2.el6.rf.i386.rpm
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Downloading
Firstly switch to the /opt directly, where we will install Observium
as default. If you wish to install elsewhere, please modify the commands
and configuration accordingly. We recommend you first install to /opt
and then install elsewhere after you've verified everything works.
cd /opt
Observium Editions
Observium comes in two editions, an Community/Open Source edition,
and a Subscription edition with additional features, rapid feature/fix
release cycle and easy to use SVN-based release mechanism.
Observium Open Source Edition
If you would like to try out Observium using the Community/Open
Source 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
If you have a valid Observium
subscription, please use one of the automated SVN release repositories.
For the CURRENT revision:
svn co
http://svn.observium.org/svn/observium/trunk observium
For the STABLE revision:
svn co
http://svn.observium.org/svn/observium/branches/stable observium
Configuration
Change into the new install directory:
cd observium
Database
Now we are going to install the mysql database. Because we have a
clean install, we need to configure a root password to the mysqld:
service mysqld start
/usr/bin/mysqladmin -u root password 'yournrewrootpassword'
Now enter mysql to create the new Observium 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>';
Note: Make sure your MySQL server is
not operating in strict mode; this is not supported by Observium and
will break your setup.
Configuration
Important!
Please read all the documentation before continuing. This includes the
FAQ page.
If you're not satisfied with what you find, do
not continue installation. "Clever tricks" that "fix" what is "broken" are not supported.
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
Copy the default configuration file and edit it for your system:
cp config.php.default config.php
Add an entry for fping to config.php as the location is different on RHEL:
$config['fping'] = "/usr/sbin/fping";
Edit config.php. Change the options to reflect your installation.
Setup the MySQL database and insert the default schema:
php includes/update/update.php
It is OK to have some errors in the SQL revisions up to 006.
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:
Important!
Please note that the below example includes a username, so will only
work in /etc/crontab or /etc/cron.d/. It will NOT work in a user crontab
edited with crontab -e.
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
And reload the cron process:
/etc/init.d/cron reload
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.
Final Points
You should now be able to see
http://<server ip>
If everything works, let's set the httpd and mysqld to startup when we reboot the server:
chkconfig mysqld on
chkconfig httpd on