# Synology SNMP Network Monitoring with LibreNMS Docker

**URL:** <https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13>\
**Category:** Website Posts\
**Tags:** tutorials, technology\
**Created:** [February 24, 2020, 9:03am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13 "2020-02-24T09:03:52Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [July 22, 2020, 11:34pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/42 "2020-07-22T23:34:52Z")

</div>

Tutorial updated to working 🙂

Details are on the tutorial changelog

> **[Synology SNMP Network Monitoring with LibreNMS Docker - Jason Loong](https://jasonloong.com/blog/synology-snmp-network-monitoring-with-librenms-docker)**
>
> Tutorial for installing LibreNMS (Docker) in Synology

Github Issue details:

> <https://github.com/jarischaefer/docker-librenms/issues/118>
>
> Hi, I am author for https://jasonloong.com/2017/synology-snmp-network-monitoring…-with-librenms-docker/
> 
> been using your image from the beginning, great job and thank you very much!
> 
> Reporting in that the image doesn't work for latest (1.65.1), v1.64
> 
> Tested on Synology 916+ / DSM 6.2.3-25426 (v1.65.1)
> 
> First time discovery works but device is not polled thereafter
> 
> Running poller-wrapper.py gives the follow errors:
> \<img width="933" alt="Screenshot 2020-07-20 at 6 34 43 AM" src="https://user-images.githubusercontent.com/35384630/87887900-aa868a00-ca5b-11ea-9463-800644b088a7.png"\>
> 
> Tested on Ubuntu 18.04.4 VM (v1.65.1, v1.64)
> v1.65.1 - Same error as above
> v1.64 - missing pip3/python modules (sorry, I didn't take a screenshot, took a quick glance)
> v1.63 - works as expected
> 
> All the tested versions run the following docker with changes to the tag at the end, and clearing of all persistent databases/files, containers before a new container
> 
> Docker MariaDB
> \`\`\`
> docker run \\
> \-v /my/path/docker/mariadb-test:/var/lib/mysql \\
> \-e MYSQL\_ROOT\_PASSWORD="rooting" \\
> \-e TZ=Asia/Singapore \\
> \--name mariadb-test \\
> \-d \\
> \--restart always \\
> mariadb:latest \\
> \--sql-mode=''
> \`\`\`
> 
> SQL Database
> \`\`\`
> CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8\_unicode\_ci;
> CREATE USER 'librenms'@'%' IDENTIFIED BY 'libre\_password';
> CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'libre\_password';
> GRANT ALL PRIVILEGES ON librenms.\* TO 'librenms'@'%';
> FLUSH PRIVILEGES;
> exit
> \`\`\`
> 
> LibreNMS container
> \`\`\`
> docker run \\
> \-p 8669:80 \\
> \-e DB\_HOST=db \\
> \-e DB\_NAME=librenms \\
> \-e DB\_USER=librenms \\
> \-e DB\_PASS=libre\_password \\
> \-e APP\_KEY=generated\_key \\
> \-e BASE\_URL=http://IP:8669 \\
> \-e TZ=Asia/Singapore \\
> \--link mariadb-test:db \\
> \-v /my/path/docker/librenms-test/logs:/opt/librenms/logs \\
> \-v /my/path/docker/librenms-test/rrd:/opt/librenms/rrd \\
> \-v /my/path/docker/librenms-test/custom.config.php:/opt/librenms/conf.d/custom.config.php:ro \\
> \--name librenms-test \\
> \-d \\
> \--restart always \\
> jarischaefer/docker-librenms:latest
> \`\`\`

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

### MariaDB

```bash
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

```bash
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

```

---

<div class="post-metadata">

**Author:** ![fatbob01](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/fatbob01/32/65_2.png) [@fatbob01](https://forums.jasonloong.com/u/fatbob01)\
**Post date:** [September 30, 2020, 3:03pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/43 "2020-09-30T15:03:21Z")

</div>

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!

 ![image](https://forums.jasonloong.com/uploads/default/original/1X/ae3dca39f6a91ef847ada11009606ed317bdfe5d.png)

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [September 30, 2020, 3:48pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/44 "2020-09-30T15:48:32Z")

</div>

Hi @fatbob01and welcome to the forums 🙂

> [@fatbob01](#):
>
> The polling issue seems to be fixed but my graphs still don’t show up.

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)

---

<div class="post-metadata">

**Author:** ![fatbob01](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/fatbob01/32/65_2.png) [@fatbob01](https://forums.jasonloong.com/u/fatbob01)\
**Post date:** [September 30, 2020, 8:12pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/45 "2020-09-30T20:12:27Z")

</div>

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

 ![image](https://forums.jasonloong.com/uploads/default/original/1X/320379d33e2789fc37e3e35733fa6b777a057da4.png)

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [October 1, 2020, 4:00am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/46 "2020-10-01T04:00:47Z")

</div>

Thank you for the validation screenshot.

Hm… 🤔 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

---

<div class="post-metadata">

**Author:** ![big\_bud](https://forums.jasonloong.com/letter_avatar_proxy/v4/letter/b/ee59a6/32.png) [@big\_bud](https://forums.jasonloong.com/u/big_bud)\
**Post date:** [February 15, 2021, 9:27am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/47 "2021-02-15T09:27:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [February 15, 2021, 9:39am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/48 "2021-02-15T09:39:03Z")

</div>

Hi @big_bud and thank you 🙂

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/](https://docs.librenms.org/Extensions/Agent-Setup/)

---

<div class="post-metadata">

**Author:** ![big\_bud](https://forums.jasonloong.com/letter_avatar_proxy/v4/letter/b/ee59a6/32.png) [@big\_bud](https://forums.jasonloong.com/u/big_bud)\
**Post date:** [February 15, 2021, 6:48pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/49 "2021-02-15T18:48:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [February 16, 2021, 1:49am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/50 "2021-02-16T01:49:03Z")

</div>

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](https://community.librenms.org/t/hi-everyone-question-about-librenms-and-the-check-mk-agent/56)

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](https://docs.librenms.org/Extensions/Applications/#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](https://forums.jasonloong.com/t/librenms-and-raspberry-pi/32/3))
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 🤔 Let me know if that worked out!

---

<div class="post-metadata">

**Author:** ![JasterMereel](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jastermereel/32/69_2.png) [@JasterMereel](https://forums.jasonloong.com/u/JasterMereel)\
**Post date:** [July 21, 2021, 3:37pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/51 "2021-07-21T15:37:52Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [July 21, 2021, 4:58pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/52 "2021-07-21T16:58:05Z")

</div>

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

```auto
-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

---

<div class="post-metadata">

**Author:** ![JasterMereel](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jastermereel/32/69_2.png) [@JasterMereel](https://forums.jasonloong.com/u/JasterMereel)\
**Post date:** [August 1, 2021, 11:16pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/53 "2021-08-01T23:16:47Z")

</div>

> [@jasonloong](#):
>
> Please also update the permissions on the Syno MariaDB to allow access from the container

Would that be accomplished with this command?

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

```

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [August 1, 2021, 11:20pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/54 "2021-08-01T23:20:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![miknl](https://forums.jasonloong.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@miknl](https://forums.jasonloong.com/u/miknl)\
**Post date:** [October 3, 2023, 7:27pm UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/55 "2023-10-03T19:27:09Z")

</div>

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 😉

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!

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [October 4, 2023, 9:45am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/56 "2023-10-04T09:45:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![miknl](https://forums.jasonloong.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@miknl](https://forums.jasonloong.com/u/miknl)\
**Post date:** [October 4, 2023, 9:56am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/57 "2023-10-04T09:56:16Z")

</div>

Hi!

Yeah I’m pretty sure it uses the latest.

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [October 6, 2023, 1:36am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/58 "2023-10-06T01:36:02Z")

</div>

> [@miknl](#):
>
> Could not open input file: /opt/librenms/includes/sql-schema/update.php

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](https://hub.docker.com/r/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:

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

```

Let me know if v`23.5.0` works on your end

---

<div class="post-metadata">

**Author:** ![miknl](https://forums.jasonloong.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@miknl](https://forums.jasonloong.com/u/miknl)\
**Post date:** [October 6, 2023, 6:53am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/59 "2023-10-06T06:53:38Z")

</div>

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:

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

```

**ADMIN USER COMMAND**  
This command:

```auto
docker exec librenms create_admin

```

Returns this error:

```auto
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:

```auto
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 😉

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [October 7, 2023, 2:41am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/60 "2023-10-07T02:41:11Z")

</div>

@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](https://github.com/jarischaefer/docker-librenms/issues/141)

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

> [@miknl](#):
>
> `sudo -u librenms lnms user:add -p [password] -r admin [username]`

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [October 7, 2023, 2:41am UTC](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13/61 "2023-10-07T02:41:36Z")

</div>

> [@miknl](#):
>
> 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

You can begin to add SNMP enabled devices and monitor them 🙂

[Previous page](https://forums.jasonloong.com/t/synology-snmp-network-monitoring-with-librenms-docker/13.md?page=2)
