Giter Club home page Giter Club logo

py_arris_exporter's Introduction

py_arris_exporter

This is a python script, installed into Docker, which facilitates scraping Arris SB6183 cablemodems for their relevant RF data and surfacing that to prometheus.

Screenshot of grafana dashboard

How to use

There are three methods one could use to run this software:

local

One can install this app by running pip install . in the source directory. If you're curious about prerequisites, check setup.py. Once installed, executing py_arris_exporter will start a python webserver on port 9393. Any request uri to the service will return a set of prometheus metrics.

docker

You can also run this app as a docker container by executing docker run -d -p9393:9393 petergrace/arris_exporter which will spawn a container and daemonize, exposing the port on your local system at port 9393. This is better if you don't want to commingle your python environment installs.

helm

If you are leveraging kubernetes, there is a helm chart under the helm/ subdirectory of this repository where you can deploy petergrace/arris_exporter directly to your kubernetes cluster. It will create a service called arris-exporter on a ClusterIP that you can then target with your prometheus install.

prometheus configuration

Here's a snippet of my scrape config for prometheus inside of my kubernetes environment:

- job_name: 'arris'
  static_configs:
    - targets: ['arris-exporter:9393']

As you can see, it doesn't have many bells or whistles; it just reports the data I wanted to see to prometheus.

grafana config

In the grafana/ subdirectory, I have included my grafana dashboard json that I use to query the datapoints from prometheus, to make the screenshot shown above.

py_arris_exporter's People

Contributors

petergrace avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

py_arris_exporter's Issues

Customize for SB8200

The URL for the SB8200 is http://192.168.100.1/cmconnectionstatus.html

I edited this in the handler.py and reinstalled it (pip3 install py_arris_exporter) and when I run it I get this about broken pipes. Can you help?

EBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.1:80
DEBUG:urllib3.connectionpool:http://192.168.100.1:80 "GET /cmconnectionstatus.html HTTP/1.1" 200 None
DEBUG:dogpile.cache.region:Cache value generated in 17.178 seconds for key(s): 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:Released creation lock
127.0.0.1 - - [28/Sep/2020 13:58:28] "GET / HTTP/1.1" 200 -
ERROR:main:Exception when trying to write to socket: [Errno 32] Broken pipe
127.0.0.1 - - [28/Sep/2020 13:58:28] "GET / HTTP/1.1" 200 -
DEBUG:dogpile.lock:value creation lock <dogpile.cache.region.CacheRegion._LockWrapper object at 0x7fb2b0b53130> acquired
DEBUG:dogpile.lock:Calling creation function for previously expired value
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.1:80
DEBUG:urllib3.connectionpool:http://192.168.100.1:80 "GET /cmconnectionstatus.html HTTP/1.1" 200 None
DEBUG:dogpile.cache.region:Cache value generated in 16.948 seconds for key(s): 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:Released creation lock
127.0.0.1 - - [28/Sep/2020 13:58:58] "GET / HTTP/1.1" 200 -
ERROR:main:Exception when trying to write to socket: [Errno 32] Broken pipe
127.0.0.1 - - [28/Sep/2020 13:58:58] "GET / HTTP/1.1" 200 -

Wait, how do you install this on Ubuntu 20.04 LTS?

root@Rockheart:/home/user/py_arris_exporter# pip3 install
ERROR: You must give at least one requirement to install (see "pip help install")
root@Rockheart:/home/user/py_arris_exporter# pip3 install py_arris_exporter
ERROR: Could not find a version that satisfies the requirement py_arris_exporter (from versions: none)
ERROR: No matching distribution found for py_arris_exporter
root@Rockheart:/home/user/py_arris_exporter# pip3 install setup.py
ERROR: Could not find a version that satisfies the requirement setup.py (from versions: none)
ERROR: No matching distribution found for setup.py

I already have grafana and prometheus setup. Can't i program prometheus manually? How'd you do it?

Cannot read property 'result' of undefined

Installed and verified http://localhost:9393 is pulling data from modem. It looks like a wall of text, but the numbers returned are legitimate.

I copy and paste your grafana.json file into grafana and it created the dashboard called Cablemodem. I ensured that http://localhost:9393 was created as a data source and set as default...the type is prometheus.

Though when going into the dashboard every single element has a red triangle that when expanded it says Cannot read propery 'result' of undefined.

With F12 (Browser dev-tools) enabled I can see the query in the network > Preview (using Edge Chromium based browser). Here is an example:

arris_connectivity_state{} 1
arris_downstream_locked{index="1",modulation="QAM256",channel_id="13",frequency="663000000"} 1
arris_downstream_packets_corrected{index="1",modulation="QAM256",channel_id="13",frequency="663000000"} 0
arris_downstream_packets_uncorrectable{index="1",modulation="QAM256",channel_id="13",frequency="663000000"} 0
arris_downstream_power{index="1",modulation="QAM256",channel_id="13",frequency="663000000"} -2.2
arris_downstream_snr{index="1",modulation="QAM256",channel_id="13",frequency="663000000"} 40.0
arris_downstream_locked{index="2",modulation="QAM256",channel_id="17",frequency="543000000"} 1
arris_downstream_packets_corrected{index="2",modulation="QAM256",channel_id="17",frequency="543000000"} 97
arris_downstream_packets_uncorrectable{index="2",modulation="QAM256",channel_id="17",frequency="543000000"} 0
arris_downstream_power{index="2",modulation="QAM256",channel_id="17",frequency="543000000"} -3.5
arris_downstream_snr{index="2",modulation="QAM256",channel_id="17",frequency="543000000"} 39.9
arris_downstream_locked{index="3",modulation="QAM256",channel_id="18",frequency="549000000"} 1
arris_downstream_packets_corrected{index="3",modulation="QAM256",channel_id="18",frequency="549000000"} 10
arris_downstream_packets_uncorrectable{index="3",modulation="QAM256",channel_id="18",frequency="549000000"} 0
arris_downstream_power{index="3",modulation="QAM256",channel_id="18",frequency="549000000"} -3.2
arris_downstream_snr{index="3",modulation="QAM256",channel_id="18",frequency="549000000"} 40.0
arris_downstream_locked{index="4",modulation="QAM256",channel_id="19",frequency="555000000"} 1
arris_downstream_packets_corrected{index="4",modulation="QAM256",channel_id="19",frequency="555000000"} 14
arris_downstream_packets_uncorrectable{index="4",modulation="QAM256",channel_id="19",frequency="555000000"} 0
arris_downstream_power{index="4",modulation="QAM256",channel_id="19",frequency="555000000"} -3.3
arris_downstream_snr{index="4",modulation="QAM256",channel_id="19",frequency="555000000"} 39.9
arris_downstream_locked{index="5",modulation="QAM256",channel_id="20",frequency="561000000"} 1
arris_downstream_packets_corrected{index="5",modulation="QAM256",channel_id="20",frequency="561000000"} 5
arris_downstream_packets_uncorrectable{index="5",modulation="QAM256",channel_id="20",frequency="561000000"} 0
arris_downstream_power{index="5",modulation="QAM256",channel_id="20",frequency="561000000"} -3.0
arris_downstream_snr{index="5",modulation="QAM256",channel_id="20",frequency="561000000"} 40.1
arris_downstream_locked{index="6",modulation="QAM256",channel_id="21",frequency="567000000"} 1
arris_downstream_packets_corrected{index="6",modulation="QAM256",channel_id="21",frequency="567000000"} 1
arris_downstream_packets_uncorrectable{index="6",modulation="QAM256",channel_id="21",frequency="567000000"} 0
arris_downstream_power{index="6",modulation="QAM256",channel_id="21",frequency="567000000"} -2.9
arris_downstream_snr{index="6",modulation="QAM256",channel_id="21",frequency="567000000"} 40.1
arris_downstream_locked{index="7",modulation="QAM256",channel_id="22",frequency="573000000"} 1
arris_downstream_packets_corrected{index="7",modulation="QAM256",channel_id="22",frequency="573000000"} 0
arris_downstream_packets_uncorrectable{index="7",modulation="QAM256",channel_id="22",frequency="573000000"} 0
arris_downstream_power{index="7",modulation="QAM256",channel_id="22",frequency="573000000"} -2.6
arris_downstream_snr{index="7",modulation="QAM256",channel_id="22",frequency="573000000"} 40.2
arris_downstream_locked{index="8",modulation="QAM256",channel_id="23",frequency="579000000"} 1
arris_downstream_packets_corrected{index="8",modulation="QAM256",channel_id="23",frequency="579000000"} 0
arris_downstream_packets_uncorrectable{index="8",modulation="QAM256",channel_id="23",frequency="579000000"} 0
arris_downstream_power{index="8",modulation="QAM256",channel_id="23",frequency="579000000"} -2.6
arris_downstream_snr{index="8",modulation="QAM256",channel_id="23",frequency="579000000"} 40.1
arris_downstream_locked{index="9",modulation="QAM256",channel_id="24",frequency="585000000"} 1
arris_downstream_packets_corrected{index="9",modulation="QAM256",channel_id="24",frequency="585000000"} 0
arris_downstream_packets_uncorrectable{index="9",modulation="QAM256",channel_id="24",frequency="585000000"} 0
arris_downstream_power{index="9",modulation="QAM256",channel_id="24",frequency="585000000"} -2.5
arris_downstream_snr{index="9",modulation="QAM256",channel_id="24",frequency="585000000"} 40.1
arris_downstream_locked{index="10",modulation="QAM256",channel_id="1",frequency="591000000"} 1
arris_downstream_packets_corrected{index="10",modulation="QAM256",channel_id="1",frequency="591000000"} 0
arris_downstream_packets_uncorrectable{index="10",modulation="QAM256",channel_id="1",frequency="591000000"} 0
arris_downstream_power{index="10",modulation="QAM256",channel_id="1",frequency="591000000"} -2.7
arris_downstream_snr{index="10",modulation="QAM256",channel_id="1",frequency="591000000"} 40.0
arris_downstream_locked{index="11",modulation="QAM256",channel_id="2",frequency="597000000"} 1
arris_downstream_packets_corrected{index="11",modulation="QAM256",channel_id="2",frequency="597000000"} 0
arris_downstream_packets_uncorrectable{index="11",modulation="QAM256",channel_id="2",frequency="597000000"} 0
arris_downstream_power{index="11",modulation="QAM256",channel_id="2",frequency="597000000"} -2.8
arris_downstream_snr{index="11",modulation="QAM256",channel_id="2",frequency="597000000"} 40.0
arris_downstream_locked{index="12",modulation="QAM256",channel_id="3",frequency="603000000"} 1
arris_downstream_packets_corrected{index="12",modulation="QAM256",channel_id="3",frequency="603000000"} 0
arris_downstream_packets_uncorrectable{index="12",modulation="QAM256",channel_id="3",frequency="603000000"} 0
arris_downstream_power{index="12",modulation="QAM256",channel_id="3",frequency="603000000"} -3.1
arris_downstream_snr{index="12",modulation="QAM256",channel_id="3",frequency="603000000"} 39.8
arris_downstream_locked{index="13",modulation="QAM256",channel_id="4",frequency="609000000"} 1
arris_downstream_packets_corrected{index="13",modulation="QAM256",channel_id="4",frequency="609000000"} 0
arris_downstream_packets_uncorrectable{index="13",modulation="QAM256",channel_id="4",frequency="609000000"} 0
arris_downstream_power{index="13",modulation="QAM256",channel_id="4",frequency="609000000"} -3.4
arris_downstream_snr{index="13",modulation="QAM256",channel_id="4",frequency="609000000"} 39.7
arris_downstream_locked{index="14",modulation="QAM256",channel_id="5",frequency="615000000"} 1
arris_downstream_packets_corrected{index="14",modulation="QAM256",channel_id="5",frequency="615000000"} 1
arris_downstream_packets_uncorrectable{index="14",modulation="QAM256",channel_id="5",frequency="615000000"} 0
arris_downstream_power{index="14",modulation="QAM256",channel_id="5",frequency="615000000"} -3.3
arris_downstream_snr{index="14",modulation="QAM256",channel_id="5",frequency="615000000"} 39.8
arris_downstream_locked{index="15",modulation="QAM256",channel_id="6",frequency="621000000"} 1
arris_downstream_packets_corrected{index="15",modulation="QAM256",channel_id="6",frequency="621000000"} 1
arris_downstream_packets_uncorrectable{index="15",modulation="QAM256",channel_id="6",frequency="621000000"} 0
arris_downstream_power{index="15",modulation="QAM256",channel_id="6",frequency="621000000"} -3.6
arris_downstream_snr{index="15",modulation="QAM256",channel_id="6",frequency="621000000"} 39.8
arris_downstream_locked{index="16",modulation="QAM256",channel_id="9",frequency="639000000"} 1
arris_downstream_packets_corrected{index="16",modulation="QAM256",channel_id="9",frequency="639000000"} 0
arris_downstream_packets_uncorrectable{index="16",modulation="QAM256",channel_id="9",frequency="639000000"} 0
arris_downstream_power{index="16",modulation="QAM256",channel_id="9",frequency="639000000"} -3.5
arris_downstream_snr{index="16",modulation="QAM256",channel_id="9",frequency="639000000"} 39.7
arris_upstream_locked{index="1",type="TDMA and ATDMA",channel_id="2",frequency="27000000"} 1
arris_upstream_symbol_rate{index="1",type="TDMA and ATDMA",channel_id="2",frequency="27000000"} 2560
arris_upstream_power{index="1",type="TDMA and ATDMA",channel_id="2",frequency="27000000"} 47.5
arris_upstream_locked{index="2",type="TDMA and ATDMA",channel_id="1",frequency="23000000"} 1
arris_upstream_symbol_rate{index="2",type="TDMA and ATDMA",channel_id="1",frequency="23000000"} 2560
arris_upstream_power{index="2",type="TDMA and ATDMA",channel_id="1",frequency="23000000"} 47.3
arris_upstream_locked{index="3",type="ATDMA",channel_id="3",frequency="32000000"} 1
arris_upstream_symbol_rate{index="3",type="ATDMA",channel_id="3",frequency="32000000"} 5120
arris_upstream_power{index="3",type="ATDMA",channel_id="3",frequency="32000000"} 47.8
arris_upstream_locked{index="4",type="ATDMA",channel_id="4",frequency="38500000"} 1
arris_upstream_symbol_rate{index="4",type="ATDMA",channel_id="4",frequency="38500000"} 5120
arris_upstream_power{index="4",type="ATDMA",channel_id="4",frequency="38500000"} 47.8

However nothing is plotted on the dashboard. The request tab shows the following

Object
state:"Error"
series:Array[0]
request:Object
app:"dashboard"
requestId:"Q100"
timezone:""
panelId:6
dashboardId:1
range:Object
from:p
to:p
raw:Object
timeInfo:""
interval:"1m"
intervalMs:60000
targets:Array[1]
0:Object
maxDataPoints:100
scopedVars:Object
__interval:Object
__interval_ms:Object
cacheTimeout:null
startTime:1589465935475
rangeRaw:Object
from:"now-12h"
to:"now"
timeRange:Object
from:p
_isAMomentObject:true
_isUTC:false
_pf:Object
_locale:O
_d:Date
_isValid:true
to:p
_isAMomentObject:true
_isUTC:false
_pf:Object
_locale:O
_d:Date
_isValid:true
raw:Object
from:"now-12h"
to:"now"
error:TypeError
timings:Object
dataProcessingTime:0.18000000272877514

How do you get this to plot the data that is being returned?

UnboundLocalError: local variable 'rs' referenced before assignment

I got this to work fine for a few weeks but after a reboot the application will no longer start on Ubuntu LTS 20.04

UnboundLocalError: local variable 'rs' referenced before assignment

user@grafana:~/py_arris_exporter$ py_arris_exporter
INFO:main:Starting http server.
DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:NeedRegenerationException
DEBUG:dogpile.lock:no value, waiting for create lock
DEBUG:dogpile.lock:value creation lock <dogpile.cache.region.CacheRegion._LockWrapper object at 0x7f50310cbe50> acquired
DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:Calling creation function for not-yet-present value
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.1:80
ERROR:main:exception: HTTPConnectionPool(host='192.168.100.1', port=80): Max retries exceeded with url: /RgConnect.asp (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5031070f70>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
DEBUG:dogpile.lock:Released creation lock

Exception happened during processing of request from ('127.0.0.1', 37106)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 12, in do_GET
self.respond()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 22, in respond
data = process()
File "", line 2, in process
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 1359, in get_or_create_for_user_func
return self.get_or_create(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 957, in get_or_create
with Lock(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 185, in enter
return self._enter()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 94, in _enter
generated = self._enter_create(value, createdtime)
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 178, in _enter_create
return self.creator()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 915, in gen_value
created_value = creator(
File "/home/user/py_arris_exporter/py_arris_exporter/handler.py", line 22, in process
html = re.sub(r'(\r|\n|\t)', '', rs.text)
UnboundLocalError: local variable 'rs' referenced before assignment

DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:NeedRegenerationException
DEBUG:dogpile.lock:no value, waiting for create lock
DEBUG:dogpile.lock:value creation lock <dogpile.cache.region.CacheRegion._LockWrapper object at 0x7f50310cbd90> acquired
DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:Calling creation function for not-yet-present value
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.1:80
ERROR:main:exception: HTTPConnectionPool(host='192.168.100.1', port=80): Max retries exceeded with url: /RgConnect.asp (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5031070610>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
DEBUG:dogpile.lock:Released creation lock

Exception happened during processing of request from ('192.168.5.13', 51235)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 12, in do_GET
self.respond()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 22, in respond
data = process()
File "", line 2, in process
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 1359, in get_or_create_for_user_func
return self.get_or_create(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 957, in get_or_create
with Lock(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 185, in enter
return self._enter()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 94, in _enter
generated = self._enter_create(value, createdtime)
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 178, in _enter_create
return self.creator()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 915, in gen_value
created_value = creator(
File "/home/user/py_arris_exporter/py_arris_exporter/handler.py", line 22, in process
html = re.sub(r'(\r|\n|\t)', '', rs.text)
UnboundLocalError: local variable 'rs' referenced before assignment

DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:NeedRegenerationException
DEBUG:dogpile.lock:no value, waiting for create lock
DEBUG:dogpile.lock:value creation lock <dogpile.cache.region.CacheRegion._LockWrapper object at 0x7f50310cbd90> acquired
DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:Calling creation function for not-yet-present value
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.1:80
ERROR:main:exception: HTTPConnectionPool(host='192.168.100.1', port=80): Max retries exceeded with url: /RgConnect.asp (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5030fd1b50>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
DEBUG:dogpile.lock:Released creation lock

Exception happened during processing of request from ('192.168.5.13', 51239)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 12, in do_GET
self.respond()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 22, in respond
data = process()
File "", line 2, in process
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 1359, in get_or_create_for_user_func
return self.get_or_create(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 957, in get_or_create
with Lock(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 185, in enter
return self._enter()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 94, in _enter
generated = self._enter_create(value, createdtime)
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 178, in _enter_create
return self.creator()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 915, in gen_value
created_value = creator(
File "/home/user/py_arris_exporter/py_arris_exporter/handler.py", line 22, in process
html = re.sub(r'(\r|\n|\t)', '', rs.text)
UnboundLocalError: local variable 'rs' referenced before assignment

DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:NeedRegenerationException
DEBUG:dogpile.lock:no value, waiting for create lock
DEBUG:dogpile.lock:value creation lock <dogpile.cache.region.CacheRegion._LockWrapper object at 0x7f50310cbd90> acquired
DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:Calling creation function for not-yet-present value
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.1:80
ERROR:main:exception: HTTPConnectionPool(host='192.168.100.1', port=80): Max retries exceeded with url: /RgConnect.asp (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5030fdd760>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
DEBUG:dogpile.lock:Released creation lock

Exception happened during processing of request from ('192.168.5.13', 51240)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 12, in do_GET
self.respond()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 22, in respond
data = process()
File "", line 2, in process
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 1359, in get_or_create_for_user_func
return self.get_or_create(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 957, in get_or_create
with Lock(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 185, in enter
return self._enter()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 94, in _enter
generated = self._enter_create(value, createdtime)
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 178, in _enter_create
return self.creator()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 915, in gen_value
created_value = creator(
File "/home/user/py_arris_exporter/py_arris_exporter/handler.py", line 22, in process
html = re.sub(r'(\r|\n|\t)', '', rs.text)
UnboundLocalError: local variable 'rs' referenced before assignment

DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:NeedRegenerationException
DEBUG:dogpile.lock:no value, waiting for create lock
DEBUG:dogpile.lock:value creation lock <dogpile.cache.region.CacheRegion._LockWrapper object at 0x7f50310cbd90> acquired
DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:Calling creation function for not-yet-present value
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.1:80
ERROR:main:exception: HTTPConnectionPool(host='192.168.100.1', port=80): Max retries exceeded with url: /RgConnect.asp (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5030fe6370>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
DEBUG:dogpile.lock:Released creation lock

Exception happened during processing of request from ('192.168.5.13', 51251)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 12, in do_GET
self.respond()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 22, in respond
data = process()
File "", line 2, in process
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 1359, in get_or_create_for_user_func
return self.get_or_create(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 957, in get_or_create
with Lock(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 185, in enter
return self._enter()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 94, in _enter
generated = self._enter_create(value, createdtime)
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 178, in _enter_create
return self.creator()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 915, in gen_value
created_value = creator(
File "/home/user/py_arris_exporter/py_arris_exporter/handler.py", line 22, in process
html = re.sub(r'(\r|\n|\t)', '', rs.text)
UnboundLocalError: local variable 'rs' referenced before assignment

DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:NeedRegenerationException
DEBUG:dogpile.lock:no value, waiting for create lock
DEBUG:dogpile.lock:value creation lock <dogpile.cache.region.CacheRegion._LockWrapper object at 0x7f50310cbd90> acquired
DEBUG:dogpile.cache.region:No value present for key: 'py_arris_exporter.handler:process|'
DEBUG:dogpile.lock:Calling creation function for not-yet-present value
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.1:80
ERROR:main:exception: HTTPConnectionPool(host='192.168.100.1', port=80): Max retries exceeded with url: /RgConnect.asp (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5030fd1c40>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
DEBUG:dogpile.lock:Released creation lock

Exception happened during processing of request from ('127.0.0.1', 37108)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 12, in do_GET
self.respond()
File "/home/user/py_arris_exporter/py_arris_exporter/server.py", line 22, in respond
data = process()
File "", line 2, in process
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 1359, in get_or_create_for_user_func
return self.get_or_create(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 957, in get_or_create
with Lock(
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 185, in enter
return self._enter()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 94, in _enter
generated = self._enter_create(value, createdtime)
File "/home/user/.local/lib/python3.8/site-packages/dogpile/lock.py", line 178, in _enter_create
return self.creator()
File "/home/user/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 915, in gen_value
created_value = creator(
File "/home/user/py_arris_exporter/py_arris_exporter/handler.py", line 22, in process
html = re.sub(r'(\r|\n|\t)', '', rs.text)
UnboundLocalError: local variable 'rs' referenced before assignment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.