Compare commits
9 Commits
Author | SHA1 | Date |
---|---|---|
이수준 | e9cc931753 | |
이수준 | 50b007cb75 | |
이수준 | e0b44b8aff | |
이수준 | 40365eb8e0 | |
이수준 | 4cfb891eba | |
이수준 | ca8c28c252 | |
이수준 | ed2394fde0 | |
이수준 | 5304b586aa | |
이수준 | 5c3c10356f |
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"hw": "intel",
|
||||||
|
"cpu": 12,
|
||||||
|
"memory": 32,
|
||||||
|
"gpu": "2080TI"
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"topic": "performance",
|
||||||
|
"id": "sdt",
|
||||||
|
"password": "11223344",
|
||||||
|
"host": {
|
||||||
|
"address": "192.168.100.200",
|
||||||
|
"hostname": "sdt"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
topic: perfermance
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
sudo sed -i "s/appName/$1/g" /usr/local/sdt/app/$1/awx-perfermance.service
|
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 cp /usr/local/sdt/app/$1/awx-perfermance.service /etc/systemd/system/$1.service
|
||||||
sudo systemctl start $1
|
sudo systemctl start $1
|
||||||
|
|
9
main.py
9
main.py
|
@ -1,4 +1,4 @@
|
||||||
# import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
import json
|
import json
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
@ -10,8 +10,9 @@ parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('-config',help='')
|
parser.add_argument('-config',help='')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
with open(f'/usr/local/sdt/app/{args.config}/config.yaml', encoding='UTF-8') as f:
|
with open(f'/usr/local/sdt/app/{args.config}/config.json', encoding='UTF-8') as f:
|
||||||
yamlData = yaml.load(f, Loader=yaml.FullLoader)
|
# with open(f'./config.json', encoding='UTF-8') as f:
|
||||||
|
jsonData = json.load(f)
|
||||||
|
|
||||||
|
|
||||||
mqttc = mqtt.Client() # puclisher 이름
|
mqttc = mqtt.Client() # puclisher 이름
|
||||||
|
@ -33,7 +34,7 @@ while True:
|
||||||
"dataType":"",
|
"dataType":"",
|
||||||
"data": dataList
|
"data": dataList
|
||||||
})
|
})
|
||||||
mqttc.publish(f"/sdt-cloud/{yamlData['topic']}", datas) # topic, message
|
mqttc.publish(f"/sdt-cloud/{jsonData['topic']}", datas) # topic, message
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue