Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_synology.php

Rating
2 votes
Favoured:
0
Current Version
1.20220329
Last Release Date
2022-03-01
Compatible With
  • Nagios 3.x
  • Nagios 4.x
License
MIT
Hits
5983
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Nagios Plugin to check a Synology NAS over SNMP.
If you find a bug or have a request, write me an email: nagios@jhoerter.com

You need to install php-snmp

NEW

Version 1.20220329
correct debug mode
change mode raid (usage), add name

Version 1.20220218
check raid status correction
Thank's to Antoine


/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m system -t temperatur -w 35 -c 45
Warning - 36.00 °C | Temperatur=36.00;35;45

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m system -t update -c ~2 -w 2
OK - DS720+ , XXXXXXXXXXXXX , DSM 7.0-41222 , Unavailable

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m system -t status
OK - System: OK - Powerstatus: OK - Fan: OK - CpuFan: OK

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m cpu -t usage -w 80 -c 90
OK - 9% (User: 7% System: 2% I/O Wait: 2% Idle: 89%)|Cpu=9%;80;90;; User=7% System=2% IOWait=2% Idle=89%

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m memory -t usage -w 80 -c 90
OK - 40.8% (4092376KB | TOTAL=10031480KB;;;; USED=4092376KB;;;; FREE= 218228KB;;;; CACHES=5720876KB;;;;

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m disk -t status
OK - Normal: 4 - Initalized: 0 - NotInitalized: 0 - SystemPartitionFailed: 0 - Crashed: 0

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m disk -t status -n 2
OK - Disk 2: WD80EFAX-68KNBN0 (SATA) , Normal

/usr/bin/php
Critical - 35.00 °C | Temperatur=35,00;25;30

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m raid -t status -w 1 -c 8
OK - Volume 1: Normal

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m raid -t usage -w 50 -c 90
WARNING - Free: 2432.381 GB , Used: 4717.251 GB , Total: 7149.632 GB| used=4717.251GB;3574.500;6434.100

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m ups -t usage -w 50 -c 25
OK - Charged: 100% (Seconds: 1171) | Charged=100%;50;25;; Seconds=1171

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m service -t CIFS -w 5 -c 10
Warning - CIFS: 9

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 3 -m service -t CIFS -w 5 -c 10 -u nagios -p nagiossnmp -a MD5 -x DES -X nagiossnmp
Warning - CIFS: 9

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m network -V
Array
(
[iso.3.6.1.2.1.31.1.1.1.1.1] => STRING: "lo"
[iso.3.6.1.2.1.31.1.1.1.1.2] => STRING: "sit0"
[iso.3.6.1.2.1.31.1.1.1.1.3] => STRING: "eth1"
[iso.3.6.1.2.1.31.1.1.1.1.4] => STRING: "eth0"
[iso.3.6.1.2.1.31.1.1.1.1.5] => STRING: "ovs-system"
[iso.3.6.1.2.1.31.1.1.1.1.6] => STRING: "ovs_eth0"
[iso.3.6.1.2.1.31.1.1.1.1.7] => STRING: "ovs_eth1"
[iso.3.6.1.2.1.31.1.1.1.1.10] => STRING: "tap080027072e2b"
[iso.3.6.1.2.1.31.1.1.1.1.11] => STRING: "tap080027D5E8A7"
)

/usr/bin/php ./check_synology.php -H 192.168.2.200 -P 2 -C public -m network -t usage -n 3
OK - eth1: In: 0.00% (0.68 KB/s ) - Out: 0.00% (0.00 KB/s) | IN=0.00% OUT=0.00%

/usr/bin/php ./check_synology.php -H 192.168.2.200 -m uptime
OK - 5 days, 18 hours, 7 minutes, 41 seconds

./check_synology.php -H 192.168.2.200 -m disksmart -t status -w 10 -c 50
WARNING - Disksmart [Disk: 1 Reallocated_Sector_Ct(5)=40]

(*) - disksmart is warning if smart id 5 is
greater or equal warning parameter
or critical it is greater or equal critical parameter
- warning if smart id 1 is greater 0 (only Samsung and WD)
- warning if smart id 5 and 197 and 198 are greater 0
Reviews (2)
bymange-cailloux, June 15, 2021
Thank you for this great plugin ! It seems however to have a problem in the raid usage thresholds if i'm not mistaking : when used without warning and critical, it returns ok and print performance data just fine. However, when i use the warning and critical switches, the warning state fires when it should be ok. Currently my raid is at about 40% full, but i get a warning even when i set -w to 50 % and -c to let's say 75 %

php check_synology.php -H xxx -P 3 -u xxx -p xxx -a SHA -x AES -X xxx -m raid -n 1 -t usage -w 50 -c 75
WARNING - Free: 2127.455 GB , Used: 1445.091 GB , Total: 3572.546 GB| used=1445.091GB;1786.273;1607.646;;3572.546

let's go further and use crazy 99-100% values, problem is still there

php check_synology.php -H xxx -P 3 -u xxx -p xxx -a SHA -x AES -X xxx -m raid -n 1 -t usage -w 99 -c 100
WARNING - Free: 2127.342 GB , Used: 1445.205 GB , Total: 3572.546 GB| used=1445.205GB;3536.821;3572.546;;3572.546

Am i missing something or is it a bug ? From what i've read, i should have the right format

Example Critical and Warning procent (Usage)
-w 80 -c 90 = warning > 80% and critical > 90% (raid, cpu, memory)

I hope this message reach you well, and thanks again for the great work !
Owner's reply

I find the problem, please used the new version 1.20210620

bysziloo, March 7, 2021
There was no such plugin, I really missed it in the past. You can get the most useful data from your NAS. And it provides performance data also. Brilliant! Thank you.
I give only for start because there is a small bug: I tried to get RAID usage with a disk size bellow 1TB, with the "-l TB" switch. The answer was: Ctitical: no rade
Owner's reply

I changed the decimal point from comma (german style) to point (international style).
Try to download the new Version 1.20210308