Synology SNMP Network Monitoring with LibreNMS Docker

Tutorial updated to working :slight_smile:

Details are on the tutorial changelog


Github Issue details:

Latest working, testing, Docker deployment of LibreNMS (fresh install)

MariaDB

docker run \
-v /volume1/docker/mariadb:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=root_password \
-e TZ=Asia/Singapore \
--name mariadb \
-d \
--restart always \
mariadb:latest \
--innodb_file_per_table=1 \
--lower_case_table_names=0

LibreNMS

docker run \
-p 8668:80 \
-e DB_HOST=libredb \
-e DB_NAME=librenms \
-e DB_USER=librenms \
-e DB_PASS=libre_password \
-e APP_KEY=base64:THE_GENERATED_KEY \
-e BASE_URL=http://YOUR_NAS_IP:8668 \
-e TZ=Asia/Singapore \
--link mariadb:libredb \
-v /volume1/docker/librenms/logs:/opt/librenms/logs \
-v /volume1/docker/librenms/rrd:/opt/librenms/rrd \
-v /volume1/docker/librenms/custom.config.php:/opt/librenms/conf.d/custom.config.php:ro \
--name librenms \
-d \
--restart always \
jarischaefer/docker-librenms:latest

Good morning!

Wanted to say i appreciate your librenms setup guide very much. I had setup librenms before the July upgrade. I am trying to fix it. I recreated both containers using the new variables. The polling issue seems to be fixed but my graphs still donā€™t show up. Here is a screenshot of my mariadb container. I read your ticket with jari and the innodb + lower case values fixed your issues. Theyr donā€™t seem to work for me. Running on synology docker. Thanks for the help and good work!

Hi @fatbob01and welcome to the forums :slight_smile:

I am assuming no issues previously for both poller and graphs, let me know if thatā€™s not the case

Have you tried to validate the installation after pulling the new image?? (Page 2 of tutorial)

The validation should tell you to run ./lnms migrate (In Docker bash)

If you run into problems donā€™t forget to copy/paste or screenshot the logs (you can safely ignore the setfcl errors as Synology does not have setfcl)

This is what I get following a config validation. I tried the suggested fixes mentioned in the screenshot but no dice

Thank you for the validation screenshot.

Hmā€¦ :thinking: everything seems to work fine from the validation

Which version are you using, and are you updating to latest libre?

Iā€™ve recently updated to 1.67 from 1.66, you should see ./lnms migrate during validation

You might need to setup a second deployment of my tutorial steps from scratch to see whether it works, as I didnā€™t upgrade from before the new alias/db options. I suspect there might be database mismatches that point to invalid RRD links, thus the missing graphsā€¦

(Do note that this deletes the device RRD graphs) If you have a not-so-important device, could you try to remove that device from LibreNMS and add it back again to see whether the graphs show up?

If you wish to keep the current data, I would recommend setting up a second set of librenms/mariadb with different port. eg: 8669 , and see whether the deployment works from the beginning

Great tutorial, do you also have something how to get de agent (check_mk) to work?

Hi @big_bud and thank you :slight_smile:

Hmm not too sure as I have never used the agent

How far have you been on their docs?? https://docs.librenms.org/Extensions/Agent-Setup/

Agent etc is working but cannot connect to the docker container I think. Need to recreate the container with port 6556 also added but Iā€™m not very sure.

Hm, TCP-6556 is FROM the librenms, so you donā€™t need to open ports on the container side, you would need to check firewall and allow TCP-6556 on the device with the agent.

I came across this: Hi everyone! Question about LibreNMS and the check_mk agent - LibreNMS Community

I would do the following:

  1. Ensure firewall allow on the device with agent
  2. In librenms, under the device with agent, Settings > Modules > Enable Unix Agent (Left of page)
  3. You have to manually allow the apps/modules that you want to monitor on. Application Docs / Agent
  4. On same device page, 3 dots (beside Settings/Gear Icon) , click on Capture, under Discovery, click Run. Check for check_mk logs (screenshot: LibreNMS and Raspberry Pi - #3 by jasonloong)
  5. Do same as above for Poller, and check logs on the check_mk/unix agent

If that still does not work

  1. You have to manually check the scripts provided and make sure they point to correct bin PATH if non-standard Linux like FreeBSD
  2. If Windows: make sure firewall is allowed

Hope that helps :thinking: Let me know if that worked out!

I am going through this tutorial now. I see in the tutorial, you are running MariaDB in another Docker container. However, I already have a MariaDB set up on my Synology.

I see the line below:

ā€“link mariadb:libredb \

I see that creates a link from the MariaDB container to the LibreNMS container. If I donā€™t need this link, how could I modify this command? Or can I just remove it?

Hi @JasterMereel

Yes, please remove the ā€“link mariadb:libredb \ , as it is a convenience command to ā€œlinkā€ hostname of ā€œlibredbā€ to another container called ā€œmariadbā€ which was created in the tutorial

For your case, you should update -e DB_HOST=SYNO.IP \ and other SQL credentials to your MariaDB settings on Syno

-e DB_NAME=librenms \
-e DB_USER=librenms \
-e DB_PASS='libre_password' \

Please also update the permissions on the Syno MariaDB to allow access from the container

Would that be accomplished with this command?

GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'%';

Yes, if you have a different username created for librenms, please update the command accordingly

1 Like

Hi!

Trying your guide, but I must be doing something wrong. I used an existing MariaDB container, but as far as I can tell I have changed the commands appropriately :wink:

When I come to this command:

docker exec librenms setup_database

I get this error:

Could not open input file: /opt/librenms/includes/sql-schema/update.php

Any ideas? Thanks!

Hi @miknl , welcome to the forum

Hmmm. Iā€™ve never seen that before, let me test the tutorial Iā€™ll get back to you again

Are you using the latest tag for LibreNMS?

Hi!

Yeah Iā€™m pretty sure it uses the latest.

Rightā€¦ I have the same issue for latest, 23.9.1, 23.8.1

Will need to write in to the image maintainer jarischaefer/docker-librenms

For a working version, you can use version 23.5.0 (I have tested this as a fresh install on my Syno after your forum post)

jarischaefer/docker-librenms:23.5.0

Adjust the LibreNMS docker command to the following:

docker run \
-p 8668:80 \
-e DB_HOST=libredb \
...
...
--name librenms \
-d \
--restart always \
jarischaefer/docker-librenms:23.5.0

Let me know if v23.5.0 works on your end

Hi!

Thanks! I got it workingā€¦ FYI, I also had to change these steps:

APPKEY COMMAND
Not sure if needed, but I edited the command to use that specific version, like this:

docker run --rm jarischaefer/docker-librenms:23.5.0 generate_key

ADMIN USER COMMAND
This command:

docker exec librenms create_admin

Returns this error:

Could not open input file: /opt/librenms/adduser.php

But I used this method instead: in the Synology Container manager, I opened a terminal window and issued this command:

sudo -u librenms lnms user:add -p [password] -r admin [username]

This worked, and I can now loginā€¦ I have absolutely no idea what to do next hahaha, but Iā€™m sure Iā€™ll figure out how LibreNMS works :wink:

1 Like

@miknl Thanks for the updates and commands!

I assumed it would work on my end for 23.5.0, sorry about that.

Further: When run docker exec docker-librenms create_admin Ā· Issue #141 Ā· jarischaefer/docker-librenms Ā· GitHub

The actual working tag when I updated my tutorial was 23.5.0-1 (using latest at that time)

23.5.0-1

  • fully tested as per tutorial page 1

Useful commands (Manual)

  • If you encounter any errors when creating a user, one alternative method is to use LibreNMSā€™s CLI command lnms to manually add a user

You can begin to add SNMP enabled devices and monitor them :slight_smile: