Synology SNMP Network Monitoring with LibreNMS Docker
Posted On
2017 Dec 09
almost 7 years ago
Updated On
2023 Oct 07
about 1 year ago
Afterword
Thank you for reading!
Hope this tutorial was helpful to anyone looking to deploying an NMS to monitor devices, be it for personal home or business use
As of current, I have a production LibreNMS installed precisely as written in this tutorial, ready to alert our telco's NOC department when a monitored business line is suffering from downtime
You can contact me by leaving a comment on this site via Discourse or Discord server @
What follows are my thoughts and experiences
Why Docker?
Packaged Web Server
Go through
This tutorial was written at that point in time when I was still new to Terminals and Linux. Since then I have already stepped up my installation to a 3 point distributed LibreNMS setup
The best part? I am still using Docker containers
Using jarischaefer's image has helped a great deal as the image already contains the web server, RRD and memcached installed and working properly. Thank you jarischaefer!
Multiple Containers in a Single Host
Using Docker also has its other merits, looking at my tutorial screenshots, you can see that I am doing a fresh test install of MariaDB/LibreNMS under mariadb-test/librenms-test
on different ports
What this means is that, you can actually run more than one LibreNMS/MariaDB containers on the same host
This 'host' can be a machine (Server, Computer & Laptop), Synology NAS (this tutorial) or a Virtual Machine
If you are here, you've probably seen the rise of Docker/Kubernetes/Stacks etc
With Docker we can deploy X number of Containers with different settings, depending on your host performance of course
Taking this tutorial, for example, I could set up:
x1 LibreNMS-1 running on port 8668 x1 MariaDB-1 for Libre8668
and another
x1 LibreNMS-2 running on port 8669 x1 MariaDB-2 for Libre8669
All running in one host (Synology), and still have room to spare for other containers
One Point of Failure?
Whether you would want this setup or not, is entirely up to your budget, organization, policies, performance and the number of SNMP devices you wish to monitor
Home Use
- Tighter Budget or use what is already available
- Very narrow WAF (Wife Acceptance Factor) range to play with ;)
- Works best with x1 Server or x1 NAS capable of running Docker
Homelabbers
- You are probably running some crazy stuffs already like netdata, Prometheus, Grafana, ELK
- Spin a VM up just for LibreNMS/MariaDB
- Or, since we are using Docker, run it with another Debian/Linux host to save some vCPU
SMBs/Enterprises
You might not even be here in the first place :) If you are looking for an Open Source solution, reach out to the LibreNMS team for professional support. Or donate to the team once you have set up your NMS systems
You will most probably NOT want to use this tutorial to deploy LibreNMS in a production environment
Deploying their official instructions will give you automatic updates and not rely on a 3rd party Docker Image
If you still want to deploy via Docker, use LibreNMS's
Planning & Setting ahead
If you are new to all of this and just starting out (which we all do at some point), it is very important that you take some time to plan ahead and also know what to expect
Networking
Get your server/NAS properly communicating with other devices first!
Local Networks
Home / Homelab environments are usually local networks. If you have VLANs on them, ensure you've properly configured Inter-VLAN routing between them. Complicated word, just means configure your firewall to allow packets from one VLAN to another VLAN. Period. (The usual firewall ruling apply)
Remote & VPNs & Routers
Usually recommended to setup VPN in the router level, so that your devices behind the router can communicate with a remote server via VPN without setting up a VPN client
Home / Testing Use
If you want to see what LibreNMS or SNMP, in general, has to offer, following this tutorial as written with minimum hardware will most definitely work
- Hardware
- A server (or NAS with docker capabilities)
- Device to monitor
- The server itself that runs LibreNMS
Production Use
"Production"? Just means for serious, non-testing, stable working environments. However you want to use this for home or business, it doesn't matter. You will need to properly set up your systems and already have a basic/firm knowledge of networking.
As written in the post, most problems happen with networking itself, not the installation of LibreNMS via Docker, with containers being easy to deploy
Some tips & hints
-
Resist the need to upgrade every time! Read the changelog for major changes/updates that are relevant to your system/setup before upgrading
-
Use a fixed version image on your containers to prevent any problems due to update. If a hardware failure happens, your saved Docker run commands will most definitely work again. But if you were to use the latest tag, your previous Docker run commands, configurations/settings might not be compatible with the latest image, as compared to your initial configuration (say, 6months to a year ago)
-
Eg: Use a stable fixed tag MySQL/MariaDB image rather than the latest tag
Set, Analyze & Forget
During my initial successful setup, it became a daily routine to check LibreNMS by opening the mobile myLibreNMS app. Setup your notifications/alerts properly, and you won't need to visit the LibreNMS GUI as much (or maybe deep down I want something to happen...?)
Other than waiting on the graphs to fill and producing some eye candy, monitoring my devices did help me in the following:
- Alert when a device goes down
- When one of the APs at home goes down due to someone switching it off and forgetting to turn it back on, resulting in poor home Wi-Fi reception
- Alert/notification kicks in, and provided instructions to family members to switch on the AP... all while I'm overseas
- When one of the APs at home goes down due to someone switching it off and forgetting to turn it back on, resulting in poor home Wi-Fi reception
- Alert when a business line goes down
- Whenever a business line is down for 30minutes, an email gets sent automatically to the NOC department, with an internal company email sent to notify staffs about the imminent downtime. Recovery email gets sent to notify NOC and staffs that the line is back up
- Alert when your storage is almost full
- For those sensitive Linux systems before havoc sets in
- Re-evaluate whether your device is having a rough/tough time
- Temperatures
- CPU, RAM, Storage
- UPS load
Discourse Memory on DigitalOcean Droplet Swap
If you found this tutorial to be useful, your comments or are most appreciated!
Stuck and need help/pointers with this tutorial? Comment in the forum powered by Discourse