Step By Step Guide to Setup Obersium on Ubuntu 20.04 LTS

Observium is a free & open source s a Network Management and Monitoring System tool. We can collects data from using SNMP & it allows to monitor all of the networks devices. It provides a simple & easy-to-use Web interface. It is PHP-based and uses a MySQL database to store data.

There are few steps to setup Observium on ubuntu:

Step 1: Update the System.

apt-get update

Step 2: Install the Php & modules.

apt install wget apache2 php php-{pear,cgi,common,curl,mbstring,gd,mysql,bcmath,imap,json,xml,snmp,fpm,zip}

  • Start & Enable the apache2.

systemctl start apache2
systemctl enable apache2

  • Here is the command output.

root@ip-172-31-21-156:/home/ubuntu# systemctl enable apache2
Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2

Step 3: Install Mariadb Server on system.

apt install mariadb-server

  • Configure the mariadb server file.

vim /etc/mysql/mariadb.conf.d/50-server.cnf

  • Add the following lines:

innodb_file_per_table=1
sql-mode=""
lower_case_table_names=0

  • Restart the mariadb server.

systemctl restart mariadb

Step 4: Login in to mariadb server.

mysql -u root

  • Create a Database.

create database observium;

  • Run Grant all privileges command.

grant all privileges on observium.* to observium@localhost IDENTIFIED by "Password";
flush privileges;
quit

  • Here is the command output.

root@ip-172-31-21-156:/home/ubuntu# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 10.3.31-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database observium;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> grant all privileges on observium.* to observium@localhost IDENTIFIED by "Password";
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> quit
Bye

  • Update the packages.

apt-get update

  • Install the required packages.

apt install rrdtool whois fping imagemagick graphviz mtr-tiny nmap python3-mysqldb snmp snmpd python3-memcache mtr-tiny acl

Step 5: Download the Observium in System.

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

  • Here is the command output.

root@ip-172-31-21-156:/home/ubuntu# wget http://www.observium.org/observium-community-latest.tar.gz
--2021-11-17 14:34:41-- http://www.observium.org/observium-community-latest.tar.gz
Resolving www.observium.org (www.observium.org)... 51.91.185.43
Connecting to www.observium.org (www.observium.org)|51.91.185.43|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.observium.org/observium-community-latest.tar.gz [following]
--2021-11-17 14:34:42-- https://www.observium.org/observium-community-latest.tar.gz
Connecting to www.observium.org (www.observium.org)|51.91.185.43|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 113413646 (108M) [application/x-gzip]
Saving to: ‘observium-community-latest.tar.gz’
observium-community-latest.tar.gz 100%[===========================================================================================>] 108.16M 3.89MB/s in 26s
2021-11-17 14:35:08 (4.19 MB/s) - ‘observium-community-latest.tar.gz’ saved [113413646/113413646]

  • Extract the downloaded folder.

tar xvf observium-community-latest.tar.gz

  • Move the extracted folder to /var/www/html/.

mv observium /var/www/html/

  • To change the observium directory & create a new config file.

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

  • Open the created config file.

vim /var/www/html/observium/config.php

  • To set database user-name & password.

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

  • To Create rrd and logs directory.

mkdir /var/www/html/observium/{rrd,logs}

Step 6: To Configure snmpd.

  • Copy the snmpd sample file.

cp /var/www/html/observium/snmpd.conf.example /etc/snmp/snmpd.conf

  • To Configure the snmpd.conf file.

vim /etc/snmp/snmpd.conf

  • Add the following line.

com2sec readonly default 0bs3rv1um

  • Restart the snmpd.

systemctl restart snmpd

Step 7: Configure the Apache2.

vim /etc/apache2/sites-available/example.conf

  • Add the following lines:

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

  • Enable the config file.

a2ensite example.conf

  • Disable the default config file.

a2dissite 000-default.conf

  • Provide the following permisiion to /var/www/html/observium folder.

chown -R www-data:www-data /var/www/html/observium/*
chmod 775 -R /var/www/html/observium/*

  • Enable the Rewrite mode.

a2enmod rewrite

  • Restart the Apache2.

service apache2 restart

Step 8: To Configure Observium on Web UI.

  • Change the Directory.

cd /var/www/html/observium

  • Run the following command.

./discovery.php -u

  • Here is the command output.

  • To Add Admin User.

Syntax:

adduser.php <username> <password> <level 1-10> [email]

Where level is:

0 - Disabled means user disabled.
1 - Normal User means User has read access to individual entities.
5 - Global Read means user has global read access.
7 - Global Secure means Read user has global read access with secured info.
8 - Global Secure Read / Limited Write means user has secure global read access with scheduled maintenence read/write.
10 - Administrator means user has full administrative access.

Run:

root@ip-172-31-21-156:/var/www/html/observium# ./adduser.php admin Password@123 10

  • Here is the command output.

root@ip-172-31-21-156:/var/www/html/observium# ./adduser.php admin Password@123 10
Observium CE 21.10.11666
Add User
User admin added successfully.

Step 8: To Open the Observium Web Interface.

http://server-ip

  • Provide the Username & Password.

  • Now,Observium is Ready.

Leave a Reply