NR SA support for graphs, update dashboard

main
"Riku" 2024-09-28 12:17:24 +03:00
parent c9fed32eea
commit 6c7a8884e9
2 changed files with 547 additions and 193 deletions

View File

@ -44,7 +44,7 @@
}, },
"gridPos": { "gridPos": {
"h": 5, "h": 5,
"w": 6, "w": 5,
"x": 0, "x": 0,
"y": 0 "y": 0
}, },
@ -54,6 +54,7 @@
"graphMode": "area", "graphMode": "area",
"justifyMode": "auto", "justifyMode": "auto",
"orientation": "auto", "orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": { "reduceOptions": {
"calcs": [ "calcs": [
"lastNotNull" "lastNotNull"
@ -65,7 +66,7 @@
"textMode": "auto", "textMode": "auto",
"wideLayout": true "wideLayout": true
}, },
"pluginVersion": "11.0.0", "pluginVersion": "11.2.0",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -81,6 +82,7 @@
} }
], ],
"title": "Received this month", "title": "Received this month",
"transparent": true,
"type": "stat" "type": "stat"
}, },
{ {
@ -106,8 +108,8 @@
}, },
"gridPos": { "gridPos": {
"h": 5, "h": 5,
"w": 6, "w": 5,
"x": 6, "x": 5,
"y": 0 "y": 0
}, },
"id": 8, "id": 8,
@ -116,6 +118,7 @@
"graphMode": "area", "graphMode": "area",
"justifyMode": "auto", "justifyMode": "auto",
"orientation": "auto", "orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": { "reduceOptions": {
"calcs": [ "calcs": [
"lastNotNull" "lastNotNull"
@ -127,7 +130,7 @@
"textMode": "auto", "textMode": "auto",
"wideLayout": true "wideLayout": true
}, },
"pluginVersion": "11.0.0", "pluginVersion": "11.2.0",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -143,6 +146,7 @@
} }
], ],
"title": "Sent this month", "title": "Sent this month",
"transparent": true,
"type": "stat" "type": "stat"
}, },
{ {
@ -152,177 +156,38 @@
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": true,
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "percentage",
"steps": [ "steps": [
{ {
"color": "green", "color": "green",
"value": null "value": null
}, },
{ {
"color": "red", "color": "#EAB839",
"value": 80 "value": 80
},
{
"color": "dark-red",
"value": 90
} }
] ]
}, },
"unit": "dB" "unit": "binBps"
}, },
"overrides": [] "overrides": []
}, },
"gridPos": { "gridPos": {
"h": 10, "h": 10,
"w": 4, "w": 4,
"x": 12, "x": 10,
"y": 0 "y": 0
}, },
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.0.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"editorMode": "code",
"expr": "zte_snr",
"instant": false,
"legendFormat": "{{band}}",
"range": true,
"refId": "A"
}
],
"title": "SNR",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": true,
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 80
},
{
"color": "dark-red",
"value": 90
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 0,
"y": 5
},
"id": 3,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
"pluginVersion": "11.0.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"editorMode": "code",
"expr": "zte_bandwidth_rx",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Receive",
"type": "gauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": true,
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 80
},
{
"color": "dark-red",
"value": 90
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 6,
"y": 5
},
"id": 6, "id": 6,
"options": { "options": {
"minVizHeight": 75, "minVizHeight": 75,
@ -339,7 +204,7 @@
"showThresholdMarkers": true, "showThresholdMarkers": true,
"sizing": "auto" "sizing": "auto"
}, },
"pluginVersion": "11.0.0", "pluginVersion": "11.2.0",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -355,8 +220,227 @@
} }
], ],
"title": "Transmit", "title": "Transmit",
"transparent": true,
"type": "gauge" "type": "gauge"
}, },
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": true,
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 80
},
{
"color": "dark-red",
"value": 90
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 4,
"x": 14,
"y": 0
},
"id": 3,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"editorMode": "code",
"expr": "zte_bandwidth_rx",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Receive",
"transparent": true,
"type": "gauge"
},
{
"datasource": {
"default": true,
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 5,
"x": 0,
"y": 5
},
"id": 10,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"last"
],
"fields": "/^firmware$/",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"editorMode": "code",
"expr": "zte_modem_info",
"format": "table",
"instant": true,
"legendFormat": "{{firmware}}",
"range": true,
"refId": "A"
}
],
"title": "Firmware",
"transparent": true,
"type": "stat"
},
{
"datasource": {
"default": true,
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 5,
"x": 5,
"y": 5
},
"id": 11,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"last"
],
"fields": "/^ip_addr$/",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"editorMode": "code",
"expr": "zte_modem_info",
"format": "table",
"instant": true,
"legendFormat": "{{ip}}",
"range": true,
"refId": "A"
}
],
"title": "WAN IP",
"transparent": true,
"type": "stat"
},
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
@ -374,6 +458,7 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 0, "fillOpacity": 0,
"gradientMode": "none", "gradientMode": "none",
@ -423,11 +508,17 @@
"x": 0, "x": 0,
"y": 10 "y": 10
}, },
"id": 2, "id": 9,
"interval": "120s",
"options": { "options": {
"legend": { "legend": {
"calcs": [], "calcs": [
"displayMode": "list", "last",
"min",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom", "placement": "bottom",
"showLegend": true "showLegend": true
}, },
@ -444,14 +535,15 @@
"uid": "ddh48acw4qku8a" "uid": "ddh48acw4qku8a"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "zte_rsrp", "expr": "zte_snr",
"instant": false, "instant": false,
"legendFormat": "{{band}}", "legendFormat": "{{band}}",
"range": true, "range": true,
"refId": "A" "refId": "A"
} }
], ],
"title": "RSRP", "title": "SNR",
"transparent": true,
"type": "timeseries" "type": "timeseries"
}, },
{ {
@ -471,6 +563,7 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 0, "fillOpacity": 0,
"gradientMode": "none", "gradientMode": "none",
@ -516,16 +609,126 @@
}, },
"gridPos": { "gridPos": {
"h": 8, "h": 8,
"w": 7, "w": 9,
"x": 9, "x": 9,
"y": 10 "y": 10
}, },
"id": 5, "id": 2,
"interval": "30s", "interval": "120s",
"options": { "options": {
"legend": { "legend": {
"calcs": [], "calcs": [
"displayMode": "list", "last",
"min",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"maxHeight": 600,
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"editorMode": "code",
"expr": "zte_rsrp",
"instant": false,
"legendFormat": "{{band}}",
"range": true,
"refId": "A"
}
],
"title": "RSRP",
"transparent": true,
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "dB"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 9,
"x": 0,
"y": 18
},
"id": 5,
"interval": "120s",
"options": {
"legend": {
"calcs": [
"last",
"min",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom", "placement": "bottom",
"showLegend": true "showLegend": true
}, },
@ -550,6 +753,113 @@
} }
], ],
"title": "RSRQ", "title": "RSRQ",
"transparent": true,
"type": "timeseries"
},
{
"datasource": {
"default": true,
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "dB"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 9,
"x": 9,
"y": 18
},
"id": 12,
"interval": "120s",
"options": {
"legend": {
"calcs": [
"last",
"min",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"maxHeight": 600,
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "ddh48acw4qku8a"
},
"editorMode": "code",
"expr": "zte_rssi",
"instant": false,
"legendFormat": "{{band}}",
"range": true,
"refId": "A"
}
],
"title": "RSSI",
"transparent": true,
"type": "timeseries" "type": "timeseries"
}, },
{ {
@ -569,6 +879,7 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 19, "fillOpacity": 19,
"gradientMode": "none", "gradientMode": "none",
@ -616,17 +927,22 @@
"overrides": [] "overrides": []
}, },
"gridPos": { "gridPos": {
"h": 8, "h": 10,
"w": 16, "w": 19,
"x": 0, "x": 0,
"y": 18 "y": 26
}, },
"id": 1, "id": 1,
"interval": "30s", "interval": "120s",
"options": { "options": {
"legend": { "legend": {
"calcs": [], "calcs": [
"displayMode": "list", "last",
"min",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom", "placement": "bottom",
"showLegend": true "showLegend": true
}, },
@ -665,6 +981,7 @@
} }
], ],
"title": "Bandwidth in use", "title": "Bandwidth in use",
"transparent": true,
"type": "timeseries" "type": "timeseries"
} }
], ],
@ -675,14 +992,13 @@
"list": [] "list": []
}, },
"time": { "time": {
"from": "now-6h", "from": "now-15m",
"to": "now" "to": "now"
}, },
"timeRangeUpdatedDuringEditOrView": false,
"timepicker": {}, "timepicker": {},
"timezone": "browser", "timezone": "browser",
"title": "ZTE 5G", "title": "ZTE 5G",
"uid": "bdmvny6iizbpcc", "uid": "bdmvny6iizbpcc",
"version": 10, "version": 27,
"weekStart": "" "weekStart": ""
} }

View File

@ -83,7 +83,7 @@ class zteRouter:
def zteinfo(self): def zteinfo(self):
ip = self.ip ip = self.ip
cookie = self.getCookie(username=self.username, password=self.password, LD=self.get_LD(), login=self.login) cookie = self.getCookie(username=self.username, password=self.password, LD=self.get_LD(), login=self.login)
cmd_url = f"{self.protocol}://{self.ip}/goform/goform_get_cmd_process?multi_data=1&isTest=false&cmd=wa_inner_version%2Clte_rssi%2CZ5g_rssi%2Clte_rsrp%2CZ5g_rsrp%2Clte_rsrq%2CZ5g_rsrq%2Clte_snr%2CZ5g_SINR%2Csignalbar%2Ccell_id%2Cnr5g_action_band%2Ccell_id%2Cnetwork_provider%2Cmonthly_tx_bytes%2Cmonthly_rx_bytes%2Crealtime_tx_bytes%2Crealtime_rx_bytes%2Crealtime_tx_thrpt%2Crealtime_rx_thrpt%2Cwan_ipaddr%2Cwan_apn" cmd_url = f"{self.protocol}://{self.ip}/goform/goform_get_cmd_process?multi_data=1&isTest=false&cmd=wa_inner_version%2Clte_rssi%2CZ5g_rssi%2Clte_rsrp%2CZ5g_rsrp%2Clte_rsrq%2CZ5g_rsrq%2Clte_snr%2CZ5g_SINR%2Csignalbar%2Ccell_id%2Cnr5g_action_band%2Ccell_id%2Cnetwork_provider%2Cmonthly_tx_bytes%2Cmonthly_rx_bytes%2Crealtime_tx_bytes%2Crealtime_rx_bytes%2Crealtime_tx_thrpt%2Crealtime_rx_thrpt%2Cwan_ipaddr%2Cwan_apn%2Clte_multi_ca_scell_sig_info%2Cnr_multi_ca_scell_info%2Cnr5g_action_band"
cookie_pass = cookie cookie_pass = cookie
headers = { headers = {
@ -95,6 +95,11 @@ class zteRouter:
response = s.get(cmd_url, headers=headers, verify=False) response = s.get(cmd_url, headers=headers, verify=False)
return response.text return response.text
def iterateCellInfo(self, str, type):
for f in str:
print (f)
zteInstance = zteRouter(args.ip, args.username, args.password, args.login) zteInstance = zteRouter(args.ip, args.username, args.password, args.login)
serverPort = args.port serverPort = args.port
@ -114,23 +119,56 @@ class serveInfos(BaseHTTPRequestHandler):
self.wfile.write(bytes("%s\",cell_id=\"" % gatheredJson["wan_apn"], "utf-8")) self.wfile.write(bytes("%s\",cell_id=\"" % gatheredJson["wan_apn"], "utf-8"))
self.wfile.write(bytes("%s\"} 1\n\n" % gatheredJson["cell_id"], "utf-8")) self.wfile.write(bytes("%s\"} 1\n\n" % gatheredJson["cell_id"], "utf-8"))
self.wfile.write(bytes("# HELP zte_rsrq Reference Signal Received Quality\n# TYPE zte_rsrq gauge\n", "utf-8"))
if gatheredJson["lte_rsrq"]:
self.wfile.write(bytes("zte_rsrq{band=\"lte\"} %s\n" % gatheredJson["lte_rsrq"], "utf-8"))
if gatheredJson["Z5g_rsrq"]:
self.wfile.write(bytes("zte_rsrq{band=\"5g\"} %s\n\n" % gatheredJson["Z5g_rsrq"], "utf-8"))
self.wfile.write(bytes("# HELP zte_rsrp Reference Signal Received Power\n# TYPE zte_rsrp gauge\n", "utf-8")) self.wfile.write(bytes("# HELP zte_rsrp Reference Signal Received Power\n# TYPE zte_rsrp gauge\n", "utf-8"))
if gatheredJson["lte_rsrp"]:
self.wfile.write(bytes("zte_rsrp{band=\"lte\"} %s\n" % gatheredJson["lte_rsrp"], "utf-8"))
if gatheredJson["Z5g_rsrp"]:
self.wfile.write(bytes("zte_rsrp{band=\"5g\"} %s\n\n" % gatheredJson["Z5g_rsrp"], "utf-8"))
self.wfile.write(bytes("# HELP zte_snr Signal-to-Interference-plus-Noise Ratio\n# TYPE zte_snr gauge\n", "utf-8")) self.wfile.write(bytes("# HELP zte_snr Signal-to-Interference-plus-Noise Ratio\n# TYPE zte_snr gauge\n", "utf-8"))
if gatheredJson["lte_snr"]: self.wfile.write(bytes("# HELP zte_rsrq Reference Signal Received Quality\n# TYPE zte_rsrq gauge\n", "utf-8"))
self.wfile.write(bytes("zte_snr{band=\"lte\"} %s\n" % gatheredJson["lte_snr"], "utf-8")) self.wfile.write(bytes("# HELP zte_rssi Received Signal Strength Indicator\n# TYPE zte_rssi gauge\n", "utf-8"))
if gatheredJson["Z5g_SINR"]:
self.wfile.write(bytes("zte_snr{band=\"5g\"} %s\n\n" % gatheredJson["Z5g_SINR"], "utf-8")) if gatheredJson['nr_multi_ca_scell_info'] and gatheredJson['nr5g_action_band']:
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"))
self.wfile.write(bytes("zte_rsrp{band=\"%s\"} " % gatheredJson["nr5g_action_band"], "utf-8"))
self.wfile.write(bytes("%s\n" % gatheredJson["Z5g_rsrp"], "utf-8"))
self.wfile.write(bytes("zte_rssi{band=\"%s\"} " % gatheredJson["nr5g_action_band"], "utf-8"))
self.wfile.write(bytes("%s\n" % gatheredJson["Z5g_rssi"], "utf-8"))
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"))
for index, item in enumerate(gatheredJson['nr_multi_ca_scell_info'].split(";")):
nrbit = item.split(",")
if not len(nrbit[0]) == 0:
self.wfile.write(bytes("zte_rsrq{band=\"%s\"} " % nrbit[3], "utf-8"))
self.wfile.write(bytes("%s\n" % gatheredJson["Z5g_rsrq"], "utf-8"))
self.wfile.write(bytes("zte_rsrp{band=\"%s\"} " % nrbit[3], "utf-8"))
self.wfile.write(bytes("%s\n" % nrbit[7], "utf-8"))
self.wfile.write(bytes("zte_rssi{band=\"%s\"} " % nrbit[3], "utf-8"))
self.wfile.write(bytes("%s\n" % nrbit[10], "utf-8"))
self.wfile.write(bytes("zte_snr{band=\"%s\"} " % nrbit[3], "utf-8"))
self.wfile.write(bytes("%s\n\n" % nrbit[9], "utf-8"))
else:
if gatheredJson["lte_rsrq"]:
self.wfile.write(bytes("zte_rsrq{band=\"lte\"} %s\n" % gatheredJson["lte_rsrq"], "utf-8"))
if gatheredJson["Z5g_rsrq"]:
self.wfile.write(bytes("zte_rsrq{band=\"5g\"} %s\n" % gatheredJson["Z5g_rsrq"], "utf-8"))
if gatheredJson["lte_rsrp"]:
self.wfile.write(bytes("zte_rsrp{band=\"lte\"} %s\n" % gatheredJson["lte_rsrp"], "utf-8"))
if gatheredJson["Z5g_rssi"]:
self.wfile.write(bytes("zte_rsrp{band=\"5g\"} %s\n" % gatheredJson["Z5g_rssi"], "utf-8"))
if gatheredJson["lte_rssi"]:
self.wfile.write(bytes("zte_snr{band=\"lte\"} %s\n" % gatheredJson["lte_rssi"], "utf-8"))
if gatheredJson["Z5g_SINR"]:
self.wfile.write(bytes("zte_snr{band=\"5g\"} %s\n" % gatheredJson["Z5g_SINR"], "utf-8"))
if gatheredJson["lte_snr"]:
self.wfile.write(bytes("zte_snr{band=\"lte\"} %s\n" % gatheredJson["lte_snr"], "utf-8"))
if gatheredJson["Z5g_SINR"]:
self.wfile.write(bytes("zte_snr{band=\"5g\"} %s\n\n" % gatheredJson["Z5g_SINR"], "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("# 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")) self.wfile.write(bytes("zte_bandwidth_used_monthly_tx %s\n\n" % gatheredJson["monthly_tx_bytes"], "utf-8"))