From e75cba2cd3604f0fee4cb33746d77660759c6d51 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Wed, 25 Nov 2020 10:02:58 -0500 Subject: [PATCH] common: smart.sh - sort failure messages Signed-off-by: David Galloway --- roles/common/files/libexec/smart.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/common/files/libexec/smart.sh b/roles/common/files/libexec/smart.sh index 332f3647..2287a1d4 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 -- 2.47.3