How to manage and monitor network using Observium in Linux

To manage and monitor network using Observium in Linux

Observium is a Monitoring application. It provides a PHP/MySQL driven Network Observation,which supports a wide range of operating systems/hardware platforms such as Linux, Windows, FreeBSD and Cisco. It aims to supplement other network monitoring projects such as Nagios or Cacti. It gives a robust and simple web interface to monitor the performance of your network. Installation and configuration is explained in this article.

 

Versions 

 

 Community  free version
 Professional  paid version

 

To Add RPM Forge and EPEL Repositories

RPMForge and EPEL is a repository which provides many software packages for RHEL and CentOS.

 

For i386 Systems

# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# wget http://apt.sw.be/RPM-GPG-KEY.dag.txt
# rpm --import RPM-GPG-KEY.dag.txt
# rpm -Uvh rpmforge-release-0.5.3-1.el5.rf.i386.rpm
# rpm -Uvh epel-release-6-8.noarch.rpm

 

For x86_64 Systems

Download the rpm package and the GPG key.

[root@linuxhelp1 ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5
--2016-06-09 14:15:16--  http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
Resolving apt.sw.be... 193.1.193.67
Connecting to apt.sw.be|193.1.193.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12640 (12K) [application/x-redhat-package-manager]
Saving to: “rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm”

100%[===================================================================================================>] 12,640      --.-K/s   in 0.01s   

2016-06-09 14:15:17 (982 KB/s) - “rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm” saved [12640/12640]
[root@linuxhelp1 ~]# wget http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm
--2016-06-09 14:16:06--  http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm
Resolving epel.mirror.net.in... 103.195.68.253, 103.240.105.131
Connecting to epel.mirror.net.in|103.195.68.253|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-redhat-package-manager]
Saving to: “epel-release-6-8.noarch.rpm.1”

100%[===================================================================================================>] 14,540      --.-K/s   in 0.04s   

2016-06-09 14:16:07 (344 KB/s) - “epel-release-6-8.noarch.rpm.1” saved [14540/14540]

 

[root@linuxhelp1 ~]# wget  http://apt.sw.be/RPM-GPG-KEY.dag.txt
--2016-06-09 14:16:26--  http://apt.sw.be/RPM-GPG-KEY.dag.txt
Resolving apt.sw.be... 193.1.193.67
Connecting to apt.sw.be|193.1.193.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1672 (1.6K) [text/plain]
Saving to: “RPM-GPG-KEY.dag.txt”

100%[===================================================================================================>] 1,672       --.-K/s   in 0s      

2016-06-09 14:16:27 (136 MB/s) - “RPM-GPG-KEY.dag.txt” saved [1672/1672]

 

Now import the GPG keys and install the rpm packages.

[root@linuxhelp1 ~]# rpm --import RPM-GPG-KEY.dag.txt
[root@linuxhelp1 ~]# rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:rpmforge-release       ########################################### [100%]
[root@linuxhelp1 ~]# rpm -Uvh epel-release-6-8.noarch.rpm.1 
warning: epel-release-6-8.noarch.rpm.1: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]

 

To Install Software Packages

Install the required software packages by running the following command.

[root@linuxhelp1 ~]# yum install httpd php php-mysql php-gd php-snmp vixie-cron php-mcrypt php-pear net-snmp net-snmp-utils graphviz subversion mysql-server mysql rrdtool fping ImageMagick jwhois nmap ipmitool php-pear.noarch MySQL-python -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
 * extras: centos.excellmedia.net
 * rpmforge: mirror.oscc.org.my
 * updates: centos.excellmedia.net
Package httpd-2.2.15-53.el6.centos.x86_64 already installed and latest version
Package cronie-1.4.4-15.el6_7.1.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package ImageMagick.x86_64 0:6.7.2.7-4.el6_7 will be installed
--> Processing Dependency: libwmflite-0.2.so.7()(64bit) for package: ImageMagick-6.7.2.7-4.el6_7.x86_64
--> Processing Dependency: libwmf-0.2.so.7()(64bit) for package: ImageMagick-6.7.2.7-4.el6_7.x86_64
--> Processing Dependency: libImath.so.6()(64bit) for package: ImageMagick-6.7.2.7-4.el6_7.x86_64
.
.
.
Dependency Installed:
  OpenEXR-libs.x86_64 0:1.6.1-8.1.el6       dejavu-lgc-sans-mono-fonts.noarch 0:2.33-1.el6       gd.x86_64 0:2.0.35-11.el6                  
  ilmbase.x86_64 0:1.0.1-6.1.el6            libXaw.x86_64 0:1.0.11-2.el6                         libXpm.x86_64 0:3.5.10-2.el6               
  libmcrypt.x86_64 0:2.5.8-9.el6            libwmf.x86_64 0:0.2.8.4-25.el6_7                     libwmf-lite.x86_64 0:0.2.8.4-25.el6_7      
  perl-DBD-MySQL.x86_64 0:4.013-3.el6       perl-DBI.x86_64 0:1.609-4.el6                        perl-URI.noarch 0:1.40-2.el6               
  php-cli.x86_64 0:5.3.3-47.el6             php-common.x86_64 0:5.3.3-47.el6                     php-pdo.x86_64 0:5.3.3-47.el6              

Complete!

Install "libvirt" package, to monitor virtual machines.

[root@linuxhelp1 ~]# yum install libvirt -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: epel.mirror.net.in
 * extras: centos.excellmedia.net
 * rpmforge: mirror.oscc.org.my
 * updates: centos.excellmedia.net
Resolving Dependencies
--> Running transaction check
---> Package libvirt.x86_64 0:0.10.2-60.el6 will be installed
.
.
.
Installed:
  libvirt.x86_64 0:0.10.2-60.el6                                                                                                             

Dependency Installed:
  ebtables.x86_64 0:2.0.9-6.el6                       glusterfs.x86_64 0:3.7.5-19.el6              glusterfs-api.x86_64 0:3.7.5-19.el6      
  glusterfs-client-xlators.x86_64 0:3.7.5-19.el6      glusterfs-libs.x86_64 0:3.7.5-19.el6         gnutls-utils.x86_64 0:2.8.5-19.el6_7     
  iscsi-initiator-utils.x86_64 0:6.2.0.873-21.el6     libcgroup.x86_64 0:0.40.rc1-17.el6_7         libvirt-client.x86_64 0:0.10.2-60.el6    
  lzop.x86_64 0:1.02-0.9.rc1.el6                      nc.x86_64 0:1.84-24.el6                      netcf-libs.x86_64 0:0.2.4-4.el6          
  numad.x86_64 0:0.5-12.20150602git.el6               qemu-img.x86_64 2:0.12.1.2-2.491.el6_8.1     radvd.x86_64 0:1.6-1.el6                 
  usbredir.x86_64 0:0.5.1-3.el6                       yajl.x86_64 0:1.0.7-3.el6                   

Complete!

 

To Download Observium  

First you have to deploy it under /opt directory and verify that everything works well, then you can install at your desired location.

If you possess an active subscription, use SVN repositories to download latest version. Subscription account is valid only for one installation and two development installations with everyday security patches and bug fixes.

To download latest version , you should have a svn package installed on the machine, in order to get the files from the SVN repository.

 

For Development Version

# svn co http://svn.observium.org/svn/observium/trunk observium

 

For Stable Version

# svn co http://svn.observium.org/svn/observium/branches/stable observium

Download the latest stable version and unpack it as follows,

[root@linuxhelp1 ~]# cd /opt
[root@linuxhelp1 opt]# wget http://www.observium.org/observium-community-latest.tar.gz
--2016-06-09 14:27:44--  http://www.observiuum.org/observium-community-latest.tar.gz
Resolving www.observium.org... 37.59.0.47
Connecting to www.observium.org|37.59.0.47|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 50107759 (48M) [application/x-gzip]
Saving to: “observium-community-latest.tar.gz”

100%[===================================================================================================>] 50,107,759   319K/s   in 4m 24s  

2016-06-09 14:32:10 (185 KB/s) - “observium-community-latest.tar.gz” saved [50107759/50107759]

 

[root@linuxhelp1 opt]# tar zxvf observium-community-latest.tar.gz 
observium/
obser vium/templates/
observium/templates/group/
observium/templates/notification/
observium/templates/alert/
observium/templates/README
.
.
.
obser vium/update/260.php
obser vium/update/184.sql
observium/update/087.sql
observium/update/080.sql

 

To Create MySQL Database

Set a new root password with the help of the following command.

[root@linuxhelp1 opt]# service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h linuxhelp1 password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

[ OK ]
Starting mysqld: [ OK ]

 

[root@linuxhelp1 opt]# /usr/bin/mysqladmin -u root password 'linuxc'

Now login to mysql interface and then create new database.

[root@linuxhelp1 opt]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> CREATE DATABASE observium;
Query OK, 1 row affected (0.00 sec)

mysql>mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY 'linuxc';
Query OK, 0 rows affected (0.00 sec)

mysql>mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql>mysql> exit;
Bye

 

To Configure Observium

Copy the default configuration file "config.php.default" to "config.php" and change the settings as mentioned below.

[root@linuxhelp1 opt]# cd  observium/
[root@linuxhelp1 observium]# cp config.php.default config.php

Open "config.php" file and enter MySQL details like database name, username and password.

[root@linuxhelp1 observium]# vim config.php

$config['db_extension'] = 'mysqli';
$config['db_host']      = 'localhost';
$config['db_user']      = 'observium';
$config['db_pass']      = 'linuxc';
$config['db_name']      = 'observium';
Add an entry for fping binary location to "config.php" and in RHEL distribution the location will be different.

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

Execute the following command for setting up the MySQL database and add the default file schema to the database .

[root@linuxhelp1 observium]# ./discovery.php -u
No log handling enabled - turning on stderr logging
Created directory: /var/lib/net-snmp/mib_indexes

  ___   _                              _
 / _  | |__   ___   ___  _ __ __   __(_) _   _  _ __ ___
| | | || '_  / __| / _ | '__|  / /| || | | || '_ ` _ 
| |_| || |_) |\__ |  __/| |     V / | || |_| || | | | | |
 \___/ |_.__/ |___/ \___||_|     \_/  |_| \__,_||_| |_| |_|
                    Observium Community Edition 0.16.1.7533
                                   http://www.observium.org

Install initial database schema ... done.
-- Updating database/file schema
252 -> 253 ... (db) done.
253 -> 254 ... (db) done.
254 -> 255 ... (db) done.
255 -> 256 ... (php)
256 -> 257 ... (php)
257 -> 258 ... (php)
258 -> 259 ... (db) done.
259 -> 260 ... (php)
260 -> 261 ... (db) done.
261 -> 262 ... (php)
262 -> 263 ... (db) done.
263 -> 264 ... (db) done.
264 -> 265 ... (db) done.
265 -> 266 ... (db) done.
-- Done.

 

To Configure Apache

Create a "rrd" directory under "/opt/observium" path for saving RRD’s and grant Apache ownership to that directory.

[root@linuxhelp1 observium]# mkdir rrd
[root@linuxhelp1 observium]# chown apache:apache rrd

Create a Apache Virtual Host directive for Obervium in ‘/etc/httpd/conf/httpd.conf‘ file.

[root@linuxhelp1 observium]# vim /etc/httpd/conf/httpd.conf

Enable Virtualhost section and add the following Virtual Host directive at the bottom of the file.

  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

Create a "logs" directory for Apache and apply Apache ownership to write logs to maintain logs.

[root@linuxhelp1 observium]# mkdir logs
[root@linuxhelp1 observium]# chown apache:apache /opt/observium/logs/

 

To Create Admin User

Add a first user and give 10 as level for admin and then replace username and password.

[root@linuxhelp1 observium]# ./adduser.php root linuxc 10
Observium CE 0.16.1.7533
Add User
User root added successfully.

Run following command to create the data for new device.

[root@linuxhelp1 observium]# ./discovery.php -h all

  ___   _                              _
 / _  | |__   ___   ___  _ __ __   __(_) _   _  _ __ ___
| | | || '_  / __| / _ | '__|  / /| || | | || '_ ` _ 
| |_| || |_) |\__ |  __/| |     V / | || |_| || | | | | |
 \___/ |_.__/ |___/ \___||_|     \_/  |_| \__,_||_| |_| |_|
                    Observium Community Edition 0.16.1.7533
                                   http://www.observium.org

-- Database is up to date.
#####  Starting discovery run at 2016-06-09 15:05:18  #####

#####  Finished discovery run at 2016-06-09 15:05:19  #####

 o Devices Discovered   0
 o Discovery Time       3.386 secs
 o Memory usage         8.75MB (peak: 8.75MB)
 o MySQL Usage          Cell[27/0.005s] Row[5/0.002s] Rows[6/0.049s] Column[0/0s] Update[4/0.898s] Insert[0/0s] Delete[0/0s] 
 o RRDTool Usage        

 

[root@linuxhelp1 observium]# ./poller.php -h all

  ___   _                              _
 / _  | |__   ___   ___  _ __ __   __(_) _   _  _ __ ___
| | | || '_  / __| / _ | '__|  / /| || | | || '_ ` _ 
| |_| || |_) |\__ |  __/| |     V / | || |_| || | | | | |
 \___/ |_.__/ |___/ \___||_|     \_/  |_| \__,_||_| |_| |_|
                    Observium Community Edition 0.16.1.7533
                                   http://www.observium.org

#####  Starting polling run at 2016-06-09 15:05:33  #####

WARNING: 0 devices polled. Did you specify a device that does not exist?
#####  Completed polling run at 2016-06-09 15:05:33  #####

 o Devices Polled       0
 o Poller Time          0.016 secs
 o Memory usage         8.5MB (peak: 8.5MB)
 o MySQL Usage          Cell[0/0s] Row[5/0.001s] Rows[3/0.012s] Column[0/0s] Update[0/0s] Insert[0/0s] Delete[0/0s] 
 o RRDTool Usage        

Next create a new file and add the following contents to set a cron jobs.

[root@linuxhelp1 observium]# vim /etc/cron.d/observium

55  */3   * * *   root    /opt/observium/discovery.php -h all >> /dev/null 2>&1
*/8 *      * * *   root    /opt/observium/discovery.php -h new >> /dev/null 2>&1
*/8 *      * * *   root    /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1

Reload cron process to bring the new entries.

[root@linuxhelp1 observium]# /etc/init.d/crond reload
Reloading crond:                                           [  OK  ]

The last step is to add httpd and also mysqld services system-wide, to automatically begin after machine boot.

[root@linuxhelp1 observium]# chkconfig mysqld on
[root@linuxhelp1 observium]# chkconfig httpd on

 

Open your browser and then navigate to http://<Ip-Address>

browser

observium
 


Thank you! for using Linux Help.

You find this tutorial helpful? Share with your friends to keep it alive.
For more help topics browse our website www.linuxhelp.com
Be the first to comment, we value your suggestions. For further queries please comment below.

Tags: Monitoring tool
user image Author :  Isaac