Synology check: allow complete check or single check(s)
Compare changes
+ 239
− 149
@@ -3,7 +3,8 @@
@@ -3,7 +3,8 @@
@@ -11,10 +12,10 @@
@@ -11,10 +12,10 @@
# https://global.download.synology.com/download/Document/Software/DeveloperGuide/Firmware/DSM/All/enu/Synology_DiskStation_MIB_Guide.pdf
@@ -24,8 +25,9 @@
@@ -24,8 +25,9 @@
@@ -54,13 +56,20 @@ OID_RAIDStatus="${OID_syno}.3.1.1.3"
@@ -54,13 +56,20 @@ OID_RAIDStatus="${OID_syno}.3.1.1.3"
aStatusRaid=( "???" Normal Repairing Migrating Expanding Deleting Creating RaidSyncing RaidParityChecking RaidAssembling Canceling Degrade Crashed DataScrubbing RaidDeploying RaidUnDeploying RaidMountCache RaidExpandingUnfinishedSHR RaidConvertSHRToPool RaidMigrateSHR1ToSHR2 RaidUnknownStatus)
@@ -74,25 +83,39 @@ Institute for Medical Education - University of Bern
@@ -74,25 +83,39 @@ Institute for Medical Education - University of Bern
@@ -104,20 +127,25 @@ CONFIG FILE:
@@ -104,20 +127,25 @@ CONFIG FILE:
@@ -130,7 +158,7 @@ _wd()
@@ -130,7 +158,7 @@ _wd()
@@ -139,12 +167,29 @@ usage()
@@ -139,12 +167,29 @@ usage()
@@ -154,11 +199,28 @@ while getopts a:h:f:v OPTNAME; do
@@ -154,11 +199,28 @@ while getopts a:h:f:v OPTNAME; do
@@ -171,158 +233,186 @@ done
@@ -171,158 +233,186 @@ done
nbDisk="$( $SNMPWALK -OQne -t $SNMPTIMEOUT ${SNMPAUTH} $SNMPTARGET $OID_diskID 2> /dev/null | wc -l )"
nbRAID="$( $SNMPWALK -OQne -t $SNMPTIMEOUT ${SNMPAUTH} $SNMPTARGET $OID_RAIDName 2> /dev/null | wc -l )"
OID_disk="$OID_disk $OID_diskID.$(($i-1)) $OID_diskModel.$(($i-1)) $OID_diskStatus.$(($i-1)) $OID_diskTemp.$(($i-1)) "
OID_RAID="$OID_RAID $OID_RAIDName.$(($i-1)) $OID_RAIDStatus.$(($i-1)) $OID_RAIDSize.$(($i-1)) $OID_RAIDFree.$(($i-1))"
syno=$($SNMPGET -OQne -t $SNMPTIMEOUT ${SNMPAUTH} $SNMPTARGET $OID_model $OID_serialNumber $OID_DSMVersion $OID_DSMUpdateAvailable $OID_systemStatus $OID_powerStatus $OID_systemFanStatus $OID_CPUFanStatus $OID_temp $OID_disk $OID_RAID 2> /dev/null | sed 's/^[ \t]*//;s/[ \t]*$//')
healthString="$healthString, problem with ${diskID[$i]} (model:${diskModel[$i]}) status:${diskStatus[$i]} temperature:${diskTemp[$i]} °C"
_wd "${diskID[$i]} (model:${diskModel[$i]}) status: ${diskStatus[$i]} ($idiskStatus) temperature: ${diskTemp[$i]} °C"
_wd "${RAIDName[$i]} status: ${RAIDStatus[$i]} ($iRAIDStatus) - size $iRAIDSize GB, free $iRAIDFree GB (${iFree}%)"