AlmaLinuxRHEL Based

How To Install Observium on AlmaLinux 9

Install Observium on AlmaLinux 9

In this tutorial, we will show you how to install Observium on AlmaLinux 9. For those of you who didn’t know, Observium, a renowned network monitoring and management tool, is essential for maintaining the health and performance of your network infrastructure.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Observium monitoring tool on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux or RHEL-based.

Prerequisites

  • A server running one of the following operating systems: AlmaLinux 9.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Observium.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Observium on AlmaLinux 9

Step 1. Before diving into the installation process, ensure your AlmaLinux 9 system is up-to-date. Run the following commands in your terminal:

sudo dnf update

Step 2. Installing Necessary Dependencies.

Observium relies on several software packages and libraries. Install them with:

sudo dnf install epel-release wget unzip net-snmp-utils

Replace “your-hostname” with your desired hostname, save, and exit the text editor.

Edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file (replace “eth0” with your network interface if different) to set the network configuration:

sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0

Step 3. Configuring the Hostname and Network Settings.

Configure the hostname of your server and ensure your network settings are correctly configured. Edit the /etc/hostname file to set your hostname:

sudo nano /etc/hostname

Step 4. Installing Nginx.

Nginx is a high-performance web server and reverse proxy server. Install it with:

sudo yum install -y nginx

Start the Nginx service and enable it to start on boot:

sudo systemctl start nginx
sudo systemctl enable nginx

Step 5. Installing PHP.

Observium relies on PHP for its web interface. Install PHP and required PHP modules with:

sudo yum install -y php php-cli php-fpm php-mysqlnd php-zip php-xml php-json

Next, modify the PHP configuration file to suit Observium’s requirements:

sudo nano /etc/php.ini

Make the following changes:

max_execution_time = 300
memory_limit = 512M
post_max_size = 32M
upload_max_filesize = 32M
date.timezone = Your/Timezone

Step 6. Installing and Setting Up the MariaDB Database.

Observium stores its data in a MySQL or MariaDB database. Install MariaDB with:

sudo dnf install mariadb-server

Start the MariaDB service and enable it to start on boot:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Next, secure your MariaDB installation:

sudo mysql_secure_installation

Follow the prompts to set a root password, remove anonymous users, disallow root login remotely, remove test databases, and reload privileges.

Create a database for Observium and a user with privileges:

mysql -u root -p

Enter the MariaDB root password and execute the following SQL commands:

CREATE DATABASE observiumdb CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'observiumuser'@'localhost' IDENTIFIED BY 'your-strong-password';
GRANT ALL PRIVILEGES ON observiumdb.* TO 'observiumuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 7. Installing Observium on AlmaLinux 9.

First, download the Observium Community Edition to your server. Visit the Observium website to find the latest URL for the download:

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

Unzip the downloaded file:

sudo tar -zxvf observium-community-latest.tar.gz

Move the extracted files to the web server’s document root and rename the directory to “observium”:

sudo mv observium-community-* /var/www/html/observium

Copy the sample configuration file and make necessary adjustments:

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

Update the database settings:

$config['db_host'] = 'localhost';
$config['db_user'] = 'observiumuser';
$config['db_pass'] = 'your-strong-password';
$config['db_name'] = 'observiumdb';

Step 8. Web Server Configuration.

Create a new Nginx configuration file for Observium:

sudo nano /etc/nginx/conf.d/observium.conf

Add the following configuration:

server {
    listen       80;
    server_name  your-domain.com; # Replace with your domain or server IP

    root   /var/www/html/observium/html;
    index  index.php;

    access_log  /var/log/nginx/observium_access.log;
    error_log   /var/log/nginx/observium_error.log;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ .php$ {
        include         fastcgi_params;
        fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_pass    unix:/var/run/php-fpm/php-fpm.sock;
    }

    location ~ /\.ht {
        deny  all;
    }
}

Next, create a symbolic link to enable the Nginx configuration:

sudo ln -s /etc/nginx/conf.d/observium.conf /etc/nginx/conf.d/
sudo systemctl reload nginx

Step 9. Initial Observium Setup.

Navigate to the Observium installation directory:

cd /var/www/html/observium

Run the installation script:

sudo ./discovery.php -u

Follow the prompts to configure Observium:

  1. Enter your desired timezone (e.g., “America/New_York”).
  2. Set up the cron job by running the provided command.

Creating an Admin User Account:

sudo ./adduser.php your_username your_password 10

Step 10. Configure Firewall.

To enhance security, you can set up a firewall to restrict access to the Observium web interface. Use the following commands to configure firewalld:

sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --reload

Step 11. Accessing the Observium Web Interface.

Open your web browser and enter your server’s IP address or domain name in the address bar. You should see the Observium login page. Log in with the admin credentials you created.

Install Observium on AlmaLinux 9

Congratulations! You have successfully installed Observium. Thanks for using this tutorial for installing the Observium monitoring tool on your AlmaLinux 9 system. For additional help or useful information, we recommend you check the official Observium website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button