Python Plugin : Synology via SNMP

Python and python framework

Moderator: leecollings

Post Reply
User avatar
JayDotR
Posts: 58
Joined: Thursday 02 January 2025 21:15
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Luxembourg
Contact:

Python Plugin : Synology via SNMP

Post by JayDotR »

Hi, I used to use xofor's Synology Plugin for a long time, the migration from bookworm to trixie made me realize that pysnmp as pip install was no longer a good choice. So, I rewrote the plugin from scratch and I want to share it with the community.

Code: Select all

Domoticz-Synology-SNMP : A Domoticz plugin that monitors a Synology NAS through the native net-snmp command line tools (snmpget, snmpbulkwalk, snmpwalk).

No pysnmp, no Python packages at all. The only dependency is the snmp package of your distribution. The hardware is detected, not configured. Number of drives, storage pools, volumes, network ports, UPS, fans, SSD cache, expansion units: read from the NAS, turned into Domoticz devices. 
No "DSM OID" setting, no interface numbers, no disk count.
Never blocks Domoticz. Polling runs in a background thread; a slow or dead NAS cannot stall the plugin thread.
Modular. Parser, SNMP client, one collector per hardware area, engine and Domoticz glue are separate modules. 
A new area is one new file.

Therefore get your copy by a git clone https://github.com/janreimen/Domoticz-Synology-SNMP
Latest Release 0.2.0 is out
--
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
User avatar
JayDotR
Posts: 58
Joined: Thursday 02 January 2025 21:15
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Luxembourg
Contact:

Re: Python Plugin : Synology via SNMP

Post by JayDotR »

Domoticz-Synology-SNMP v0.2.3 is out! Image

A new release (v0.2.3) of the Synology SNMP plugin for Domoticz is now available. This update brings major improvements to scheduling precision, failure handling, resilience against dead devices or network drops, plus new health monitoring features and security hardening.

Here is a summary of what has changed:

Fixed & Improved
  • Scheduling & Timing: Fixed tick interval drift (schedules are now correctly measured from cycle start instead of finish) and ensured unbuilt collectors (like GPU) don't incorrectly speed up the polling loop.
  • Resilience & Error Handling: A table that stops answering no longer brings the whole NAS down during polling or hardware detection. Failed collectors now properly trigger stale/red device states instead of endlessly echoing stale cached values as fresh.
  • UI & Data Handling: Deleted devices in the Domoticz UI are properly recreated when needed, and `.env` parsing has been robustly improved (handling inf, inline comments, BOMs, and reporting misspelled keys).
  • Security: Warnings added for secrets passed via `--verify-args` (preventing credentials from showing up in shell histories and process lists), along with cleanup of orphaned private temporary directories after unexpected process termination.
Added
  • Health & Diagnostics: New Plugin Health and Poll Duration devices (which continue writing even while the NAS is down) and back-off handling for failing collectors.
  • SNMPv3 & Configuration: Support for SNMPv3 privacy passphrases as a password field (Mode4), plus new configuration options for timeouts, retries, and discovery/refresh intervals via `.env`.
  • Documentation & Tests: The test suite has expanded significantly (from 118 to 242 tests), and documentation (`ROADMAP`, `SECURITY`, `DEPLOY`, `CONTRIBUTING`) has been fully updated.
You can check out the full release and download the package on the GitHub Releases page. As always, feedback and bug reports are welcome!
--
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
Post Reply