Automated Installation Guide for
Observium on Ubuntu 22.04
Overview
This guide will help you install and configure Observium, a network monitoring tool, on
Ubuntu 22.04. Observium helps monitor the health and status of network devices like routers,
switches, servers, and more.
System Requirements
• Operating System: Ubuntu 22.04
• Memory: Minimum 2 GB RAM (4 GB recommended)
• CPU: Minimum 2 CPU cores
• Storage: Minimum 50 GB free disk space
• Network Access: Access to the network devices you want to monitor (such as
switches, routers, etc.)
1. Update the System
Before starting, ensure your Ubuntu system is up to date.
Bash
sudo apt update && sudo apt upgrade -y
2. Install Required Dependencies
Observium requires specific software to function correctly. We’ll install Apache (for the web
interface), MariaDB (for the database), PHP (for the scripting language), and additional PHP
modules.
Step 2.1: Install Apache Web Server
Run the following command to install Apache:
bash
sudo apt install apache2 -y
Step 2.2: Install MariaDB Database Server
Run the following command to install MariaDB, which Observium uses to store monitoring
data:
bash
sudo apt install mariadb-server -y
Once installed, start and enable MariaDB with:
bash
sudo systemctl start mariadb
sudo systemctl enable mariadb
Step 2.3: Secure the MariaDB Installation
Run the security script to secure your MariaDB installation:
bash
sudo mysql_secure_installation
This script will prompt you to set a root password and disable anonymous users. Answer the
prompts as follows:
• Set root password? Yes
• Remove anonymous users? Yes
• Disallow root login remotely? Yes
• Remove test database and access to it? Yes
• Reload privilege tables now? Yes
Step 2.4: Install PHP and Required Modules
Observium requires PHP and several PHP extensions. Install them with the following
command:
bash
sudo apt install php php-mysql php-cli php-gd php-common php-xml php-
mbstring php-curl php-zip php-snmp -y
3. Download and Install Observium
1. Navigate to the /opt Directory:
bash
cd /opt
2. Download Observium: Use wget to download the latest Observium Community
Edition.
bash
wget http://www.observium.org/observium-community-latest.tar.gz
3. Extract Observium Files:
bash
tar zxvf observium-community-latest.tar.gz
4. Rename the Observium Directory:
bash
mv observium /opt/observium
4. Configure the Observium Database
1. Log into the MariaDB Shell:
bash
sudo mysql -u root -p
2. Create the Observium Database and User: Enter these commands one at a time in
the MariaDB shell:
sql
CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE
utf8_general_ci;
CREATE USER 'observium'@'localhost' IDENTIFIED BY
'your_password_here';
GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost';
FLUSH PRIVILEGES;
EXIT;
o Replace your_password_here with a strong password for the Observium
database user.
5. Configure Observium
1. Navigate to the Observium Directory:
bash
cd /opt/observium
2. Copy the Default Configuration File:
bash
cp config.php.default config.php
3. Edit the Configuration File: Open config.php to add your database details:
bash
nano config.php
o Find the lines for database settings and enter the details you created in Step 4:
php
Copy code
$config['db_host'] = 'localhost';
$config['db_user'] = 'observium';
$config['db_pass'] = 'your_password_here';
$config['db_name'] = 'observium';
4. Initialize the Observium Database:
bash
./discovery.php -u
6. Set Up the Web Server
1. Create an Apache Virtual Host for Observium:
bash
sudo nano /etc/apache2/sites-available/observium.conf
o Add the following content to the file:
apache
Copy code
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /opt/observium/html/
ServerName observium.local
<Directory /opt/observium/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/observium_error.log
CustomLog ${APACHE_LOG_DIR}/observium_access.log combined
</VirtualHost>
o Save and exit by pressing CTRL + X, Y, and then Enter.
2. Enable the Site and Restart Apache:
bash
sudo a2ensite observium.conf
sudo systemctl restart apache2
7. Set Up Observium User and Access
1. Create an Observium Admin User:
bash
cd /opt/observium
./adduser.php admin your_password_here 10
o Replace your_password_here with a strong password for the Observium
admin user.
2. Access Observium from a Web Browser: Open a browser and go to
http://your_server_ip to log in to Observium with the admin credentials you
created.
8. Configure SNMP on Devices and Add Devices to
Observium
1. Enable SNMP on Network Devices:
o Configure SNMP (Simple Network Management Protocol) on each device
(routers, switches, servers). Each device’s manual should have instructions on
enabling SNMP.
2. Add Devices to Observium:
bash
cd /opt/observium
./add_device.php <device_name> <snmp_community> v2c
o Replace <device_name> with the IP address or hostname of the device.
o Replace <snmp_community> with the SNMP community string used by your
devices (commonly "public" for testing but should be changed to something
more secure in production).
9. Configure Automated Polling and Discovery
Observium needs to poll devices and discover new information regularly. Set up cron jobs for
these tasks.
1. Edit the Cron File:
bash
sudo crontab -e
2. Add the Following Cron Jobs:
bash
# Run a discovery every 6 hours
33 */6 * * * root /opt/observium/discovery.php -h all >>
/dev/null 2>&1
# Run automated polling every 5 minutes
*/5 * * * * root /opt/observium/poller-wrapper.py 1 >>
/dev/null 2>&1
3. Save and Exit.
10. Final Steps and Testing
1. Test the Observium Setup:
o Open http://your_server_ip in a web browser and log in.
o Check that all added devices appear and display status data.
2. Regular Maintenance:
o Regularly update your Ubuntu system and Observium.
o Check the health and performance of your Observium server.