Introduction
Observium is a free network monitoring and management platform that supports a wide range of operating systems, devices, and other platforms. Its auto-discovering feature collects data from network devices using Simple Network Management Protocol (SNMP) and stores it in a MySQL database. Furthermore, being a PHP-based platform, it offers an easy-to-use web interface to allow you to monitor the network devices. Some supported platforms and devices are Linux, Cisco, FreeBSD, Windows, Juniper, Brocade, Netscaler, and NetApp. In this article, you will learn how to install Observium on Debian 11 server.
Prerequisites
- Deploy a fully updated Rcs Debian 11 Server.
- Create a non-root user with sudo access.
1. Install and Configure Observium
Update the system packages.
$ sudo apt updateInstall all the required packages needed to run Observium.
$ sudo apt install -y libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-gd php7.4-json php7.4-bcmath \
php7.4-mbstring php7.4-opcache php7.4-apcu php7.4-curl php-pear snmp fping rrdtool whois \
mariadb-server mariadb-client subversion mtr-tiny ipmitool graphviz imagemagick apache2 \
python3-mysqldb python3-pymysql python-is-python3Add Observium system user.
$ sudo useradd -r -M -d /opt/observium observiumAdd the user to group www-data.
$ sudo usermod -a -G observium www-dataDownload the latest Observium Community Edition installation files.
$ sudo wget http://www.observium.org/observium-community-latest.tar.gzUnpack the downloaded files.
$ sudo tar zxvf observium-community-latest.tar.gzMove the extracted files into the /opt directory.
$ sudo mv observium /optCopy the default configuration file.
$ sudo cp /opt/observium/config.php.default /opt/observium/config.phpEdit the file for your system.
$ sudo nano /opt/observium/config.phpModify the file as shown bellow, save and close the file:
// Database config --- This MUST be configured
$config['db_extension'] = 'mysqli';
$config['db_host'] = 'localhost';
$config['db_user'] = 'observium';
$config['db_pass'] = 'StrongPassword';
$config['db_name'] = 'observium';Create rrd and logs directory.
$ sudo mkdir /opt/observium/{rrd,logs}Change the permissions of the directory.
$ sudo chown -R observium:observium /opt/observium/
$ sudo chmod -R 775 /opt/observium/Edit snmp.conf configuration file to direct the SNMP utilities to use Observium's MIBs.
$ sudo nano /etc/snmp/snmp.confModify the line as shown below, save and close the file:
mibs : /opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp2. Configure MySQL Database
Log in to the MySQL shell. Then, at the password prompt, just press Enter to continue.
$ sudo mysql -u root -pCreate a database named observium.
CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;Create a user named observium. Modify the StrongPassword value with your secure password.
CREATE USER 'observium'@'localhost' identified by 'StrongPassword';Grant all database privileges to the user.
GRANT ALL ON observium.* TO 'observium'@'localhost';Reload the changes.
FLUSH PRIVILEGES;Exit MySQL shell.
exitInsert the default MySQL database schema.
$ cd /opt/observium
$ sudo ./discovery.php -u4. Configure Apache
Edit the default Apache configuration file.
$ sudo nano /etc/apache2/sites-available/000-default.confThe final content should be similar to the one below, save and close the file:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /opt/observium/html
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /opt/observium/html/>
DirectoryIndex index.php
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>Change the global server name.
$ sudo nano /etc/apache2/apache2.confAdd the code below at the end of the file, save and close the file:
ServerName localhostEnable mpm_prefork module.
$ sudo a2enmod mpm_preforkEnable mod_rewrite.
$ sudo a2enmod rewriteRestart the Apache service.
$ sudo systemctl restart apache25. Configure Admin Account
Add an initial user with access level 10 for administration. Modify the AdminPassword value with your secure password.
$ cd /opt/observium
$ sudo ./adduser.php admin AdminPassword 10Create a new file /etc/cron.d/observium to add cron jobs.
$ sudo nano /etc/cron.d/observiumAdd the following contents, save and close the file:
# Run a complete discovery of all devices once every 6 hours
33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1
# Run automated discovery of newly added devices every 5 minutes
*/5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1
# Run multithreaded poller wrapper every 5 minutes
*/5 * * * * root /opt/observium/poller-wrapper.py >> /dev/null 2>&1
# Run housekeeping script daily for syslog, eventlog and alert log
13 5 * * * root /opt/observium/housekeeping.php -ysel >> /dev/null 2>&1
# Run housekeeping script daily for rrds, ports, orphaned entries in the database and performance data
47 4 * * * root /opt/observium/housekeeping.php -yrptb >> /dev/null 2>&16. Access Observium Web Interface
Install UFW.
$ sudo apt-get install ufw -yEnable UFW.
$ sudo ufw enableAllow port 80 and ssh through UFW firewall.
$ sudo ufw allow 80
$ sudo ufw allow sshTo access the Observium Web Interface, go to your browser and visit http://Server_IP/. For example:
http://192.0.2.10/Conclusion
You have successfully installed Observium on your server. You will get a log-in screen; use admin as your username and AdminPassword as your password. Modify the AdminPassword value with the secure password you entered during setup. You can now access the Dashboard and configure it to begin managing your network.
More Information
To learn more about Observium, go to the official documentation page.