4.10.2014

Observium Installation on Ubuntu 12.04 LTS

What is Observium?

Observium is an autodiscovering SNMP based network monitoring platform written in PHP which includes support for a wide range of network hardware and operating systems including Cisco, Windows, Linux, HP, Dell, FreeBSD, Juniper, Brocade, Netscaler, NetApp and many more.  Observium has grown out of a lack of network monitoring platforms which are both simple to manage and pleasant to use. It is intended to provide a navigable interface to the health and performance of your network. Its design goals include collecting as much historical data about devices as possible, using as much auto-discovery as possible with little or no manual intervention, and having a very intuitive interface.
Observium is not intended to replace an up/down alerting system like Icinga or Nagios, but rather to complement it with an easy to manage, intuitive representation of historical and current performance statistics, configuration visualisation and syslog capture.

Assumptions

  • A working base install of Linux Debian 7 Wheezy or Ubuntu 12.04 LTS or Ubuntu 13.04
  • UDP port 161 open between the Observium Debian 7 server and the end devices
  • Aptitude sources configured correctly
  • Unrestricted root access

Installing Observium

http://www.observium.org/wiki/Debian_Ubuntu_Installation
1. Update and upgrade
1
apt-get update && apt-get -y upgrade
2. Install packages required
1
apt-get install -y libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp php-pear snmp graphviz php5-mcrypt php5-json subversion mysql-server mysql-client rrdtool fping imagemagick whois mtr-tiny nmap ipmitool python-mysqldb
Optional: If you want to monitor libvirt Virtual Machines
1
apt-get install libvirt-bin
3. Create a folder for Observium to live in
1
mkdir -p /opt/observium && cd /opt
4. Download the community version of Observium
5. Extract Observium
1
tar zxvf observium-community-latest.tar.gz
6. Change to Observium installation directory
1
cd observium
7. Copy the default configuration file and modify to your system
1
cp config.php.default config.php
Note: The only real change you need to make is to the “$config['db_pass'] = ” field unless you are installing the database elsewhere with a different database name.
8. Create the Observium database
1
2
3
$mysql -u root -p
mysql> CREATE DATABASE observium;
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY '<observiumdb password>';
9. Setup the MySQL database and insert the default schema
1
php includes/update/update.php
It’s OK to have some errors in the SQL revisions up to 006
10. Create  the directory to store RRDs in
1
2
mkdir rrd
chown www-data:www-data rrd
11. If the server will only be running Observium, change the /etc/apache2/sites-available/default to:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /opt/observium/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /opt/observium/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerSignature On
</VirtualHost>
Alternatively you can create a vhost just for Observium
12. Enable mod_rewrite for Observium’s cleaner URLs:
1
2
a2enmod rewrite
apache2ctl restart
13. Add the first user
1
2
cd /opt/observium
./adduser.php <username> <password> <level>
14. Add the first device (even if you haven’t configured it yet)
1
./add_device.php <hostname> <community> v2c
15.  Do an initial discovery and polling run to populate the data for the new device
1
2
./discovery.php -h all
./poller.php -h all
16. Create cron jobs, create a new file /etc/cron.d/observium with the following contents
Important Note: Please note that the below example includes a username, so will only work in /etc/crontab or /etc/cron.d/observium. It will not work in a user crontab edited with crontab -e
1
2
3
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
17. Connect to the web console by going to a browser and typing “http://serveripaddress”
Observium Login

Configuring Microsoft Windows 2008 Server SNMP Agent

1. Open Server Management
2. Right click on “Features” and click on “Add Features”
3. Expand “SNMP Services” and select “SNMP Service” click Next
4. Click Install
5. Close Server Manager
6. Open Server Manager
7. Expand Configuration and select Services
7. Select SNMP Service, right click and select properties
8. Select the “Agent” tab
9. Type the contact name responsible for this server or email address
10. Type the location eg, Sydney,Australia
11. Tick the following
  • Physical
  • Datalink and subnetworkSNMP Trap Service - Agent
12. Select the “Traps” tab
13. Type in the community string you are using in your environment and select “Add to list”
14. Click “Add”
15. Type the IP of the Observium ServerSNMP Trap Service - Traps
16. Select “Security” tab
17. Ensure “Send authentication trap” is ticked
18. Click “Add” under “Accepted community names”
19. Select “READ CREATE” under Community rights
20. Enter your community string under Community Name
21. Select “Accept SNMP packets from these hosts”
22. Select “Add” and type the IP address of the Observium Server
You can also put in the FQDN of the Observium serverSNMP Trap Service - Security23. Add your server into the Observium Web Console

Configuring SNMP on Linux Debian, Ubuntu or Redhat

1a. Install Net-SNMP on Debian/Ubuntu
1
apt-get install snmpd
1b. Install Net-SNMP on Redhat
1
yum install net-snmp
2a. Make sure the SNMPDOPTS line in /etc/default/snmpd looks like this
1
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -p /var/run/snmpd.pid'
2b. Make sure the OPTIONS line in /etc/sysconfig/snmpd looks like this
1
OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid"
3. Replace the default /etc/snmp/snmpd.conf file with something like this, changing thecommunitylocation and contact fields
1
2
3
4
5
6
7
8
9
10
com2sec readonly default <COMMUNITY>
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
view all included .1 80
access MyROGroup "" any noauth exact all none none
syslocation <LOCATION>
syscontact <CONTACT>
#This line allows Observium to detect the host OS if the distro script is installed
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro
4. Get the Observium ‘distro’ script to identify your distribution via SNMP
1
2
3
4
cd /tmp
mv distro /usr/bin/distro
chmod 755 /usr/bin/distro
5. Restart SNMPD
1
/etc/init.d/snmpd restart
6. Add the host to your Observium Web Console

Configuring SNMP on Cisco IOS

In this example I will be using IPv4 Only named ACL’s which is a standard set up these days.
1. Shell into the Cisco console
2. Elevate to privileged mode
1
enable
3. Enter global configuration mode
1
configure terminal
4. Create named access list
1
ip access-list standard SNMPv4
5. Allow Observium server IP address
1
2
permit <ipaddress>
exit
6. Configure community string (change <community> to the community string in your environment)
1
snmp-server community <community> RO SNMPv4
7. Globally enable SNMP ifindex persistence
1
snmp-server ifindex persist
8. Set SNMP device location
1
snmp-server location Sydney,Australia
9. Set SNMP owner
1
snmp-server contact Chris

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.