Pandora FMS Monitoring Tool Installation on Ubuntu 22.04

Pandora FMS is software for monitoring computer networks. Pandora FMS allows the visual monitoring of the status and performance of several parameters from different operating systems, servers, applications and hardware systems such as firewalls, proxies, databases, web servers or routers. Wikipedia

Designed to be modular, multi-platform and easy to customize, Pandora FMS supports monitoring of networks, servers, applications, databases, cloud and virtualization, logs, user experience, and business processes.

It uses powerful agents for all operating systems to collect data from monitored systems and devices, supports both local and remote network monitoring, auto-monitoring where agents detect storage devices, partitions or databases, and many other things. Agents can control system components such as services, execute processes or remove temporary files and more.

It also features a flexible notification and alert system, supports remote access via tools such as eHorus and SSH, auto-discovery of networks, network elements, network topology, etc. And has an integrated reporting system with dozens of different report templates and graphs for analysis. Notably, it is fully compatible with most open-source tools and experienced users can also create custom integrations with the services of their choice and so much more.

Pandora FMS Components:

  • Pandora FMS Servers – A Perl-based program in charge of performing checks, collecting, aggregating and processing the data. They save data (generated by them or agents) into the database. All servers are integrated into a single multi-threaded application.
  • Pandora FMS Console – A PHP-based user interface (UI) to operate and manage the monitoring system. It is powered by a database(MySQL/MariaDB by default) and a web server (Apache by default). It is also in charge of displaying the information present in the database.
  • Database – A data about the monitoring system (administrator configurations from the UI, data from agents, events, etc.) is stored in the database.
  • Software Agents – A applications installed on monitored systems, and run as daemons or services to collect the data to send it to the Pandora FMS servers.

Prerequisites

  • A server running Ubuntu 22.04.
  • Valid domain name pointed with your server IP.
  • A root password is configured the server.

First, it is recommended to update your system packages to the updated version. You can update them with the following command:

apt-get update -y

Once all the packages are updated, install all the dependencies required for Pandora FMS with the following command

apt-get install snmp snmpd libnet-telnet-perl libgeo-ip-perl libtime-format-perl libxml-simple-perl libxml-twig-perl libdbi-perl libnetaddr-ip-perl libhtml-parser-perl xprobe2 nmap libmail-sendmail-perl traceroute libio-socket-inet6-perl libhtml-tree-perl libsnmp-perl snmp-mibs-downloader libio-socket-multicast-perl libsnmp-perl libjson-perl -y

Install Dependencies

Next, you will need to install the Apache server, MariaDB, PHP and other required dependencies to your system. You can install all of them using the following command:

apt-get install apache2 mariadb-server php php-common php-gmp php-curl php-mbstring php-xmlrpc php-mysql php-gd php-bcmath php-xml php-cli php-zip php-pear php-zip php-sqlite3 php-snmp php-db graphviz php-curl php-ldap dbconfig-common unzip git -y
nano /etc/php/7.4/apache2/php.ini

Change the following lines:

memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
max_input_vars = 2000
date.timezone = Asia/Kolkata

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

Configure MariaDB Database

By default, MariaDB root password is not set. So you will need to set it in your system. You can do that by running the following script:

mysql_secure_installation

Answer all the questions as shown below to set the root password:

Enter current password for root (enter for none):
OK, successfully used password, moving on...
Set root password? [Y/n] Y
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

Next, log into the MariaDB shell with the following command:

mysql -u root -p

Provide your root password when prompt then enable the mysql_native_password plugin with the following command:

MariaDB [(none)]> USE mysql; 
MariaDB [(none)]> UPDATE user SET plugin='mysql_native_password' WHERE User='root';

Next, create a database and user for Pandora with the following command:

MariaDB [(none)]> CREATE DATABASE pandora;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON pandora.* to pandora@'localhost' IDENTIFIED BY 'pandora';

Then, flush the privileges and exit from the MariaDB shell with the following command:

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Next, you will need to edit the /etc/mysql/my.cnf file and define the sql_mode.

nano /etc/mysql/my.cnf

Add the following lines:

[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION

Save and close the file when you are finished then restart the MariaDB service to apply the changes:

systemctl restart mariadb

Download Pandoa FMS

Next, you will need to download the latest version of pandora FMS from the Git repository. You can download it with the following command:

cd /var/www/html/
git clone https://github.com/pandorafms/pandorafms.git

Next, give proper permission and ownership to the downloaded directory:

chown -R www-data:www-data /var/www/html/pandorafms
chown -R www-data:www-data /var/www/html/pandorafms/pandora_console/
chmod -R 775 /var/www/html/pandorafms/pandora_console/

Next, edit the Pandora configuration file:

nano /var/www/html/pandorafms/pandora_console/include/config.inc.php

Uncomment and change the following lines as per your database settings:

// Default values
 $config["dbname"]="pandora";
 $config["dbuser"]="pandora";
 $config["dbpass"]="pandora";
 $config["dbhost"]="localhost";
// This is used for reporting, please add "/" character at the end
// $config["homedir"]="/var/www/pandora_console/";
// $config["homeurl"]="/pandora_console/";
 $config["auth"]["scheme"] = "mysql";

Save and close the file when you are finished.

Configure Apache for Pandora FMS

Next, you will need to create a new Apache virtual host configuration file to serve Pandora FMS. You can create it with the following command:

nano /etc/apache2/sites-available/pandora.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName pandora.unixcop.com
DocumentRoot /var/www/html/pandorafms/pandora_console
<Directory /var/www/html/pandorafms/pandora_console>
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Save and close the file then enable the Pandora virtual host with the following command:

a2ensite pandora

Next, reload the Apache service to apply the configuration changes:

systemctl restart apache2

Access Pandora FMS

Now, open your web browser and type the URL http://pandora.unixcop.com/install.php to access the Pandora FMS. You should see the Pandora FMS web installation wizard as shown below:

Next, agree to the license terms by clicking “Yes, I accept license terms”.

Then the installer will check software dependencies. If all is OK, click Next.

 Now provide the MariaDB database root user password to create the Pandora FMS database and a database user (read the instructions). Then click Next.

Next, the installer will create the Pandora database and a MySQL user to access it, and create a random password for the MySQL user, take note of it (the password)

When the installation is complete, To access the console login page, click on “click here to access your Pandora FMS Console

At the login page, use the default login credentials to log in:

username: admin
password: pandora

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook