mirror of
https://github.com/newnius/YAO-agent.git
synced 2025-12-15 22:06:43 +00:00
update
This commit is contained in:
3
agent.py
3
agent.py
@@ -190,6 +190,7 @@ class MyHandler(BaseHTTPRequestHandler):
|
|||||||
if exit_code != 0:
|
if exit_code != 0:
|
||||||
msg["code"] = 1
|
msg["code"] = 1
|
||||||
msg["error"] = output.decode('utf-8').rstrip('\n')
|
msg["error"] = output.decode('utf-8').rstrip('\n')
|
||||||
|
print(msg["error"])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = {"code": 1, "error": str(e)}
|
msg = {"code": 1, "error": str(e)}
|
||||||
print(str(e))
|
print(str(e))
|
||||||
@@ -363,7 +364,7 @@ def report_msg(stats):
|
|||||||
producer = KafkaProducer(bootstrap_servers=KafkaBrokers)
|
producer = KafkaProducer(bootstrap_servers=KafkaBrokers)
|
||||||
future = producer.send('yao', value=data.encode(), partition=0)
|
future = producer.send('yao', value=data.encode(), partition=0)
|
||||||
result = future.get(timeout=10)
|
result = future.get(timeout=10)
|
||||||
print(result)
|
# print(result)
|
||||||
|
|
||||||
|
|
||||||
def listener():
|
def listener():
|
||||||
|
|||||||
Reference in New Issue
Block a user