Search Exchange

Search All Sites

Nagios Log Server Now Available - Download Now

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

Synology status

Bookmark and Share

Rating
15 votes
Favoured:
3
Current Version
1.3
Last Release Date
2014-10-03
Compatible With
  • Nagios 3.x
E-mail
Hits
34770
Files:
FileDescription
synology_nagios_plugin.shnagios plugin
this plugin check the health of your Synology NAS
- System status (Power, Fans)
- Disks status
- RAID (Volume) status
You just need to active SNMP on your NAS.

Control Panel -> SNMP:
-enable SNMP service
-enable SNMPv1, SNMPv2 service
Community: public

Then you can run:
./check_snmp_synology -h [hostname or ip] (-v)

Tested on:
-Synology DS212j
-Synology DS213+
-Synology DS812
-Synology DS1511+
-Synology DS1813+
-Synology DS2411+
-Synology DS2413+

with DSM 4.2 & 4.3


Thanks Thomas W. & Jur Groen for contrib
Reviews (11)
Good plugin, works well!

I added a few things to the plugin:

- Read DSM update status, flags a warning when DSM is out of date
- Connects via SNMP v3 (more secure)
- When using verbose mode the plugin will now first output the device status. This give you a better oversight in the WebUI.

Script can be find here: http://pastebin.com/THUfEuNy

Have fun :)
I don't suppose someone could show me their entry into the .cfg file they use please ?
Still new to this and would really like to monitor the DiskStation in our office.
Thank you.
bySnafoo, July 9, 2014
Works as advertised.

Any advice on making the complete verbose output display in Nagios?
... so that I can see it in the host list?

Thank you for any hint!

Kind regards
Mirko
bybart, March 6, 2014
I have tested it with DS1511+ and DSM4.3 and it works (you can update your testes list if you like).

I have 1 disk marked as hot spare, which has status Initialized, which is fine. The script reported this as Critical in Nagios so I modified it not to do that.

Thanks for the script!

Cheers
I must agree with user rrubel: considering a non initialized hot spare as a critical error is just plain wrong. So thanks go to user mtominsk for pointing out the lines of code that needed to be changed.

And just to be fair with all respect to the Nagios Plugin Developing Guideline: this check totally lacks a critical and a warning switch which would really make sense when monitoring temperatures.

So I really cannot consider this as a "good" nagios plugin, only average, because I cannnot define any limits. But it is still a good starting point for people who do not fear bash scripts.

Sadly, the author does not seem to be very active so be prepared to make your own changes to the script.

Successfully tested and used on Ubuntu 10.04.4 TLS with Nagios Core 3.2 and a Synology RS3412RPxs in Cluster-Mode.
bych, October 31, 2013
Unfortunately i didn't get ist to work.
a-team@nagios:/usr/lib/nagios3$ ./check_synology -h shiva
./check_synology: line 29: syntax error near unexpected token `('

The line 29 in the script is:
./check_synology: line 29: `OID_RAIDStatus="1.3.6.1.4.1.6574.3.1.1.1" usage() {'
OID_RAIDStatus="1.3.6.1.4.1.6574.3.1.1.1" usage() {

It would be nice if anybody can give advise.
bymtominsk, October 14, 2013
1 of 1 people found this review helpful
Very useful plugin. Because Synology changed the way how spare disks are handled, I had to make some changes regarding the "initialized" Status which is interpreted as critical. Here are my changes on your script, maybe useful for one or two:
if [ "${diskStatus[$i]}" != "1" ] && [ "${diskStatus[$i]}" != "2" ] ; then
# if [ "${diskStatus[$i]}" = "2" ] ; then diskStatus[$i]="Initialized"; fi
if [ "${diskStatus[$i]}" = "3" ] ; then diskStatus[$i]="NotInitialized"; fi
if [ "${diskStatus[$i]}" = "4" ] ; then diskStatus[$i]="SystemPartitionFailed"; fi
if [ "${diskStatus[$i]}" = "5" ] ; then diskStatus[$i]="Crashed"; fi
healthStatus=2
healthString="$healthString, problem with ${diskID[$i]} (model:${diskModel[$i]}) status:${diskStatus[$i]} temperature:${diskTemp[$i]} C "
elif [ "${diskStatus[$i]}" = "2" ] ; then diskStatus[$i]="Initialized";
else
diskStatus[$i]="Normal"
fi
if [ "$verbose" = "yes" ] ; then echo "${diskID[$i]} (model:${diskModel[$i]}) status:${diskStatus[$i]} temperature:${diskTemp[$i]} C" ; fi
done
byGldRush98, June 13, 2013
1 of 1 people found this review helpful
Great plugin! Checks all of the vital statistics and properly returns status codes to Nagios. All it took to get working was turning SNMP on in the Synology settings.
byld50, May 28, 2013
1 of 1 people found this review helpful
If you're using FreeBSD (maybe OS X) as Nagios server there are a few changes that are needed to get this working.

First change the location of bash, snmpwalk and snmpget in the file.

bash is located /usr/local/bin/bash
snmpwalk /usr/local/bin/snmpwalk
snmpget /usr/local/bin/snmpget

FreeBSD uses 'jot' instead of 'seq' so
change all occurrences of seq to jot.

Jot has a slightly different syntax.

e.g. change line 76
for i in `seq 1 $nbDisk`;
to
for i in `jot - 1 $nbDisk`;


mh
byrrubel, May 1, 2013
2 of 4 people found this review helpful
This tool provides pretty much all the status information you can get from your Synology box when run in Verbose mode, or has a nice single-line summary in normal mode. I'm using this on an 1812+.

Two comments though:

-- the location of snmpwalk and snmpget are hard-coded into the script so the script won't run if your system installs them in a different location, and there's not a good error message telling you they can't be found. I replaced those lines with a call to 'which snmpwalk' and 'which snmpget' which will at least pick up a version somewhere on your path.

-- The section that monitors disk health is too strict when determining status. Drives that are set up as hot spares don't have to be "normal" -- they can be just initialized or even uninitialized and not be considered a failed unit. I had to modify that section as well to prevent critical failures due to the hot spare drives. At the least, those shouldn't be critical errors.

Otherwise, this is a useful and informative plugin.