, ,

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) box. In this example, we use also a clean installation of EL.
For more extended packagelist, we first install the RPM Forge and EPEL repositories:

Now let’s install the needed packages for Observium:
# yum install httpd php php-mysql php-gd php-snmp vixie-cron php-mcryp php-pear net-snmp net-snmp-utils graphviz subversion mysql-server mysql rrdtool fping ImageMagick jwhois nmap ipmitool php-pear.noarch MySQL-python
On x86_64 systems this will tend to try to install i386 packages too unless you’ve explicitly blocked them, so you can try to install the x86_64 packages only:
# yum install httpd.x86_64 php.x86_64 php-mysql.x86_64 php-gd.x86_64 php-snmp.x86_64 vixie-cron.x86_64 php-mcrypt.x86_64 net-snmp.x86_64 net-snmp-utils.x86_64 graphviz.x86_64 subversion.x86_64 mysql-server.x86_64 mysql.x86_64 rrdtool.x86_64 fping.x86_64 ImageMagick.x86_64 jwhois.x86_64 nmap.x86_64 ipmitool.x86_64 php-pear.noarch MySQL-python.x86_64
Press y to confirm installation.
Install PEAR:
# pear install Net_IPv6 # pear install Net_IPv4
# mkdir /opt/observium # cd /opt # wget http://www.observium.org/observium-community-latest.tar.gz # tar zxvf observium-community-latest.tar.gz
Change into the new install directory:
# cd observium
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>’; exit;
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
# vi /etc/selinux/config SELINUX=permissive
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.
// Database config $config[‘db_host’] = “localhost”; $config[‘db_user’] = “observium”; $config[‘db_pass’] = “<observium db password>”; $config[‘db_name’] = “observium”;
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 :
# vi /etc/httpd/conf/httpd.conf  <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 # /etc/init.d/httpd 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. You need to add related hostname in your DNS or /etc/hosts file.
# vi /etc/hosts  server0X.bdnog.org [replace x with group no]
# ./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
Add cron jobs, create a new file /etc/cron.d/observium with the following contents:
3  */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
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
Error 1: Could not ping <hostname>
Solution: Check fping location at /opt/observium/includes/defaults.inc.php file.
# whereis fping # ln -s /usr/sbin/fping /usr/bin/fping
Error 2:  PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/module.so’
Solution: Edit /etc/php.d/mcrypt.ini
 ; Enable mcrypt extension module extension=module.so
 ; Enable mcrypt extension module extension=mcrypt.so