fix lte signals

untested
main
"Riku" 2024-12-09 15:19:25 +02:00
parent b248a65524
commit 85d0d3a307
1 changed files with 6 additions and 4 deletions

View File

@ -161,18 +161,20 @@ class serveInfos(BaseHTTPRequestHandler):
if gatheredJson['lte_multi_ca_scell_info']:
for index, item in enumerate(gatheredJson['lte_multi_ca_scell_info'].split(";")):
cabit = item.split(",")
sigbits = gatheredJson['lte_multi_ca_scell_sig_info'].split(";")
sigbit = sigbits[index].split(",")
if not len(cabit[0]) == 0:
self.wfile.write(bytes("zte_rsrq{band=\"b%s\"} " % cabit[3], "utf-8"))
self.wfile.write(bytes("%s\n" % cabit[8], "utf-8"))
self.wfile.write(bytes("%s\n" % sigbit[0], "utf-8"))
self.wfile.write(bytes("zte_rsrp{band=\"b%s\"} " % cabit[3], "utf-8"))
self.wfile.write(bytes("%s\n" % cabit[7], "utf-8"))
self.wfile.write(bytes("%s\n" % sigbit[1], "utf-8"))
self.wfile.write(bytes("zte_rssi{band=\"b%s\"} " % cabit[3], "utf-8"))
self.wfile.write(bytes("%s\n" % cabit[10], "utf-8"))
self.wfile.write(bytes("%s\n" % sigbit[3], "utf-8"))
self.wfile.write(bytes("zte_snr{band=\"b%s\"} " % cabit[3], "utf-8"))
self.wfile.write(bytes("%s\n\n" % cabit[9], "utf-8"))
self.wfile.write(bytes("%s\n\n" % sigbit[2], "utf-8"))
self.wfile.write(bytes("# HELP zte_bandwidth_used_monthly_tx Used bandwidth, transmit (bytes)\n# TYPE zte_bandwidth_used_monthly_tx counter\n", "utf-8"))
self.wfile.write(bytes("zte_bandwidth_used_monthly_tx %s\n\n" % gatheredJson["monthly_tx_bytes"], "utf-8"))