diff --git a/etc/kayobe/ansible/scripts/smartmon.sh b/etc/kayobe/ansible/scripts/smartmon.sh index 32b3ea81c1..c08c46e60c 100644 --- a/etc/kayobe/ansible/scripts/smartmon.sh +++ b/etc/kayobe/ansible/scripts/smartmon.sh @@ -106,6 +106,7 @@ parse_smartctl_scsi_attributes() { } parse_smartctl_info() { + shopt -s nocasematch local -i smart_available=0 smart_enabled=0 smart_healthy= local disk="$1" disk_type="$2" local model_family='' device_model='' serial_number='' fw_version='' vendor='' product='' revision='' lun_id='' @@ -199,4 +200,4 @@ for device in ${device_list}; do exit ;; esac -done | format_output \ No newline at end of file +done | format_output diff --git a/releasenotes/notes/fix-smartmon-script-db2a38df1b245e58.yaml b/releasenotes/notes/fix-smartmon-script-db2a38df1b245e58.yaml new file mode 100644 index 0000000000..b71a5c4390 --- /dev/null +++ b/releasenotes/notes/fix-smartmon-script-db2a38df1b245e58.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + Fixes the smartmon script to be case insensitive when checking for + the inital SMART info. This is to ensure that the script works + correctly on systems where the output of `smartctl -i` is not + capitalised as previously expected by the script. This leads to + badly formatted .prom files which lead to node_exporter failing to + scrape the file.