Back to the main page

Installing Observium on Oracle Linux 6

Observium observes a network, collects data from devices using SNMP, uses rrdtool and creates huge amount of graphs. Here is how to install it on OL6, the install process is following info from Observium official site.  
Install rpmforge-release-0.5.3-1.el6.rf.x86_64 to get rpmforge.repo and install needed packages.  
yum install wget.x86_64 httpd.x86_64 php.x86_64 php-mysql.x86_64 php-gd.x86_64 php-snmp.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
Get Observium community/opensource edition, and untar in /opt/
cd /opt/
tar -zxvf observium-community-latest.tar.gz
 Start mysql and setup root password 
chkconfig --level 235 mysqld on
service mysqld start
/usr/bin/mysqladmin -u root password mypassword
 Create observium database, grant permissions to observium user and create tables 
mysql> CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)

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

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| observium          |
| test               |
+--------------------+

mysql> select host, user, password from mysql.user;
+------------------------------+-----------+-------------------------------------------+
| host                         | user      | password                                  |
+------------------------------+-----------+-------------------------------------------+
| localhost                    | root      | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| localhost                    | observium | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
+------------------------------+-----------+-------------------------------------------+
mysql> exit
 Insert the default schema, which creates all tables 
{host}:/  php includes/update/update.php 

-- Updating database/file schema
000 -> 001 ... (db) done.
.. truncated
072 -> 073 ... (db) done.
073 -> 074 ... (file)Updating netscaler service RRDs
074 -> 075 ... (db) done.
truncated
093 -> 094 ... (db) done.
094 -> 095 ... (file) Converting alert serialize() arrays to JSON:
truncated
126 -> 127 ... (file) Converting FDB count RRD ds fdb->value:
127 -> 128 ... (file) Rename old storage RRDs and DB:
128 -> 129 ... (file) Rename old mempools RRDs and DB:
truncated
137 -> 138 ... (db) done (3 errors).
truncated
163 -> 164 ... (file) Superseded by update 165
164 -> 165 ... (file) Adding MIN RRA to very old RRD files:
  * hr_processes:
  * hr_users:
  * ucd_contexts:
  * ucd_load:
  * ucd_interrupts:
165 -> 166 ... (db) done.
166 -> 167 ... (db) done.
-- Done

mysql> use observium;
Database changed

mysql> show tables;
+-----------------------------+
| Tables_in_observium         |
+-----------------------------+
| accesspoints                |
| accesspoints-state          |
| alert_assoc                 |
| alert_contacts              |
| alert_contacts_assoc        |
| alert_log                   |
| alert_table                 |
| alert_table-state           |
| alert_tests                 |
| alerts                      |
| applications                |
| applications-state          |
| authlog                     |
| bgpPeers                    |
| bgpPeers-state              |
| bgpPeers_cbgp               |
| bgpPeers_cbgp-state         |
| bill_data                   |
| bill_history                |
| bill_ports                  |
| bills                       |
| cef_prefix                  |
| cef_switching               |
| config                      |
| customers                   |
| dbSchema                    |
| device_graphs               |
| devices                     |
| devices_attribs             |
| devices_mibs                |
| devices_perftimes           |
| eigrp_ports                 |
| entPhysical                 |
| entPhysical-state           |
| entity_permissions          |
| eventlog                    |
| graph_types                 |
| graph_types_dead            |
| group_table                 |
| groups                      |
| groups_assoc                |
| hrDevice                    |
| ip_mac                      |
| ipsec_tunnels               |
| ipv4_addresses              |
| ipv4_networks               |
| ipv6_addresses              |
| ipv6_networks               |
| juniAtmVp                   |
| links                       |
| loadbalancer_rservers       |
| loadbalancer_vservers       |
| mac_accounting              |
| mac_accounting-state        |
| mempools                    |
| mempools-state              |
| munin_plugins               |
| munin_plugins_ds            |
| netscaler_services          |
| netscaler_services_vservers |
| netscaler_vservers          |
| ospf_areas                  |
| ospf_instances              |
| ospf_nbrs                   |
| ospf_ports                  |
| packages                    |
| perf_times                  |
| ports                       |
| ports-state                 |
| ports_adsl                  |
| ports_cbqos                 |
| ports_stack                 |
| ports_vlans                 |
| processors                  |
| processors-state            |
| pseudowires                 |
| sensors                     |
| sensors-state               |
| services                    |
| slas                        |
| storage                     |
| storage-state               |
| syslog                      |
| toner                       |
| ucd_diskio                  |
| ucd_diskio-state            |
| users                       |
| users_ckeys                 |
| users_prefs                 |
| vlans                       |
| vlans_fdb                   |
| vminfo                      |
| vrfs                        |
| wifi_accesspoints           |
| wifi_radios                 |
| wifi_sessions               |
+-----------------------------+
Disable SELinux to avoind not supported problems, here we verify selinux is already in permissive mode
{host}:/  cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
Create PHP config file 
cp -p config.php.default config.php
And have lines like these 
// Database config
$config['db_host'] = 'localhost';
$config['db_user'] = 'observium';
$config['db_pass'] = 'mypassword';
$config['db_name'] = 'observium';
$config['fping'] = "/usr/sbin/fping";
 Create directories for logs and rrd 
cd /opt/observium
mkdir logs rrd
chown apache:apache rrd
chown apache:apache logs
 The server will run only Observium so have this in /etc/httpd/conf/httpd.conf 
<VirtualHost *:80>
  DocumentRoot /opt/observium/html/
  ServerName  my-hostname.mydomain.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>
 Add first Observium user, admin level is 10 
cd /opt/observium
 ./adduser.php zdudic zdpasswd 10 
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/module.so'
- /usr/lib64/php/modules/module.so: cannot open shared object file: No such file or directory in Unknown on line 0
Fix is to replace module.so with mcrypt.so in the file /etc/php.d/mcrypt.ini and try again. 
# ./ adduser.php zdudic zdpasswd 10 
Observium CE 0.14.11.6000
Add User
User zdudic added successfully.
User is added. New users can be added via web interface, very simple and nice to use. Now add an ethernet switch. 
./add_device.php <hostname> <community> v1 
Observium CE 0.14.11.6000
Add Device(s)

Try to add belmont-5-swi-4:
Trying v1 community public ...
Now discovering belmont-5-swi-4 (id = 1)
belmont-5-swi-4 1 ios  (cisco)
Ports :  Vl1(1)[1] StackPort1(5137)[2] StackSub-St1-1(5138)[3] StackSub-St1-2(5139)[4] Gi1/0/1(10101) .. shortened ..Te1/0/1(10201)[55] Te1/0/2(10202)[56] Nu0(12001)[57] Fa0(12002)[58]
Module [ ports ] time: 0.8106s
Discovered in 0.810 seconds

belmont-5-swi-4 1 ios  (cisco)
IPv4 Addresses : N+
Module [ ipv4-addresses ] time: 0.0902s
Discovered in 0.090 seconds

belmont-5-swi-4 1 ios  (cisco)
IPv6 Addresses :
Module [ ipv6-addresses ] time: 1.4242s
Discovered in 1.424 seconds
Added device belmont-5-swi-4 (1).
Devices added: 1.
 New switch can be added via web interface, very simple and nice to use. 
Do an initial discovery and polling run to populate the data for the new device.
./ discovery.php -h all 
Observium CE 0.14.11.6000
Discovery

belmont-swi-4 1 ios  (cisco)
Module [ os ] time: 0.0287s
Ports : ...............................
Module [ ports ] time: 0.6398s
Port Stacks: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Module [ ports-stack ] time: 0.6492s
Processors :  CISCO-ENTITY-QFP-MIB  CISCO-PROCESS-MIB + hrDevice:
Module [ processors ] time: 0.1828s
Memory :  CISCO-ENTITY-QFP-MIB  CISCO-ENHANCED-MEMPOOL-MIB  CISCO-MEMORY-POOL-MIB +++ HOST-RESOURCES-MIB
Module [ mempools ] time: 0.2051s
IPv4 Addresses : .
Module [ ipv4-addresses ] time: 0.0724s
IPv6 Addresses :
Module [ ipv6-addresses ] time: 0.2862s
Sensors:  CISCO-ENTITY-SENSOR-MIB  CISCO-ENVMON-MIB ++ Fans + ENTITY-SENSOR-MIB
Module [ sensors ] time: 1.4793s
Storage :
Module [ storage ] time: 0.0392s
Inventory: Physical Inventory : ++++++++++++++++++++++++++++++++++
hrDevice :
Module [ inventory ] time: 2.6387s
Discovery protocols: LLDP-MIB Discovering new host belmont-5-swi-3 through LLDP
Discovering new host belmont-2-swi-3 through LLDP
 CISCO-CDP-MIB Discovering new host belmont-2-swi-3 through CDP
+
.... shortened ....
MySQL: Cell[30/0.01s] Row[72/0.03s] Rows[122/0.03s] Column[1/0s] Update[1/0s] Insert[324/0.68s] Delete[0/0s]

# ./ poller.php -h all 
Observium CE 0.14.11.6000
Poller
Starting polling run:
Module [ unix-agent ] disabled globally.
Module [ ipmi ] excluded for device.
Module [ junose-atm-vp ] excluded for device.
Module [ arista-software-ip-forwarding ] excluded for device.
Module [ netscaler-vsvr ] excluded for device.
Module [ aruba-controller ] excluded for device.
Module [ cisco-vpdn ] disabled globally.
Module [ wmi ] disabled globally.
Uptime: 137 days, 6h 36m 26s
Module [ system ] time: 7.3653s
Cisco configuration ages
sysUptime : 2015-03-03 10:49:44 | 137 days, 6h 36m 3s
Running   : 2015-03-24 09:51:20 | 116 days, 8h 34m 27s
Saved     : 2015-07-18 06:02:43 | 12h 23m 4s
Startup   : 2015-03-24 09:52:02 | 116 days, 8h 33m 45s
Hardware: cat29xxStack Version: 15.0(2)SE6 Features: UNIVERSALK9 Serial:  Asset:
Module [ os ] time: 0.1008s
Sensors:
Caching: cisco-envmon .1.3.6.1.4.1.9.9.13.1
Caching: cisco-envmon-state .1.3.6.1.4.1.9.9.13.1
Checking (snmp) temperature SW#1, Sensor#1, GREEN 41 C
Checking (snmp) state Sw1, PS1 Normal, RPS NotExist 1
Checking (snmp) state Switch#1, Fan#1 1
Module [ sensors ] time: 0.2498s
Processor Processor 1 20%
Module [ processors ] time: 0.0838s
Mempool Processor: 57.72%
... shortened ...
Polled in 20.5222 seconds
UPDATED!
MySQL: Cell[5/0s] Row[4/0s] Rows[66/0.02s] Column[0/0s] Update[126/0.17s] Insert[148/0.21s] Delete[0/0s]
Run discovery and puller as cronjob, create a new file /etc/cron.d/observium with the following contents.
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. 
Reload cron service. 
Running only a single poller instance is good for initial testing, check Observium Performance tuning page.
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 2 >> /dev/null 2>&1
Check apache/mysql are running, and go to Observium at http://<hostname> 
 Here are some screenshots of my example. 
 Observium login page. 

 Screenshots after adding the switch.  










 Observium supports Netapp, so it's easy to add one.  


Back to the main page