1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00

[arris-sb8200] Fix channel selection and warnings

This actually silences InsecureRequestWarning.
The Arris SB8200 has 32 downstream channels, but in my experience
report more than that, but the "extra" channels report modulation as
"Other" instead of QAM256.  This filters those channels, since they seem
to drive the error count up, but don't provide data.

Signed-off-by: Nathaniel Clark <Nathaniel.Clark@misrule.us>
This commit is contained in:
Nathaniel Clark 2023-02-10 06:56:51 -05:00 committed by Kenyon Ralph
parent 2a12025ee5
commit cfea1e2332

View file

@ -98,13 +98,10 @@ import os
import sys import sys
import base64 import base64
# SB8200 has bad SSL cert, ignore warnings
import urllib3
urllib3.disable_warnings()
# Extra Packages # Extra Packages
# SB8200 has bad SSL cert, ignore warnings
import requests import requests
requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)
from lxml import html from lxml import html
@ -177,8 +174,9 @@ class Modem:
# Sets maximum number of channels # Sets maximum number of channels
UPCOUNT = 8 UPCOUNT = 8
DOWNCOUNT = 33 DOWNCOUNT = 32
# DOWNCOUNT should be 32, but I have observed 33 # DOWNCOUNT should be 32, I have observed "extra" channels with
# modulation type of "Other" which only ever have errors
if os.getenv("password", None) is None: if os.getenv("password", None) is None:
print("Set password.", file=sys.stderr) print("Set password.", file=sys.stderr)
@ -388,6 +386,8 @@ for row in trs:
data = dict( data = dict(
zip(headings, ["".join(x.itertext()).strip() for x in row.findall("td")]) zip(headings, ["".join(x.itertext()).strip() for x in row.findall("td")])
) )
if data["Modulation"] == "Other":
continue
uncorr += int(data["Uncorrectables"]) uncorr += int(data["Uncorrectables"])
correct += int(data["Corrected"]) correct += int(data["Corrected"])