From: David Galloway Date: Wed, 25 Nov 2020 15:02:58 +0000 (-0500) Subject: common: smart.sh - sort failure messages X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e75cba2cd3604f0fee4cb33746d77660759c6d51;p=ceph-cm-ansible.git common: smart.sh - sort failure messages Signed-off-by: David Galloway --- diff --git a/roles/common/files/libexec/smart.sh b/roles/common/files/libexec/smart.sh index 332f364..2287a1d 100755 --- a/roles/common/files/libexec/smart.sh +++ b/roles/common/files/libexec/smart.sh @@ -70,8 +70,8 @@ main () # Nagios reads and displays the first line of output on the Services page. # All individual messages about failed/failing disk statistics can be viewed # on the individual system's SMART detail page in nagios. - for msg in "${messages[@]}" - do + readarray -t sorted < <(for msg in "${messages[@]}"; do echo "$msg"; done | sort) + for msg in "${sorted[@]}"; do echo "$msg" done