---
title: Monitoring Instances with LibreNMS on Ubuntu Noble Numbat (24.04)
description: Learn how to monitor Instances using LibreNMS, an open-source PHP/MySQL network monitoring system.
tags: LibreNMS Ubuntu Focal-Fossa
products:
  - instances
dates:
  validation: 2025-07-16
  posted: 2019-07-04
  validation_frequency: 12
difficulty: beginner
usecase:
  - monitoring
ecosystem:
  - third-party
---
import image from './assets/scaleway-librenms_install.webp'
import image2 from './assets/scaleway-librenms_db.webp'
import image3 from './assets/scaleway-librenms_db.webp'
import image4 from './assets/scaleway-librenms_login.webp'
import image5 from './assets/scaleway-librenms_adddevice.webp'
import image6 from './assets/scaleway-librenms_newdevice.webp'
import image7 from './assets/scaleway-librenms_graphs.webp'

import Requirements from '@macros/iam/requirements.mdx'


Learn how to use LibreNMS to monitor Instances on Ubuntu 24.04 (Noble Numbat). LibreNMS is an open-source network monitoring system supporting a wide range of network hardware and operating systems, including Linux and Windows.

The software is based on PHP and MySQL (MariaDB) and is a community-based fork of the last GPL-licensed version of Observium.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- An [SSH key](/organizations-and-projects/how-to/create-ssh-key/)
- An [Instance](/instances/how-to/create-an-instance/) running on Ubuntu Noble Numbat (24.04)
- A [domain or subdomain](/domains-and-dns/quickstart/) pointed to your Instance

## Installing LibreNMS

1. Update the apt package cache and upgrade the already installed system packages:
    ```
    apt update && apt upgrade -y
    ```
2. Install the required packages.
    ```
    apt install -y acl curl composer fping git graphviz imagemagick mariadb-client mariadb-server mtr-tiny nginx-full nmap php-cli php-curl php-fpm php-gd php-json php-mbstring php-mysql php-snmp php-xml php-zip python3-memcache python3-mysqldb python3-pip rrdtool snmp snmpd whois
    ```
3. Create a user for LibreNMS:
    ```
    useradd -r -M -d /opt/librenms librenms
    usermod -aG librenms www-data
    ```
4. Download and configure LibreNMS:
    ```
    git clone https://github.com/librenms/librenms.git /opt/librenms
    chown -R librenms:librenms /opt/librenms
    chmod 770 /opt/librenms
    setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    ```

5. Install PHP dependencies:
    ```
    sudo -u librenms bash
    cd /opt/librenms
    ./scripts/composer_wrapper.php install --no-dev
    exit
    ```

## Setting up the database

LibreNMS stores the data collected from the monitored systems in a MySQL database. The [open-source fork](<https://en.wikipedia.org/wiki/Fork_(software_development)>) **[MariaDB](https://mariadb.org)** is used in the setup, providing the same features as MySQL.

1. Run the [MariaDB setup assistant](/tutorials/mariadb-ubuntu-bionic/) to configure a secure root password for the database server:
    ```
    mysql_secure_installation
    ```
2. Connect to the MariaDB shell with the user `root` and the password configured in the previous step:
    ```
    mysql -uroot -p
    ```
3. Create a database and user for LibreNMS and grant permissions to the database:
    ```
    CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
    CREATE USER 'librenms'@'localhost' IDENTIFIED BY '<a_secure_password>';
    GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
    FLUSH PRIVILEGES;
    exit
    ```
    Replace `<a_secure_password>` with a secure password of your choice.
4. Open the file `/etc/mysql/mariadb.conf.d/50-server.cnf` in a text editor, for example `nano`:
    ```
    nano /etc/mysql/mariadb.conf.d/50-server.cnf
    ```

    Add the following Lines within the `[mysqld]` section:

    ```
    innodb_file_per_table=1
    lower_case_table_names=0
    ```

    Save the file by pressing **CTRL**+**O** and exit nano by pressing **CTRL**+**X**.
5. Restart the MariaDB server:
    ```
    systemctl restart mysql.service
    ```

## Setting up Nginx

[Nginx](https://nginx.org) is an open-source web server and is being used to serve the web frontend of LibreNMS.

1. Create the file `/etc/nginx/sites-available/librenms.example.com` by opening it in a text editor:
    ```
    nano /etc/nginx/sites-available/librenms.example.com
    ```

    Add the Nginx configuration to the file, save it, and exit nano:

    ```
    server {
    listen      80;
    server_name <librenms.example.com>;
    root        /opt/librenms/html;
    index       index.php;

    charset utf-8;
    gzip on;
    gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
    location / {
      try_files $uri $uri/ /index.php?$query_string;
    }
    location /api/v0 {
      try_files $uri $uri/ /api_v0.php?$query_string;
    }
    location ~ \.php {
      include fastcgi.conf;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }
    location ~ /\.ht {
      deny all;
    }
    }
    ```

    <Message type="important">
      Replace `<librenms.example.com>` with the [FQDN](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) of your Instance.
    </Message>
2. Enable the server block by linking it to the **sites-enabled** directory:
    ```
    ln -s /etc/nginx/sites-available/librenms.example.com /etc/nginx/sites-enabled/
    ```
3. Restart the Nginx web server:
    ```
    service nginx restart
    ```

For security reasons, it is recommended to configure HTTPS by following [this tutorial](/tutorials/configure-nginx-lets-encrypt/).

## Setting up SNMP

[Simple Network Management Protocol (SNMP)](https://en.wikipedia.org/wiki/Simple_Network_Management_Protocol) is a protocol for collecting and organizing information about managed devices on IP networks. Data of SNMP is transported using [User Datagram Protocol (UDP)](https://en.wikipedia.org/wiki/User_Datagram_Protocol). Requests are sent to the agent listening on UDP port 161.

1. Copy the SNMP configuration file in the directory `/etc/snmp`:
    ```
    cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf
    ```
2. Open the configuration file in a text editor:
    ```
    nano /etc/snmp/snmpd.conf
    ```

    Edit the string `RANDOMSTRINGGOESHERE` to an SNMP group name of your choice.

    Save the file and exit `nano`.
3. To display distribution information, download the `distro` script and make it executable:
    ```
    curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
    chmod +x /usr/bin/distro
    ```
4. Restart the SNMP service:
    ```
    systemctl restart snmpd.service
    ```

## Setting up the cronjob and logrotate

[Cron](https://en.wikipedia.org/wiki/Cron) is a job scheduler available on Linux systems. It can be used to run jobs (i.e. shell scripts) automatically at given points in time to automatize system maintenance. [Logrotate](https://en.wikipedia.org/wiki/Log_rotation) is a tool to rotate log files automatically. This means cleaning up log files periodically by removing old contents to ensure the disk space they occupy does not exceed a configured maximum value.

1. Copy the cron configuration file into the directory `/etc/cron.d/` to execute actions automatically:
    ```
    cp /opt/librenms/librenms.nonroot.cron /etc/cron.d/librenms
    ```

    The file contains the basic cronjobs required by LibreNMS.
2. To prevent the log files of LibreNMS from becoming too large, logrotate can rotate them out from time to time to save space. Enable it by copying the provided configuration file into `/etc/logrotate.d`:
    ```
    cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms
    ```

## Running the web installer

1. Open a web browser and go to your LibreNMS Instance:
    ```
    https://librenms.example.com/install.php
    ```

    <Lightbox image={image} alt="" />
2. Fill in the database connection parameters and the password set during database creation:
    <Lightbox image={image2} alt="" />
3. Configure a **user** and **password** for LibreNMS and complete the setup.2. Fill in the database connection parameters and the password set during database creation:
    <Lightbox image={image3} alt="" />
4. Configure a **user** and **password** for LibreNMS and complete the setup. <Lightbox image={image4} alt="" />

## Adding localhost to LibreNMS

Start by adding the local host as the first device to monitor:

1. Once logged in, click **Devices**, then **Add Device** in the pop-up menu:
    <Lightbox image={image5} alt="" />
2. Enter the hostname **localhost**, keep **SNMP** on, leave the values for **SNMP version** and **Port Association Mode** as preset. Enter the configured community name in the file `/etc/snmp/snmpd.conf` as the value for **Community**. Once all values are set, click **Add Device** to add the device:
    <Lightbox image={image6} alt="" />
3. LibreNMS starts polling the device and different graphs are created, showing the status of the device.

## Adding a remote device to LibreNMS

LibreNMS is capable of monitoring many network devices. To monitor a remote cloud Instance or Elastic Metal server, the use of SNMP is widespread. SNMP stands for Simple Network Management Protocol. It is a protocol that was designed for monitoring and management purposes of network-connected devices (servers, switches, printers, routers, etc.). On Ubuntu systems, a daemon called `SNMPd` is available to listen and reply to SNMP requests.

1. To monitor another cloud Instance or elastic metal server, connect to the machine as root:
    ```
    ssh root@second_cloud_instance
    ```
2. Update the `apt` repository inventory:
    ```
    apt update
    ```
3. To display distribution information, download the `distro` script and make it executable:
    ```
    curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
    chmod +x /usr/bin/distro
    ```
4. Install `SNMPd` via apt:
    ```
    apt install snmpd
    ```
5. Open the SNMPd configuration file in a text editor (e.g. `nano`):
    ```
    nano /etc/snmp/snmpd.conf
    ```
6. Delete the content present in the default configuration file and replace it with the example below:
    ```
    # Change RANDOMSTRINGGOESHERE to your preferred SNMP community string
    com2sec readonly  123.123.123.123         RANDOMSTRINGGOESHERE
    group MyROGroup v2c        readonly
    view all    included  .1                               80
    access MyROGroup ""      any       noauth    exact  all    none   none

    syslocation "Paris, France"
    syscontact Your Name <your@email.address>

    #Distro Detection
    extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro
    ```

    Edit the file to meet your requirements, the meaning of the different lines is explained below:
      - `com2sec readonly 123.123.123.123 RANDOMSTRINGGOESHERE` - This line maps a security string to a community name. A security string is an access policy, an IP address limitation (replace `123.123.123.123` with the IP address of the LibreNMS Instance), and a community name (replace `RANDOMSTRINGGOESHERE` with the community name configured during the installation of LibreNMS).
      - The line `group MyROGroup v2c readonly` maps a group (`MyROGroup`) to a security name (`v2c readonly`).
      - The line `view` defines a subset of which information from the [MIB](https://en.wikipedia.org/wiki/Management_information_base) is visible when polling the device via SNMP
      - With the line `access MyROGroup "" any noauth exact all none none` access rules are tied to the group set before. In this example it means that the group `MyROGroup` can, in any context (""), access the data over any version of the protocol (`any`), without authentication (`noauth`), matching the exact context (`exact`), allowing access to all view rules (`all`). No write (`none`) or modify access (`none`) is permitted.
      - `syslocation “Paris, France”` is pretty self-explanatory and specifies the geographical location of the machine.
      - `syscontact Your Name <your@email.address>` defines the administrative contact for the machine.
      - The last line is used to communicate the distribution information collected by `distro` via SNMP

    Edit the values in the file to your needs before saving it and exiting the editor.
7. Restart the SNMP service:
    ```
    systemctl restart snmpd.service
    ```
8. Add the device to LibreNMS by clicking on **Devices**, then **Add Device** in the pop-up menu from within the LibreNMS web interface.
9. Enter the hostname of the device, keep **SNMP** on, leave the values for **SNMP version** and **Port Association Mode** as preset. Enter the community name set in the file `/etc/snmp/snmpd.conf` as value for **Community**. Once all values are set, click **Add Device** to add the device.
10. LibreNMS starts polling the device and creating different graphs showing the status of the device:
    <Lightbox image={image7} alt="" />

For more information about the configuration options of SNMP, refer to the [official documentation](https://manpages.ubuntu.com/manpages/lunar/en/man5/snmpd.conf.5.html). You may also refer to the [official LibreNMS documentation](https://docs.librenms.org/).