https://github.com/wernerfred/check_synology
This plugin will check a lot of different values on your Synology DiskStation.
https://github.com/wernerfred/check_synology
icinga2 icinga2-plugin monitoring-plugin nagios python3 snmpv3 synology synology-diskstation
Last synced: 5 months ago
JSON representation
This plugin will check a lot of different values on your Synology DiskStation.
- Host: GitHub
- URL: https://github.com/wernerfred/check_synology
- Owner: wernerfred
- License: mit
- Created: 2018-09-13T09:45:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-11T08:05:30.000Z (over 2 years ago)
- Last Synced: 2024-03-12T08:57:00.764Z (over 2 years ago)
- Topics: icinga2, icinga2-plugin, monitoring-plugin, nagios, python3, snmpv3, synology, synology-diskstation
- Language: Python
- Homepage:
- Size: 80.1 KB
- Stars: 15
- Watchers: 3
- Forks: 24
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# check_synology [](https://github.com/wernerfred/check_synology/releases)
## About
A monitoring plugin for checking different values on a Synology DiskStation,
compatible with Nagios and Icinga.
The plugin was tested successfully with DS214play, DS215j, DS216+, DS218 and
DS718+ models. For communication, it uses `SNMPv3` with `MD5` + `AES`.
If you want to add a missing check or another value, you are most welcome to
submit a patch / pull request. As a reference for discovering the right
MIBs / OIDs, please have a look at the official [Synology DiskStation MIB Guide].
## Setup
`check_synology` is based on the [easysnmp] SNMP library, which is a binding to
the [Net-SNMP package]. You might need to install the corresponding packages on
your operating system.
An example to invoke the installation on a Debian-based system is:
```shell
apt install --yes libsnmp-dev snmp-mibs-downloader
pip install git+https://github.com/wernerfred/check_synology
```
## Usage
```shell
check_synology --help
```
```shell
check_synology
usage: check_synology [-h] [-w W] [-c C] [-t T] [-r R] [-p PORT] [-e PROTOCOL] hostname username authkey privkey {load,memory,disk,storage,update,status}
```
A custom port can be specified by using `-p`. The default value is `161`.
A custom privacy protocol can be specified by using `-e`. The default value is `AES128`.
Custom timeouts (`-t`) and retries (`-r`) can be specified by using `-t` and `-r` respectively. The default values are `-t 10` and `-r 3`.
### Available modes
| mode | description | warning/critical |
| :-----: |----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| load | Checks the load1, load5 and load15 values | if more than w/c in int (only load1) |
| memory | Checks the physical installed memory (unused, cached and total) | if less usable than w/c in % |
| disk | Detects and checks all disks (status, temperature, health status) | if status is "SystemPartitionFailed" or "Crashed", will trigger CRITICAL
if temperature is higher than w/c in °C, will trigger WARNING/CRITICAL
if health status is "Warning", will trigger WARNING, if health status is "Critical" or "Failing", will trigger CRITICAL |
| storage | Detects and checks all disks (free, total, %) | if more used than w/c in % |
| update | Shows the current DSM version and if DSM update is available | if update is "Unavailable", will trigger OK
if update is "Available", will trigger WARNING
otherwise: UNKNOWN |
| status | Shows model, s/n, temp and status of system, fan, cpu fan and power supply | if temp higher than w/c in °C |
## Example check
```shell
check_synology hostname snmp_user auth_key priv_key load
OK - load average: 1.48, 1.71, 1.74 | load1=1.48c load5=1.71c load15=1.74c
```
## Icinga 2 integration
For integrating the check program into Icinga 2, you can use the configuration files
in the ``icinga2`` subdirectory. You can easily acquire the files using:
```shell
wget https://raw.githubusercontent.com/wernerfred/check_synology/master/icinga2/synology-command.conf
wget https://raw.githubusercontent.com/wernerfred/check_synology/master/icinga2/synology-services.conf
wget https://raw.githubusercontent.com/wernerfred/check_synology/master/icinga2/synology-host.conf
```
In order to put the `check_synology` program at the right location aligned with the
definition within `synology-command.conf`, regardless where it has been installed
on your system, use:
```shell
ln -s $(which check_synology) /usr/lib/nagios/plugins/check_synology
```
## Development
For setting up a development sandbox, you might want to follow this walkthrough.
Acquire sources:
```shell
git clone https://github.com/wernerfred/check_synology
cd check_synology
```
Install program in development mode into a Python virtual environment:
```shell
python3 -m venv .venv
source .venv/bin/activate
pip install --editable=.
```
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

KreativeKrise
💻

Nicolai
💻 📦

Byolock
💻 🐛

Andreas Motl
💻 🤔 💡

Thomas Galliker
💻

Kraeutergarten
📓

jebabin
📖

KreativeKrise
💻

Nicolai
💻 📦

Byolock
💻 🐛

Andreas Motl
💻 🤔 💡

Thomas Galliker
💻

Kraeutergarten
📓

jebabin
📖

Kent Coble
🔌

Tobias Knipping
💻

fibberblank
💻

dropthemic
💻

Christian Gut
💻

bigitag
💻

Julian Petri
💻
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
[easysnmp]: https://pypi.org/project/easysnmp/
[Net-SNMP package]: http://www.net-snmp.org/
[Synology DiskStation MIB Guide]: https://global.download.synology.com/download/Document/MIBGuide/Synology_DiskStation_MIB_Guide.pdf