Home Directory

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

Directory

wyang

Reviews(1)
bywyang, January 30, 2019
1 of 1 people found this review helpful
Synology status
--- /usr/lib64/nagios/plugins/check_snmp_synology~ 2018-12-07 19:11:35.231831343 +0000
+++ /usr/lib64/nagios/plugins/check_snmp_synology 2019-01-30 21:23:40.471135880 +0000
@@ -307,3 +307,8 @@
- RAIDName[$i]=$(echo "$syno" | grep $OID_RAIDName.$(($i-1)) | cut -d "=" -f2)
- RAIDStatus[$i]=$(echo "$syno" | grep $OID_RAIDStatus.$(($i-1)) | cut -d "=" -f2 | sed 's/^[ \t]*//;s/[ \t]*$//')
-
+ # modified by William Yang / DataPulse
+ # the regexes below were not anchored on the tail end, which created situations where
+ # a record could contain multiple lines. Caused a lot of heartache. Adding the
+ # anchor [^\.0-9] ensures no subsquent numeral or OID component is matched, causing
+ # the code to be much more resilient. We added 10 volumes one maintenance window,
+ # and we had to track this down....
+ RAIDName[$i]=$(echo "$syno" | grep "$OID_RAIDName.$(($i-1))[^\.0-9]" | cut -d "=" -f2)
+ RAIDStatus[$i]=$(echo "$syno" | grep "$OID_RAIDStatus.$(($i-1))[^\.0-9]" | cut -d "=" -f2 | sed 's/^[ \t]*//;s/[ \t]*$//')
@@ -317,0 +323,2 @@