1
0
mirror of https://github.com/newnius/YAO-agent.git synced 2025-12-15 05:56:43 +00:00
This commit is contained in:
2020-05-26 11:27:39 +08:00
parent 0591ae0885
commit 5804c0ce72
3 changed files with 9 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ bin/kafka-topics.sh \
--create \ --create \
--zookeeper zookeeper-node1:2181,zookeeper-node2:2181,zookeeper-node3:2181 \ --zookeeper zookeeper-node1:2181,zookeeper-node2:2181,zookeeper-node3:2181 \
--replication-factor 3 \ --replication-factor 3 \
--partitions 1 \ --partitions 6 \
--topic yao --topic yao
``` ```

View File

@@ -22,6 +22,9 @@ ClientHost = os.getenv('ClientHost', "localhost")
ClientExtHost = os.getenv('ClientExtHost', "localhost") ClientExtHost = os.getenv('ClientExtHost', "localhost")
KafkaBrokers = os.getenv('KafkaBrokers', 'localhost:9092').split(',') KafkaBrokers = os.getenv('KafkaBrokers', 'localhost:9092').split(',')
RackID = os.getenv('RackID', "default")
DomainID = os.getenv('DomainID', "default")
PORT = int(os.getenv('Port', 8000)) PORT = int(os.getenv('Port', 8000))
HeartbeatInterval = int(os.getenv('HeartbeatInterval', 5)) HeartbeatInterval = int(os.getenv('HeartbeatInterval', 5))
@@ -350,6 +353,8 @@ def report_msg(stats):
mem = psutil.virtual_memory() mem = psutil.virtual_memory()
post_fields = { post_fields = {
'id': ClientID, 'id': ClientID,
'rack': RackID,
'domain': DomainID,
'host': ClientHost, 'host': ClientHost,
'status': stats, 'status': stats,
'cpu_num': multiprocessing.cpu_count(), 'cpu_num': multiprocessing.cpu_count(),

View File

@@ -90,7 +90,7 @@ def report(ClientID):
stats = [] stats = []
for i in range(0, 4): for i in range(0, 4):
stat = { stat = {
'uuid': 'UUID-' + str(i), 'uuid': 'UUID-' + ClientID + '-' + str(i),
'product_name': 'K80', 'product_name': 'K80',
'performance_state': 'P0', 'performance_state': 'P0',
'memory_total': 11260, 'memory_total': 11260,
@@ -106,6 +106,8 @@ def report(ClientID):
post_fields = { post_fields = {
'id': ClientID, 'id': ClientID,
'rack': ClientHost,
'domain': ClientHost,
'host': ClientHost, 'host': ClientHost,
'status': stats, 'status': stats,
'cpu_num': 64, 'cpu_num': 64,