0
0
GGogo-scc
This code tests a storage controller's connection to a host. The code loops indefinitely, waiting 5 seconds between each test. The code prints the current date and time, as well as the system's uptime. It then tests each statistic file in /sys/class/fc_host/host*/statistics/, counting the number of files that have been read since the last test. If the file exists, it prints the contents of the file.
#Test HBA connect
#! /bin/sh
hostname
while true
do
echo '#' $(date +%F) $(uptime)
for f in /sys/class/fc_host/host*/statistics/{error_frames,invalid_*}
do
[ -f $f ] && echo $f $(cat $f)
done
sleep 5
done