From 85d0d3a3071fe37c01465198d9c7e2a4be0d3d4e Mon Sep 17 00:00:00 2001 From: Riku Date: Mon, 9 Dec 2024 15:19:25 +0200 Subject: [PATCH] fix lte signals untested --- zte_exporter.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zte_exporter.py b/zte_exporter.py index a72372e..1463f9d 100644 --- a/zte_exporter.py +++ b/zte_exporter.py @@ -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"))