Commit 1edf1be4 authored by Dan Reading's avatar Dan Reading
Browse files

checkpoint for HD filtering

parent 28055f96
......@@ -479,19 +479,18 @@ compareunits() {
(( ! $offline )) && printf "ERROR %s%s OUT OF ORDER found %s from tbdb %s\n" "${unit_human_output}" "s:" "$localunits" "$tbdbunits"
(( ! $offline )) && ( printf "ERROR %s OUT OF ORDER found %s from tbdb %s\n" "${unit_human_output}" "$localunits" "$tbdbunits" >> $fileout ) || ( printf "WARNING %s%s ORDER '%s' compared to '%s'\n" "${unit_human_output}" "s:" "$localunits" "$tbdbunits" >> $fileout )
else
if [ -n "${localunits}" ]; then
printf "%s%s %s\n" "${unit_human_output}" "s:" "$localunits" >> $localonly
fi
if [ -n "${tbdbunits}" ]; then
printf "%s%s %s\n" "${unit_human_output}" "s:" "$tbdbunits" >> $tbdbonly
fi
if [ -n "${localunits}" ]; then
printf "%s%s %s\n" "${unit_human_output}" "s:" "$localunits" >> $localonly
fi
if [ -n "${tbdbunits}" ]; then
printf "%s%s %s\n" "${unit_human_output}" "s:" "$tbdbunits" >> $tbdbonly
fi
(( ! $offline )) && printf "ERROR %s MISSING found %s from tbdb %s\n" "${unit_human_output}" "s:" "$localunits" "$tbdbunits"
(( ! $offline )) && ( printf "ERROR %s MISSING found %s from tbdb %s\n" "${unit_human_output}" "$localunits" "$tbdbunits" >> $fileout ) || ( printf "WARNING MISSING %s%s ORDER '%s' compared to '%s'\n" "${unit_human_output}" "s:" "$localunits" "$tbdbunits" >> $fileout )
fi
fi
fi
return 0
}
......@@ -617,6 +616,7 @@ findSmartctl() {
findit=$NOSM
fi
fi
echo $findit
return 0
}
......@@ -759,7 +759,7 @@ getdrivenames() {
exit
;;
esac
echo $drivelist
return 0
}
......
......@@ -45,6 +45,15 @@ main_diskcheck() {
SMARTCTL=$(findSmartctl)
drivenames=$(getdrivenames)
# run through the drivelist filtering out non-local drives or other devices
for i in $drivenames ; do
model=$(getmodel $i)
if [ "$model" == "iSCSIDisk" ] ; then
echo "Filter out $i because $model"
drivenames=${drivenames/${i}}
fi
done
if [ -z "$drivenames" ] ; then
echo "No drives found. exit"
(( $diskcheck_standalone )) && exit 1 || return 1
......@@ -183,7 +192,7 @@ main_diskcheck() {
# update driveinv with modified data
driveinv[$idx]=${d[@]}
done
if (( $collect_flag )) ; then
printf "%s%d\n" "DISKINFO UNITS=" ${numberofdrives} >> ${logfile4tb}
for (( idx=0; idx<$numberofdrives; idx++)) ; do
......@@ -445,6 +454,7 @@ gettemp() {
}
getmodel() {
smtcl=$(findSmartctl)
if [ "${smtcl/smartctl}" == "$smtcl" ] ; then
#don't have smartctl, maybe we can use hdparm
hdp=$(which hdparm)
......@@ -468,11 +478,13 @@ getmodel() {
res=${res/Product: }
fi
# remove leading spaces
res=${res##* }
# res=${res##* }
fi
# no internal spaces
res=${res// /}
res=${res// /-}
[[ $res ]] && echo "$res" || echo "UNKNOWN"
return 0
}
......
......@@ -106,7 +106,7 @@ if [ -f "/etc/emulab/ismfs" ] ; then
fi
os=`uname -s`
export PATH="/usr/local/bin:$mountpoint/nodecheck/`uname -s`/bin-`uname -m`:$PATH"
export PATH="/usr/local/sbin:/usr/local/bin:$mountpoint/nodecheck/`uname -s`/bin-`uname -m`:$PATH"
echo 'Running Hardware Inventory Gather'
bash $BINDIR/checknode $LOGDIR/nodecheck.log
......@@ -123,7 +123,7 @@ echo "Running nodechecks"
# set path if we have the extra static binaries
os=`uname -s`
if [ -d "$mountpoint"/nodecheck/`uname -s`/bin-`uname -m` ] ; then
export PATH="/usr/local/bin:$mountpoint/nodecheck/`uname -s`/bin-`uname -m`:$PATH"
export PATH="/usr/local/sbin:/usr/local/bin:$mountpoint/nodecheck/`uname -s`/bin-`uname -m`:$PATH"
fi
# if booting node then truncate local log file
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment