Skip to content
Snippets Groups Projects
Commit 2ffe42ed authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

no raid size check (DSM 5.x)

parent e12bd0bc
Branches
No related tags found
1 merge request!82no raid size check (DSM 5.x)
......@@ -4,6 +4,7 @@
# 08.08.2020 Axel Hahn: add update, community string
# 03.05.2023 v1.2 Axel Hahn: support Snmpv3 connections
# 09.05.2023 v1.3 Axel Hahn: allow complete check or single check(s)
# 12.05.2023 v1.4 Axel Hahn: no raid size check (DSM 5.x)
# ----------------------------------------------------------------------
# this plugin check the health of your Synology NAS
# - System status (Power, Fans)
......@@ -11,7 +12,7 @@
# - RAID status
# - available updates
#
# Tested with DSM 6.2 + 6.4 + 7.1
# Tested with DSM 5.2 ... 6.2 ... 6.4 ... 7.1
# ----------------------------------------------------------------------
# see docs:
# https://global.download.synology.com/download/Document/Software/DeveloperGuide/Firmware/DSM/All/enu/Synology_DiskStation_MIB_Guide.pdf
......@@ -23,7 +24,7 @@
# --- basic vars
self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] )
self_APPVERSION=1.2
self_APPVERSION=1.4
SNMPOUTPUT=
option_found=0
......@@ -410,7 +411,6 @@ if [ $FLAG_DISK -ne 0 ]; then
iRAIDSize=$(( $(_get $OID_RAIDSize.$(($i-1))) / 1024/1024/1024 ))
iRAIDFree=$(( $(_get $OID_RAIDFree.$(($i-1))) / 1024/1024/1024 ))
iFree=$(( iRAIDFree*100/$iRAIDSize ))
RAIDStatus[$i]=${aStatusRaid[${iRAIDStatus}]}
if [ "$iRAIDStatus" != "1" ] ; then
......@@ -418,7 +418,18 @@ if [ $FLAG_DISK -ne 0 ]; then
ph.setStatus "critical"
_add_status "RAID status: ($RAIDName ): $RAIDStatus[$i] "
fi
_wd " ${RAIDName[$i]} status: ${RAIDStatus[$i]} ($iRAIDStatus) - size $iRAIDSize GB, free $iRAIDFree GB (${iFree}%)"
# size in integer GB
if _get $OID_RAIDSize.$(($i-1)) | grep "[0-9]" >/dev/null;
then
iRAIDSize=$(( $(_get $OID_RAIDSize.$(($i-1))) / 1024/1024/1024 ))
iRAIDFree=$(( $(_get $OID_RAIDFree.$(($i-1))) / 1024/1024/1024 ))
iFree=$(( iRAIDFree*100/$iRAIDSize ))
_wd " ${RAIDName[$i]} status: ${RAIDStatus[$i]} ($iRAIDStatus) - size $iRAIDSize GB, free $iRAIDFree GB (${iFree}%)"
else
_wd " ${RAIDName[$i]} status: ${RAIDStatus[$i]} ($iRAIDStatus) - (size not available)"
fi
done
if [ $DISKOK -eq 1 ]; then
......
......@@ -12,7 +12,7 @@ Start the script without parameter to get the help.
______________________________________________________________________
CHECK_SNMP_SYNOLOGY
v1.2
v1.4
Based on script of Nicolas Ordonez.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment