From e8ded5e13eb89028eea37303399db1d7344dad41 Mon Sep 17 00:00:00 2001 From: Tony Floeder Date: Mon, 18 Mar 2024 09:17:58 -0500 Subject: [PATCH] Add tool scripts (#99) * Add script to prepend timestamps to PAX log files along with a basic drive visibility test for PP Signed-off-by: Anthony Floeder * Look at the link speeds through the PAX for determination of correct configuration for PP * review comments Signed-off-by: Anthony Floeder --------- Signed-off-by: Anthony Floeder --- tools/pp-drive-link-test.sh | 57 +++++++++++++++++++++++++++++++++++++ tools/timestamp-log.sh | 47 ++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100755 tools/pp-drive-link-test.sh create mode 100755 tools/timestamp-log.sh diff --git a/tools/pp-drive-link-test.sh b/tools/pp-drive-link-test.sh new file mode 100755 index 0000000..2a527d7 --- /dev/null +++ b/tools/pp-drive-link-test.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# Copyright 2024 Hewlett Packard Enterprise Development LP +# Other additional copyright holders may be indicated within. +# +# The entirety of this work is licensed under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +usage() { + cat <nul | grep -e "^.*\/.*\/.*4200" -A50 | grep -e 4200 -e LnkSta: -e LnkCap: | grep -e "16GT.*Width x4" | wc -l) +drivePhysicalPortDisConnectedCount=$(lspci -PP -vvv 2>nul | grep -e "^.*\/.*\/.*4200" -A50 | grep -e 4200 -e LnkSta: -e LnkCap: | grep -e "Width x0" | wc -l) + +if [ "$verbose" == "true" ]; then + printf "physical port connected count: %d\n" "$drivePhysicalPortConnectedCount" + printf "physical port disconnected count: %d\n" "$drivePhysicalPortDisConnectedCount" +fi + +if [ "$drivePhysicalPortConnectedCount" == "16" ] && [ "$drivePhysicalPortDisConnectedCount" == "2" ]; then + printf "PASS - %d drives, %d empty slots\n" "$drivePhysicalPortConnectedCount" "$drivePhysicalPortDisConnectedCount" +else + printf "FAIL - %d drives, %d empty slots\n" "$drivePhysicalPortConnectedCount" "$drivePhysicalPortDisConnectedCount" +fi \ No newline at end of file diff --git a/tools/timestamp-log.sh b/tools/timestamp-log.sh new file mode 100755 index 0000000..c52f2bc --- /dev/null +++ b/tools/timestamp-log.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Copyright 2024 Hewlett Packard Enterprise Development LP +# Other additional copyright holders may be indicated within. +# +# The entirety of this work is licensed under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +usage() { + cat <