RHEL SVN Installation

From Observium

(Redirected from CentOS SVN Installation)
Jump to: navigation, search


FileHazard.png This page contains unofficial documentation
Please note that this is unofficial documentation for an unsupported configuration. Please follow with care.

Contents

Introduction

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.

Repositories

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

EL Release 6

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-5.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-5.noarch.rpm

EL Release 5

x86_64

rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -Uvh http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

i386

rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -Uvh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

EL Release 4

EL release 4 variants are now End-of-life and are explicitly unsupported by Observium. Please do not use them.

Packages

Now let's install the needed packages for Observium:

  yum install httpd php php-mysql php-gd php-snmp vixie-cron \
  php-pear net-snmp net-snmp-utils graphviz subversion mysql-server mysql rrdtool \
  fping ImageMagick jwhois nmap OpenIPMI-tools

Install the IPv4 and IPv6 pear libraries:

  pear install Net_IPv6
  pear install Net_IPv4

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

yum install libvirt

Observium

Download

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

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

Configuration

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/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 apache.apache graphs 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:

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

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.

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

Updating

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

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.