• Get In Touch
May 29, 2017

How to Install Observium on Ubuntu 16.04

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Observium is an open source autodiscovering network monitoring tool based on SNMP.

It is written in PHP and uses SNMP to collect data from connected system that allows you to monitor all of the networks devices via an easy to use interface.

Observium provides support for a wide range of network hardware and operating systems such as, Windows, Linux, NetApp, Cisco, FreeBSD, Dell, Netscaler and much more.

Requirements

  • A server running Ubuntu 16.04.
  • A normal user with sudo privileges setup on your server.

Update the System

Before installing any packages, it is recommended to update your system with the latest stable version. You can do this with the following command:

sudo apt-get update -y
sudo apt-get upgrade -y

Once your system is up to date, you can proceed to install the Apache web server.

Install Apache Web Server

First, you will need to install Apache web server on your system. You can easily install it by running the following command:

sudo apt-get install apache2 -y

Once apache is installed, start the Apache web server and enable it to start on boot with the following command:

sudo systemctl start apache2
sudo systemctl enable apache2

Install PHP

You can install PHP and other required modules with the following command:

sudo apt-get install wget unzip php7.0 php7.0-mysql php7.0-gd php7.0-curl libapache2-mod-php7.0 php7.0-mcrypt php7.0-pear python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick snmp fping -y

Once all the packages are installed, you can proceed to install MariaDB server.

Install and Configure MariaDb Server

You will need to install MariaDB server to store data. You can install it with the following command:

sudo apt-get install mariadb-server -y

Start MariaDB and enable it to automatically start at boot time.

sudo systemctl start mysql
sudo systemctl enable mysql

By default, MariaDB is not secured, so you will need to secure it first. You can secure it by running the mysql_secure_installation script.

sudo mysql_secure_installation

Answer all the questions as shown below:

Set root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Once MariaDB is secured, log in to the MySQL shell and create a database for observium:

mysql -u root -p

Enter your root password when prompt, then create a database for Observium. It is recommended to set secure password:

MariaDB [(none)]>CREATE DATABASE observiumdb;

Query OK, 1 row affected (0.00 sec)

Next, create a username and password for Observium with the following command:

MariaDB [(none)]>CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';

Query OK, 1 row affected (0.00 sec)

Next, grant privileges to the Observium database with the following command:

MariaDB [(none)]>GRANT ALL PRIVILEGES ON observiumdb.* TO 'user'@'localhost';

Query OK, 1 row affected (0.00 sec)

Next, you will need to run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MariaDB and we can use new credentials:

MariaDB [(none)]>FLUSH PRIVILEGES;

Query OK, 1 row affected (0.00 sec)

Next, exit from the MariaDB console with the following command:

MariaDB [(none)]>\q

Once you are done, you can proceed to the next step.

Install Observium

First, you will need to downlaod the latest version of the Observium. You can download it with the following command

wget http://www.observium.org/observium-community-latest.tar.gz

Once the download is completed, extract the downloaded file with the following command:

tar -xvzf observium-community-latest.tar.gz

Next, move the extracted directory to the Apache web root directory:

sudo mv observium /var/www/html/

Next, change the directory to observium and copy the default configuration file config.php.default toconfig.php` with the following command:

cd /var/www/html/observium
sudo cp config.php.default config.php

Next, edit the config.php file and make some changes:

sudo nano config.php

Change the following lines:

// Database config ---  This MUST be configured
$config['db_extension'] = 'mysqli';
$config['db_host']      = 'localhost';
$config['db_user']      = 'user';
$config['db_pass']      = 'password';
$config['db_name']      = 'observiumdb';

Save and close the file when you are finished, then setup the default schema for the MySQL Database with the following command:

sudo ./discovery.php -u

You should see the following output:

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

Install initial database schema ... done.
-- Database is up to date.

Next, create the directory to store RRDs and logs and set the proper ownership:

sudo mkdir rrd logs
sudo chown www-data:www-data rrd logs

Configure Apache for Observium

First, create the virtual host configuration file for Observium. You can do this by creating observium.conf file inside /etc/apache2/sites-available directory:

sudo nano /etc/apache2/sites-available/observium.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName yourdomain.com
DocumentRoot /var/www/html/observium/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/observium/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog  ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog  ${APACHE_LOG_DIR}/access.log combined
ServerSignature On
</VirtualHost>

Save and close the file. Then enable rewrite and PHP mcrypt module with the following command:

sudo a2enmod rewrite
sudo php5enmod mcrypt

Finally, restart Apache web server so that the changes take place:

sudo systemctl restart apache2

Next, create your first admin user with the following command:

cd /var/www/html/observium
sudo ./adduser.php admin password 10

You should see the following output:

Observium CE 0.16.10.8128
Add User

User admin added successfully.

Access Observium

Once Observium is configured properly, open your web browser and type the URL http://yourdomain.com, you will be redirected to the Observium login page as shown in below image:

HP_NO_IMG/data/uploads/users/f36d03b4-5bf0-4986-8e72-2e14d73d9b4d/878225623.png” alt=”” />

Here, provide your login credentials and click on the login button, you should see the Observium dashboad as below:

HP_NO_IMG/data/uploads/users/f36d03b4-5bf0-4986-8e72-2e14d73d9b4d/891483077.png” alt=”” />

Congratulations! You have successfully installed Observium on your Ubuntu 16.04 server.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]