Browse Source

Fix to #4968, custom recipients were not working properly (#4978)

##### Summary
Fixes #4968 
The custom recipient variable substitution wasn't working properly

##### Component Name
health notifications

##### Additional Information
Chris Akritidis 6 years ago
parent
commit
eef866e721
1 changed files with 2 additions and 3 deletions
  1. 2 3
      health/notifications/alarm-notify.sh.in

+ 2 - 3
health/notifications/alarm-notify.sh.in

@@ -592,11 +592,10 @@ for method_name in ${method_names} ; do
         # don't send a notification for this role
         [ "${x}" = "silent" -o "${x}" = "disabled" ] && continue
 
-        role_recipients_var="role_recipients_${method_name}"
-        role_recipients=${!role_recipients_var}
+        role_recipients="role_recipients_${method_name}[$x]"
         default_recipient_var="DEFAULT_RECIPIENT_${method_name^^}"
 
-        a="${role_recipients[${x}]}"
+        a="${!role_recipients}"
         [ -z "${a}" ] && a="${!default_recipient_var}"
         for r in ${a//,/ } ; do
             [ "${r}" != "disabled" ] && filter_recipient_by_criticality ${method_name} "${r}" && arr_var[${r/|*/}]="1"