Monitoring the fleet of servers and network devices is a serious undertaking for system administrators. Indeed, you wouldn’t want to manually check on each device to get their health state and metrics. That’s why you should consider using centralized monitoring solutions like the Pandora FMS.
Pandora FMS is a Linux-based server and network device monitoring solution. It allows you to monitor resources from a web console, set up alerts, and more.
In this tutorial, we’ll set up the Pandora FMS server community edition (free and open-source) and install the Pandora monitoring agent on a separate server to be monitored.
Requirements
- One Linux machine for the Pandora FMS server installation. Any distribution that supports Docker and Docker Compose will be fine.
- One Linux machine for the Pandora FMS monitoring agent installation. The agent supports Ubuntu/Debian-based and RHEL/Fedora-based distributions.
- An administrative or root account.
This tutorial will be using the following Linux machines:
Hostname | Role | IP Address | Operating System |
---|---|---|---|
pandorafms | Pandora FMS server | 10.0.0.5 | Ubuntu 22.04 |
webdev | Monitoring target | 10.0.0.6 | RockyLinux 8.7 |
Install Docker Engine
While Pandora FMS can be installed as a package manually or using a script, deploying it using Docker provides a consistent experience and less complicated configuration.
Let’s install Docker first if you haven’t already. The below instructions are specific to Ubuntu. If you have a different OS, follow the detailed instructions for your distribution instead.
Note. Check our guide on how to update Docker image and container to the newest version.
Update the local package index:
sudo apt update
Next, install the packages required to install Docker:
sudo apt install -y \ ca-certificates \ curl \ gnupg \ lsb-release
Add the official Docker GPG keys to your system:
sudo mkdir -m 0755 -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Set up the Docker repository specific to the Ubuntu release:
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Next, update the package cache and install Docker:
sudo apt update && sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Docker is now installed. To confirm, run the below command to get the Docker version.
docker --version
Enable non-root access to Docker. This next step makes your account a docker group member, enabling you to run Docker without sudo.
## Enable Non-Root access sudo usermod -aG docker $USER newgrp docker id $USER
Lastly, enable and start Docker:
sudo systemctl enable docker.service sudo systemctl enable containerd.service sudo systemctl start docker sudo systemctl status docker
Install Pandora FMS Server
There are multiple dependencies and components that Pandora FMS requires. Instead of manually installing each component and dependency, let’s build a Pandora FMS full stack in Docker. As of this writing, the latest Pandora FMS open stack available on Docker Hub is based on RockyLinux 8.
Let’s first download the docker-compose.yml template.
wget https://raw.githubusercontent.com/pandorafms/pandorafms/develop/extras/docker/centos8/docker-compose.yml
Open the file in a text editor. The content
nano docker-compose.yml
The file will have the following default content. As you can see, this compose file will create two containers. One for the database (pandorafms/pandorafms-percona-base) and one for Pandora FMS (pandorafms/pandorafms-open-stack-el8:latest).
# Use root/example as user/password credentials # este compose incluye la base de datos en otro docker y levanta aplicacion y DB juntos version: '3.1' services: db: image: pandorafms/pandorafms-percona-base restart: always #command: ["mysqld", "--innodb-buffer-pool-size=900M"] environment: MYSQL_ROOT_PASSWORD: pandora MYSQL_DATABASE: pandora MYSQL_USER: pandora MYSQL_PASSWORD: pandora networks: - pandora pandora: image: pandorafms/pandorafms-open-stack-el8:latest restart: always depends_on: - db environment: MYSQL_ROOT_PASSWORD: pandora DBHOST: db DBNAME: pandora DBUSER: pandora DBPASS: pandora DBPORT: 3306 INSTANCE_NAME: pandora01 PUBLICURL: "" SLEEP: 5 RETRIES: 10 networks: - pandora ports: - "8080:80" - "41121:41121" - "162:162/udp" - "9995:9995/udp" networks: pandora:
You can already use this file without modification, but if you need to make changes, here are the crucial parameters.
- PORTS — These are the port mappings. DO NOT change the mappings for ports 41121, 162, and 9995. You may customize the mapping for the web console. The default is 8080. You can change it with port numbers higher than 1024.
- INSTANCE_NAME — Specifies the Pandora FMS server name.
- DBHOST — The database host container with the MySQL engine.
- DBNAME — The database name.
- DBUSER — The database username.
- DBPASS — The database password.
- DBPORT — The MySQL engine port. The default is 33306.
- PUBLICURL — Define the public-facing URL. It is recommended when placing Pandora FMS behind a reverse proxy.
- SLEEP — The retry interval when Pandora failed to connect to the database.
- RETRIES – How many times will Pandora FMS attempt to reconnect to the MySQL engine before failing?
Close the text editor when you’re done reviewing or changing the parameters.
Now, run the below command to start the database and Pandora FMS containers.
docker compose -f docker-compose.yml up -d
Ultimately, you should see that the containers alpha-db-1 and alpha-pandora-1 have started.
To confirm, run this command.
docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Status}}"
Access the Pandora FMS Console
Now that you’ve installed the Pandora FMS server using Docker, how do you know it works? The next step is to access the Pandora FMS console.
Open your browser and access the URL HTTP://:8080. You should now see the login screen. Log in using the default username and password.
The default username is admin, and the password is pandora.
Select your preferred language and time zone on the configuration wizard, enter the email address for receiving alerts, and click Continue.
For security reasons, let’s change the Administrator password first. Click Profiles → Manage users.
Click the Edit button (wrench icon) next to the admin account.
Enter the new admin password.
Scroll to the bottom and click Update to apply the password change.
And you should get a confirmation message that the user information change is successful.
Install the Pandora FMS Agent
At this point, there’s only one agent deployed, and it is on the Pandora FMS server itself.
You must deploy the Pandora FMS agent to add devices or servers to the monitoring. The agent can be installed on most *NIX systems and Windows. But on *NIX systems, there’s an automated installation script available.
Open a terminal session on the remote system and switch to the root user.
su -
Run the below command to install the Pandora FMS agent. Replace the with your Pandora FMS server’s IP or FQDN.
export PANDORA_SERVER_IP=<PandoraServer IP or FQDN> && curl -Ls https://pfms.me/agent-deploy | bash
Wait until the agent installation is finished.
To make sure the agents start automatically, run these commands:
sudo systemctl enable pandora_agent_daemon.service sudo systemctl start pandora_agent_daemon sudo systemctl status pandora_agent_daemon
Now, go back to the Pandora FMS console. Click Monitoring → Views → Agent Detail.
And you can see that the agent on the remote machine is now online. Click the View link.
You can now view the monitoring status of this agent.
Scrolling further down, you’ll see the list of monitoring modules. You can edit each module, view their stats, and view the existing alerts.
What’s Next?
The Pandora FMS has a plethora of monitoring features. You can monitor Windows servers and other supported devices besides Linux systems. This tutorial only covers the installation and basic configuration, but there is much more to learn.
Visit the official Pandora FMS documentation to learn more in-depth.