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

Merge branch '6361-fix-ceph-io' into 'master'

no raid size check (DSM 5.x)

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