#Docker: Network monitoring with Docker-compose #LibreNMS environment stack

By | April 23, 2017

I started from a great post Monitoring your Ubiquiti home-network with a Docker LibreNMS and SNMP, to make my own network monitor where to gather all the network devices SNMP messages.

Because I like docker compose files to start up all my components and I want to use a separate docker mysql I made the following derived setup.

STEP 1: Create the librenms and database services

I created a librenms directory under which the following docker-compose.yml file is placed:

The yml file defines a mysql database and links a librenms container to it.
Librenms will be accesible on port 80 exported on localhost.

STEP 2: Start the environment

Change directory to the librenms directory containing the docker-compose.yml file and execute:

Checking with “docker ps” we can see the started containers:

STEP 3: Initialize librenms

Create the librenms tables:

Create an initial admin user:

STEP 4: Open librenms ports in the firewall

So on RedHat/CentOS/Fedora that uses firewalld do the following.

Find the active zones.

Then open the ports and esp protocol in the active zone.

STEP 5: Force librenms autodiscovery

To trigger autodiscovery of all supported devices run the following:

You can also add devices by hand from Add

STEP 6: Enjoy monitoring your devices
Make sure to set SNMP agents in devices that have one. Printers by default send snmp info so they will be found by the scan.
For the HP switches and EdgeRouter devices I had to set the snmp agents to point to the LibreNMS server.