From 897fa34ae5b4930627b1c19fb747d3f22c6a5b2c Mon Sep 17 00:00:00 2001 From: Riku Date: Mon, 9 Dec 2024 15:40:57 +0200 Subject: [PATCH] fix fixes fix --- zte_exporter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zte_exporter.py b/zte_exporter.py index 1463f9d..0d567df 100644 --- a/zte_exporter.py +++ b/zte_exporter.py @@ -116,7 +116,7 @@ class serveInfos(BaseHTTPRequestHandler): self.wfile.write(bytes("# HELP zte_rsrq Reference Signal Received Quality\n# TYPE zte_rsrq gauge\n", "utf-8")) self.wfile.write(bytes("# HELP zte_rssi Received Signal Strength Indicator\n# TYPE zte_rssi gauge\n", "utf-8")) - if gatheredJson['nr5g_action_band']: + if gatheredJson['nr5g_action_band'] != 0: self.wfile.write(bytes("zte_rsrq{band=\"%s\"} " % gatheredJson["nr5g_action_band"], "utf-8")) self.wfile.write(bytes("%s\n" % gatheredJson["Z5g_rsrq"], "utf-8")) @@ -129,7 +129,7 @@ class serveInfos(BaseHTTPRequestHandler): self.wfile.write(bytes("zte_snr{band=\"%s\"} " % gatheredJson["nr5g_action_band"], "utf-8")) self.wfile.write(bytes("%s\n\n" % gatheredJson["Z5g_SINR"], "utf-8")) - if gatheredJson['nr_multi_ca_scell_info']: + if not len(gatheredJson['nr_multi_ca_scell_info']) == 0: for index, item in enumerate(gatheredJson['nr_multi_ca_scell_info'].split(";")): nrbit = item.split(",") if not len(nrbit[0]) == 0: @@ -145,7 +145,7 @@ class serveInfos(BaseHTTPRequestHandler): self.wfile.write(bytes("zte_snr{band=\"%s\"} " % nrbit[3], "utf-8")) self.wfile.write(bytes("%s\n\n" % nrbit[9], "utf-8")) - if gatheredJson['lte_ca_pcell_band']: + if gatheredJson['lte_ca_pcell_band'] and gatheredJson['lte_ca_pcell_band'] != "0": self.wfile.write(bytes("zte_rsrq{band=\"b%s\"} " % gatheredJson["lte_ca_pcell_band"], "utf-8")) self.wfile.write(bytes("%s\n" % gatheredJson["lte_rsrq"], "utf-8")) @@ -158,7 +158,7 @@ class serveInfos(BaseHTTPRequestHandler): self.wfile.write(bytes("zte_snr{band=\"b%s\"} " % gatheredJson["lte_ca_pcell_band"], "utf-8")) self.wfile.write(bytes("%s\n\n" % gatheredJson["lte_snr"], "utf-8")) - if gatheredJson['lte_multi_ca_scell_info']: + if not len(gatheredJson['lte_multi_ca_scell_info']) == 0: for index, item in enumerate(gatheredJson['lte_multi_ca_scell_info'].split(";")): cabit = item.split(",") sigbits = gatheredJson['lte_multi_ca_scell_sig_info'].split(";")