This commit is contained in:
2023-08-14 21:18:57 -05:00
parent a5f94c6b94
commit 64d31d493e
2 changed files with 8 additions and 39 deletions

View File

@@ -64,12 +64,12 @@ PW_SENSOR_ID['vMS-Host2']='10'
PW_SENSOR_ID['vMS-Host7']='11'
PW_SENSOR_ID['vMS-Host8']='12'
declare -A PW_ESXI_MON_HOSTS
PW_ESXI_MON_HOSTS['vMS-Host0']='10.10.2.20'
PW_ESXI_MON_HOSTS['vMS-Host1']='10.10.2.21'
PW_ESXI_MON_HOSTS['vMS-Host2']='10.10.2.22'
PW_ESXI_MON_HOSTS['vMS-Host7']='10.10.2.27'
PW_ESXI_MON_HOSTS['vMS-Host8']='10.2.1.28'
declare -A PW_HOST_IDRACS
PW_HOST_IDRACS['vMS-Host0']='10.10.2.20'
PW_HOST_IDRACS['vMS-Host1']='10.10.2.21'
PW_HOST_IDRACS['vMS-Host2']='10.10.2.22'
PW_HOST_IDRACS['vMS-Host7']='10.10.2.27'
PW_HOST_IDRACS['vMS-Host8']='10.2.1.28'
declare -A PW_ESXI_HOST_NAMES
PW_ESXI_HOST_NAMES['10.10.2.10']='iDS-vMS-scsi.scity.us'

View File

@@ -26,9 +26,9 @@ CHECKTEMP(){
if [ "${1}" == "" ] || [[ "${SENSOR}" = *"${1}"* ]]; then
if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "esxi" ]; then
vHOSTIP=${PW_ESXI_MON_HOSTS[${SENSOR}]}
vHOSTIP=${PW_HOST_IDRACS[${SENSOR}]}
vHOSTNAME=${PW_ESXI_HOST_NAMES[${vHOSTIP}]}
echo -e "\r\033[K${idsCL[LightCyan]}${idsST[Bold]}${SENSOR} Host Sensors ${idsST[Reset]}- ${idsCL[LightCyan]}${PW_ESXI_HOST_NAMES[${vHOSTIP}]}${idsCL[Default]}"
echo -e "\r\033[K${idsCL[LightCyan]}${idsST[Bold]}${SENSOR} Host Sensors ${idsST[Reset]}- ${vHOSTIP}${idsCL[Default]}"
echo -en "${idsCL[Yellow]}Pulling data and calculating averages for '${SENSOR}' ..."
if [ "$(CHECK_HOST ${vHOSTIP})" != "false" ]; then
@@ -299,37 +299,6 @@ CHECKTEMP_SERVICE(){
fi
#############################
# else #esxi hosts
# for e in ${!PW_ESXI_MON_HOSTS[@]}; do
# vHOSTIP=${PW_ESXI_MON_HOSTS[${e}]}
# vHOSTNAME=${PW_ESXI_HOST_NAMES[${vHOSTIP}]}
# if [ "$(CHECK_HOST ${vHOSTIP})" != "false" ]; then
# vHOSTDATA=$(ssh root@${PW_RACADM_ACCESS} racadm -r ${vHOSTIP} -u ${PW_ESXI_USER} -p "'${PW_ESXI_PASS}'" getsensorinfo | grep " Temp" 2>&1)
# IFS=$'\n' read -rd '' -a vHOSTDATA <<<"${vHOSTDATA}"; unset IFS
#
# for sensordata in "${vHOSTDATA[@]}"; do
# sensor=$(echo ${sensordata} | cut -d'T' -f1 | xargs)
# temp=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $2}' | sed -e 's/C//g'); current=${current/ /}
# warn=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); warn=${warn/ /}
# crit=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); crit=${crit/ /}
#
#
#
# done
#
#
# else #host down
# if [ ! -f ${PW_TMPFOLDER}/${e}.down ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${e}.down)) -ge 1800 ]; then
# SENDNOTICE "${vHOSTIP} ERROR" "${vHOSTNAME} Host is down" 1
# echo "($datetime) - ${vHOSTIP} - ${vHOSTNAME} Host is down" >> ${logtemp}
# touch ${PW_TMPFOLDER}/${e}.down
#
# fi
#
# fi
# done
fi
done