From 878528b859263308264f76b07c7bb3576bc93355 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Fri, 24 Aug 2012 18:23:30 -0300 Subject: [PATCH] Fixed report_fio_minus_a and fio_status_minus_a to handle ioMemory and report internal temp, also fixed some bugs --- lib/bash/collect_system_info.sh | 8 ++++--- lib/bash/report_system_info.sh | 4 +++- t/lib/bash/report_system_info.sh | 33 ++++++++++++++++++++++++-- t/pt-summary/samples/Linux/004/fio-001 | 2 ++ t/pt-summary/samples/Linux/004/fio-002 | 1 + t/pt-summary/samples/Linux/004/fio-003 | 4 ++++ 6 files changed, 46 insertions(+), 6 deletions(-) diff --git a/lib/bash/collect_system_info.sh b/lib/bash/collect_system_info.sh index 28593629..20a3753f 100644 --- a/lib/bash/collect_system_info.sh +++ b/lib/bash/collect_system_info.sh @@ -169,23 +169,25 @@ fio_status_minus_a () { $adapter =~ tr/ /:/; $adapter .= "::" . scalar(@adapters); # To differentiate two adapters with the same name push @adapters, $adapter; - my ($connected_modules) = /Connected ioDimm modules?:\s*\n(.+?\n)\n/smg; + my ($connected_modules) = /Connected \S+ modules?:\s*\n(.+?\n)\n/smg; my @connected_modules = $connected_modules =~ /\s+([^:]+):.+\n/g; print "${adapter}_general $adapter_general"; print "${adapter}_modules @connected_modules"; for my $module (@connected_modules) { - my ($attached, $general, $firmware, $media_status) = / + my ($attached, $general, $firmware, $temperature, $media_status) = / ^ \s* $module \s+ (Attached[^\n]+) \n \s+ ([^\n]+) \n # All the second line .+? (Firmware\s+[^\n]+) \n - .+? (Media \s+ status:[^\n]+) + .+? (Internal \s+ temperature:[^\n]+) \n + .+? ((?:Media | Reserve \s+ space) \s+ status:[^\n]+) /xsm; print "${adapter}_${module}_attached_as $attached"; print "${adapter}_${module}_general $general"; print "${adapter}_${module}_firmware $firmware"; print "${adapter}_${module}_media_status $media_status"; + print "${adapter}_${module}_temperature $temperature"; } } while <>; diff --git a/lib/bash/report_system_info.sh b/lib/bash/report_system_info.sh index a1664706..c6fcb9c1 100644 --- a/lib/bash/report_system_info.sh +++ b/lib/bash/report_system_info.sh @@ -891,7 +891,8 @@ report_fio_minus_a () { local adapters="$( get_var "adapters" "$file" )" for adapter in $( echo $adapters | awk '{for (i=1; i<=NF; i++) print $i;}' ); do - name_val "$(echo "$adapter" | sed 's/:/ /' | sed 's/::[0-9]*$//')" "$(get_var "${adapter}_general" "$file")" + local adapter_for_output="$(echo "$adapter" | sed 's/::[0-9]*$//' | tr ':' ' ')" + name_val "$adapter_for_output" "$(get_var "${adapter}_general" "$file")" local modules="$(get_var "${adapter}_modules" "$file")" for module in $( echo $modules | awk '{for (i=1; i<=NF; i++) print $i;}' ); do @@ -900,6 +901,7 @@ report_fio_minus_a () { name_val "$module" "$(get_var "${adapter}_${module}_attached_as" "$file")" name_val "" "$(get_var "${adapter}_${module}_general" "$file")" name_val "" "$(get_var "${adapter}_${module}_firmware" "$file")" + name_val "" "$(get_var "${adapter}_${module}_temperature" "$file")" name_val "" "$(get_var "${adapter}_${module}_media_status" "$file")" local NAME_VAL_LEN=$name_val_len_orig; done diff --git a/t/lib/bash/report_system_info.sh b/t/lib/bash/report_system_info.sh index 0bc75242..6f7d384d 100644 --- a/t/lib/bash/report_system_info.sh +++ b/t/lib/bash/report_system_info.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -plan 52 +plan 53 . "$LIB_DIR/alt_cmds.sh" . "$LIB_DIR/log_warn_die.sh" @@ -1588,10 +1588,12 @@ cat < "$PT_TMPDIR/expected" fct0 | Attached as 'fioa' (block device) | Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06665 | Firmware v5.0.7, rev 101971 + | Internal temperature: 47.7 degC, max 48.2 degC | Media status: Healthy; Reserves: 100.00%, warn at 10.00% fct1 | Attached as 'fiob' (block device) | Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06478 | Firmware v5.0.7, rev 101971 + | Internal temperature: 42.8 degC, max 47.7 degC | Media status: Healthy; Reserves: 100.00%, warn at 10.00% EOF @@ -1603,10 +1605,11 @@ no_diff \ cat < "$PT_TMPDIR/expected" fio Driver | 2.3.1 build 123 - ioDrive :0 | Fusion-io ioDrive 720GB, Product Number:FS1-003-721-CS SN:122210 + ioDrive | Fusion-io ioDrive 720GB, Product Number:FS1-003-721-CS SN:122210 fct0 | Attached as 'fioa' (block device) | Fusion-io ioDrive 720GB, Product Number:FS1-003-721-CS SN:122210 | Firmware v5.0.5, rev 43674 + | Internal temperature: 53.2 degC, max 62.5 degC | Media status: Healthy; Reserves: 100.00%, warn at 10.00% EOF @@ -1623,19 +1626,23 @@ cat < "$PT_TMPDIR/expected" fct0 | Attached as 'fioa' (block device) | Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06665 | Firmware v5.0.7, rev 101971 + | Internal temperature: 47.7 degC, max 48.2 degC | Media status: Healthy; Reserves: 100.00%, warn at 10.00% fct1 | Attached as 'fiob' (block device) | Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06478 | Firmware v5.0.7, rev 101971 + | Internal temperature: 42.8 degC, max 47.7 degC | Media status: Healthy; Reserves: 100.00%, warn at 10.00% ioDrive Duo | Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:40124 fct2 | Attached as 'fioc' (block device) | Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06665 | Firmware v5.0.7, rev 101971 + | Internal temperature: 47.7 degC, max 48.2 degC | Media status: Healthy; Reserves: 100.00%, warn at 10.00% fct3 | Attached as 'fiod' (block device) | Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06478 | Firmware v5.0.7, rev 101971 + | Internal temperature: 42.8 degC, max 47.7 degC | Media status: Healthy; Reserves: 100.00%, warn at 10.00% EOF @@ -1645,3 +1652,25 @@ no_diff \ "$PT_TMPDIR/got" \ "$PT_TMPDIR/expected" \ "report_fio_minus_a works with two adapters, each with two modules" + +cat < "$PT_TMPDIR/expected" + fio Driver | 3.1.5 build 126 +Dual Controller Adapter | Fusion-io ioDrive2 Duo 2.41TB, Product Number:F01-001-2T41-CS-0001, SN:1150D0121, FIO SN:1150D0121 + fct0 | Attached as 'fioa' (block device) + | SN:1150D0121-1121 + | Firmware v7.0.0, rev 107322 Public + | Internal temperature: 51.68 degC, max 58.08 degC + | Reserve space status: Healthy; Reserves: 100.00%, warn at 10.00% + fct1 | Attached as 'fiob' (block device) + | SN:1150D0121-1111 + | Firmware v7.0.0, rev 107322 Public + | Internal temperature: 46.76 degC, max 51.19 degC + | Reserve space status: Healthy; Reserves: 100.00%, warn at 10.00% +EOF + +report_fio_minus_a "$samples/Linux/004/fio-004" > "$PT_TMPDIR/got" + +no_diff \ + "$PT_TMPDIR/got" \ + "$PT_TMPDIR/expected" \ + "report_fio_minus_a works with Dual Controller Adapter / ioMemory modules" diff --git a/t/pt-summary/samples/Linux/004/fio-001 b/t/pt-summary/samples/Linux/004/fio-001 index bb03b326..0879f307 100644 --- a/t/pt-summary/samples/Linux/004/fio-001 +++ b/t/pt-summary/samples/Linux/004/fio-001 @@ -5,9 +5,11 @@ ioDrive:Duo::0_fct0_attached_as Attached as 'fioa' (block device) ioDrive:Duo::0_fct0_general Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06665 ioDrive:Duo::0_fct0_firmware Firmware v5.0.7, rev 101971 ioDrive:Duo::0_fct0_media_status Media status: Healthy; Reserves: 100.00%, warn at 10.00% +ioDrive:Duo::0_fct0_temperature Internal temperature: 47.7 degC, max 48.2 degC ioDrive:Duo::0_fct1_attached_as Attached as 'fiob' (block device) ioDrive:Duo::0_fct1_general Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06478 ioDrive:Duo::0_fct1_firmware Firmware v5.0.7, rev 101971 ioDrive:Duo::0_fct1_media_status Media status: Healthy; Reserves: 100.00%, warn at 10.00% +ioDrive:Duo::0_fct1_temperature Internal temperature: 42.8 degC, max 47.7 degC adapters ioDrive:Duo::0 diff --git a/t/pt-summary/samples/Linux/004/fio-002 b/t/pt-summary/samples/Linux/004/fio-002 index 4ecd4b09..73e31d22 100644 --- a/t/pt-summary/samples/Linux/004/fio-002 +++ b/t/pt-summary/samples/Linux/004/fio-002 @@ -5,5 +5,6 @@ ioDrive::0_fct0_attached_as Attached as 'fioa' (block device) ioDrive::0_fct0_general Fusion-io ioDrive 720GB, Product Number:FS1-003-721-CS SN:122210 ioDrive::0_fct0_firmware Firmware v5.0.5, rev 43674 ioDrive::0_fct0_media_status Media status: Healthy; Reserves: 100.00%, warn at 10.00% +ioDrive::0_fct0_temperature Internal temperature: 53.2 degC, max 62.5 degC adapters ioDrive::0 diff --git a/t/pt-summary/samples/Linux/004/fio-003 b/t/pt-summary/samples/Linux/004/fio-003 index 3612566c..0ba06793 100644 --- a/t/pt-summary/samples/Linux/004/fio-003 +++ b/t/pt-summary/samples/Linux/004/fio-003 @@ -5,19 +5,23 @@ ioDrive:Duo::0_fct0_attached_as Attached as 'fioa' (block device) ioDrive:Duo::0_fct0_general Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06665 ioDrive:Duo::0_fct0_firmware Firmware v5.0.7, rev 101971 ioDrive:Duo::0_fct0_media_status Media status: Healthy; Reserves: 100.00%, warn at 10.00% +ioDrive:Duo::0_fct0_temperature Internal temperature: 47.7 degC, max 48.2 degC ioDrive:Duo::0_fct1_attached_as Attached as 'fiob' (block device) ioDrive:Duo::0_fct1_general Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06478 ioDrive:Duo::0_fct1_firmware Firmware v5.0.7, rev 101971 ioDrive:Duo::0_fct1_media_status Media status: Healthy; Reserves: 100.00%, warn at 10.00% +ioDrive:Duo::0_fct1_temperature Internal temperature: 42.8 degC, max 47.7 degC ioDrive:Duo::1_general Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:40124 ioDrive:Duo::1_modules fct2 fct3 ioDrive:Duo::1_fct2_attached_as Attached as 'fioc' (block device) ioDrive:Duo::1_fct2_general Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06665 ioDrive:Duo::1_fct2_firmware Firmware v5.0.7, rev 101971 ioDrive:Duo::1_fct2_media_status Media status: Healthy; Reserves: 100.00%, warn at 10.00% +ioDrive:Duo::1_fct2_temperature Internal temperature: 47.7 degC, max 48.2 degC ioDrive:Duo::1_fct3_attached_as Attached as 'fiod' (block device) ioDrive:Duo::1_fct3_general Fusion-io ioDrive Duo 640GB, Product Number:FS3-202-321-CS SN:06478 ioDrive:Duo::1_fct3_firmware Firmware v5.0.7, rev 101971 ioDrive:Duo::1_fct3_media_status Media status: Healthy; Reserves: 100.00%, warn at 10.00% +ioDrive:Duo::1_fct3_temperature Internal temperature: 42.8 degC, max 47.7 degC adapters ioDrive:Duo::0 ioDrive:Duo::1