esxihosts

This commit is contained in:
2022-09-10 10:08:32 -05:00
parent 2a705d90ea
commit cda18648e7
2 changed files with 13 additions and 0 deletions

View File

@@ -14,3 +14,12 @@ SENSOR_ID['ServerRoomTH']='2'
declare -A SERVICE_NAME
SERVICE_NAME['ServerRoomTH']='serverroomth_sensor_monitor'
ESXIHOSTS=10.10.2.10,10.10.2.11,10.10.2.12,10.10.2.13,10.10.2.14,10.10.2.15,10.10.2.16
IFS=,
ESXIHOSTS=(${ESXIHOSTS})
unset IFS

View File

@@ -87,6 +87,10 @@ CHECKTEMP_SERVICE(){
echo "($datetime) normal: ${temp_f}°F"
fi
for ESXIHOST in "${ESXIHOSTS[@]}"; do
echo "Host: ${ESXIHOST}"
done
QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`, \`hum\`) VALUES ('${SENSOR_ID[$1]}','${datetime}','${temp_f}','${temp_h}')"
${mysql_conn} -e "${QRY}"
else