Compare commits

..

No commits in common. "main" and "test11" have entirely different histories.
main ... test11

5 changed files with 4 additions and 21 deletions

View File

@ -1,6 +0,0 @@
{
"hw": "intel",
"cpu": 12,
"memory": 32,
"gpu": "2080TI"
}

View File

@ -1,9 +0,0 @@
{
"topic": "performance",
"id": "sdt",
"password": "11223344",
"host": {
"address": "192.168.100.200",
"hostname": "sdt"
}
}

1
config.yaml Normal file
View File

@ -0,0 +1 @@
topic: performance

View File

@ -1,7 +1,5 @@
#!/bin/bash
set -e
sudo sed -i "s/appName/$1/g" /usr/local/sdt/app/$1/awx-perfermance.service
sudo cp /usr/local/sdt/app/$1/awx-perfermance.service /etc/systemd/system/$1.service
sudo systemctl start $1

View File

@ -10,9 +10,8 @@ parser = argparse.ArgumentParser()
parser.add_argument('-config',help='')
args = parser.parse_args()
with open(f'/usr/local/sdt/app/{args.config}/config.json', encoding='UTF-8') as f:
# with open(f'./config.json', encoding='UTF-8') as f:
jsonData = json.load(f)
with open(f'/usr/local/sdt/app/{args.config}/config.yaml', encoding='UTF-8') as f:
yamlData = yaml.load(f, Loader=yaml.FullLoader)
mqttc = mqtt.Client() # puclisher 이름
@ -34,7 +33,7 @@ while True:
"dataType":"",
"data": dataList
})
mqttc.publish(f"/sdt-cloud/{jsonData['topic']}", datas) # topic, message
mqttc.publish(f"/sdt-cloud/{yamlData['topic']}", datas) # topic, message
time.sleep(2)