This commit is contained in:
2022-09-11 21:40:28 -05:00
parent 8838981089
commit fe14f1dc50
2 changed files with 22 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
VERS='1.090822'
noupdate=' stop '
noupdate=' stop start '
mqtt_conn='/usr/bin/mosquitto_sub -h 127.0.0.1 -u mqtt -P 12mqtt34password56'
#mysql_conn='/usr/bin/mysql -h mysqldb.scity.us -P 6033 --user=sysmoninsert --password=sysmoninsert'
@@ -20,10 +20,10 @@ TEMP_THRESHOLDS['ServerRoomTH']="82,92,97"
declare -A SENSOR_ID
SENSOR_ID['ServerRoomTH']='2'
declare -A SERVICE_NAME
SERVICE_NAME['ServerRoomTH']='monitor-serverroomth'
SERVICE_NAME['ACV']='monitor-acv'
SERVICE_NAME['powerlogger']='monitor-powerlogger'
declare -A POWERWALL_SERVICES
POWERWALL_SERVICES['ServerRoomTH']='monitor-serverroomth'
POWERWALL_SERVICES['ACV']='monitor-acv'
POWERWALL_SERVICES['powerlogger']='monitor-powerlogger'
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

View File

@@ -198,10 +198,23 @@ POWERLOGGER_SERVICE(){
QRY="USE servermonitor; INSERT INTO power_data (\`sensorid\`, \`date\`, \`volt\`, \`amp\`) VALUES ('4','${datetime}','${battV}','${battA}')"
${mysql_conn} -e "${QRY}"
sleep 1m
sleep function 1m {
gfds
}d
done
}
UPDATE_SERVICES(){
for srvc in "${partitions3[@]}"; do
/bin/systemctl
}
STOP_SERVICE(){
service_pid=`systemctl show --property MainPID --value ${POWERWALL_SERVICES[${1}]}`
/usr/bin/pkill -P $service_pid
}
SHUTDOWN_SERVERS(){
touch $FOLDER/shutdown
@@ -240,33 +253,21 @@ if [ ${action-x} ]; then
checktemp) CHECKTEMP ${2};;
checktemp_service)
if [ "${2}" = "stop" ]; then
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME[${3}]}`
/usr/bin/pkill -P $service_pid
#/bin/systemctl stop $srvcname
#/usr/bin/killall bash
STOP_SERVICE ${3}
else
CHECKTEMP_SERVICE ${2}
fi
;;
checkacv_service)
if [ "${2}" = "stop" ]; then
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME['ACV']}`
/usr/bin/pkill -P $service_pid
#/bin/systemctl stop $srvcname
#/usr/bin/killall bash
STOP_SERVICE ACV
else
CHECKACV_SERVICE
fi
;;
powerlogger_service)
if [ "${2}" = "stop" ]; then
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME['powerlogger']}`
/usr/bin/pkill -P $service_pid
#/bin/systemctl stop $srvcname
#/usr/bin/killall bash
STOP_SERVICE powerloger
else
POWERLOGGER_SERVICE
fi