Skip to content

Commit bb9ff22

Browse files
ggoneiESSAndré Costa
authored andcommitted
update to use new filewriter status
1 parent 9cb25fc commit bb9ff22

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

config/ymir.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ AKHQ, 3, 0, 10.100.211.94, 8443, 0, -450, -20, https://10.10
6565
graylog, 3, 0, ymir-graylog.daq.esss.dk, 9000, 0, -450, -5, http://ymir-graylog.daq.esss.dk:9000/search
6666
forwarder01, 2, 0, 10.102.10.244, 8093, 0, -450, 10, none
6767
#
68-
filewriter0625, 5, 0, 10.100.6.25, 3490, 0, -355, -50, https://10.100.211.93:3000/d/kafka-to-nexus/kafka-to-nexus-filewriter?orgId=1&refresh=5s
69-
filewriter0627, 5, 0, 10.100.6.27, 3490, 0, -355, -35, https://10.100.211.93:3000/d/kafka-to-nexus/kafka-to-nexus-filewriter?orgId=1&refresh=5s
68+
filewriter0625, 5, 0, 10.100.6.25, 9999, 0, -355, -50, https://10.100.211.93:3000/d/kafka-to-nexus/kafka-to-nexus-filewriter?orgId=1&refresh=5s
69+
filewriter0627, 5, 0, 10.100.6.27, 9999, 0, -355, -35, https://10.100.211.93:3000/d/kafka-to-nexus/kafka-to-nexus-filewriter?orgId=1&refresh=5s
7070
nicosserver01, 2, 0, 10.102.10.238, 14869, 0, -355, -20, none
7171
#
7272
Kafka   Brokers, 4, 64, 0.0.0.0, 65535, 0, -450, -160, none

dashboard/generate.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,17 @@ def check_fw_pipeline(self, ipaddr, port):
145145
try:
146146
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
147147
s.connect((ipaddr, port))
148-
s.send(b"getstatus")
149-
data = s.recv(256)
150-
data2 = int(data.decode("utf-8").split()[1][0])
151-
s.close()
152-
return data2
148+
s.shutdown(socket.SHUT_WR) # no data sent
149+
data = b""
150+
while True:
151+
chunk = s.recv(4096)
152+
if not chunk:
153+
break
154+
data += chunk
155+
lines = data.decode("utf-8", errors="ignore").strip().splitlines()
156+
if lines:
157+
return int(lines[-1].split()[1][0]) * 5 # will be either 0 or 1
158+
return data
153159
except:
154160
self.dprint("connection reset (by peer?)")
155161
return 0

0 commit comments

Comments
 (0)