diff options
Diffstat (limited to 'text_collector_examples')
-rwxr-xr-x | text_collector_examples/smartmon.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/text_collector_examples/smartmon.sh b/text_collector_examples/smartmon.sh index cd121b8..5c8077f 100755 --- a/text_collector_examples/smartmon.sh +++ b/text_collector_examples/smartmon.sh | |||
@@ -102,10 +102,10 @@ parse_smartctl_info() { | |||
102 | esac | 102 | esac |
103 | fi | 103 | fi |
104 | done | 104 | done |
105 | if [[ -n "${model_family}" ]] ; then | 105 | if [[ -n "${vendor}" ]] ; then |
106 | echo "device_info{disk=\"${disk}\",type=\"${disk_type}\",model_family=\"${model_family}\",device_model=\"${device_model}\",serial_number=\"${serial_number}\",firmware_version=\"${fw_version}\"} 1" | ||
107 | elif [[ -n "${vendor}" ]] ; then | ||
108 | echo "device_info{disk=\"${disk}\",type=\"${disk_type}\",vendor=\"${vendor}\",product=\"${product}\",revision=\"${revision}\",lun_id=\"${lun_id}\"} 1" | 106 | echo "device_info{disk=\"${disk}\",type=\"${disk_type}\",vendor=\"${vendor}\",product=\"${product}\",revision=\"${revision}\",lun_id=\"${lun_id}\"} 1" |
107 | else | ||
108 | echo "device_info{disk=\"${disk}\",type=\"${disk_type}\",model_family=\"${model_family}\",device_model=\"${device_model}\",serial_number=\"${serial_number}\",firmware_version=\"${fw_version}\"} 1" | ||
109 | fi | 109 | fi |
110 | echo "device_smart_available{disk=\"${disk}\",type=\"${disk_type}\"} ${smart_available}" | 110 | echo "device_smart_available{disk=\"${disk}\",type=\"${disk_type}\"} ${smart_available}" |
111 | echo "device_smart_enabled{disk=\"${disk}\",type=\"${disk_type}\"} ${smart_enabled}" | 111 | echo "device_smart_enabled{disk=\"${disk}\",type=\"${disk_type}\"} ${smart_enabled}" |
@@ -146,4 +146,4 @@ for device in ${device_list}; do | |||
146 | /usr/sbin/smartctl -i -H -d "${type}" "${disk}" | parse_smartctl_info "${disk}" "${type}" | 146 | /usr/sbin/smartctl -i -H -d "${type}" "${disk}" | parse_smartctl_info "${disk}" "${type}" |
147 | # Get the SMART attributes | 147 | # Get the SMART attributes |
148 | /usr/sbin/smartctl -A -d "${type}" "${disk}" | parse_smartctl_attributes "${disk}" "${type}" | 148 | /usr/sbin/smartctl -A -d "${type}" "${disk}" | parse_smartctl_attributes "${disk}" "${type}" |
149 | done | format_output \ No newline at end of file | 149 | done | format_output |