mbugert / connectbox-prometheus

Prometheus exporter for Compal CH7465LG cable modems, commonly sold as "Connect Box"
Apache License 2.0
49 stars 9 forks source link

Unknown provisioning status 'Modem Mode' #5

Closed klaver closed 3 years ago

klaver commented 3 years ago

My Compal CH7465LG is in bridge-modus, maybe that might explain te error listed below?

Exception happened during processing of request from ('127.0.0.1', 35354)
ValueError: 'Modem Mode' is not a valid ProvisioningStatus

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/connectbox_exporter/xml2metric.py", line 357, in extract
    enum_provisioning_status = ProvisioningStatus(provisioning_status)
  File "/usr/lib/python3.7/enum.py", line 310, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.7/enum.py", line 564, in __new__
    raise exc
  File "/usr/lib/python3.7/enum.py", line 548, in __new__
    result = cls._missing_(value)
  File "/usr/lib/python3.7/enum.py", line 577, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 'Modem Mode' is not a valid ProvisioningStatus

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/lib/python3.7/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
    method()
  File "/usr/local/lib/python3.7/dist-packages/prometheus_client/exposition.py", line 152, in do_GET
    output = encoder(registry)
  File "/usr/local/lib/python3.7/dist-packages/prometheus_client/exposition.py", line 90, in generate_latest
    for metric in registry.collect():
  File "/usr/local/lib/python3.7/dist-packages/prometheus_client/registry.py", line 75, in collect
    for metric in collector.collect():
  File "/usr/local/lib/python3.7/dist-packages/connectbox_exporter/connectbox_exporter.py", line 79, in collect
    yield from extractor.extract(raw_xmls)
  File "/usr/local/lib/python3.7/dist-packages/connectbox_exporter/xml2metric.py", line 360, in extract
    f"Unknown provisioning status '{provisioning_status}'. Please open an issue on Github."
ValueError: Unknown provisioning status 'Modem Mode'. Please open an issue on Github.

Manually workaround by editing line 302 of xml2metric.py: ONLINE = "Modem Mode"

thoro commented 3 years ago

@klaver How can you access the Connect Box if it's in Bridge Mode?

klaver commented 3 years ago

When the Connect Box is in bridge mode, it will respond to a (undocumented?) virtual IP address 192.168.100.1

thoro commented 3 years ago

Wow thanks - I had no idea, and Magenta / UPC always told me that it's impossible to get to the web interface in bridge mode!

mbugert commented 3 years ago

Thanks, yes. I couldn't test this because my provider has disabled bridge mode. :disappointed: #4 has addressed this, a release will follow later today.

Edit: Please try v0.2.7 from pypi and let me know if it's working for you.

mbugert commented 3 years ago

This should be fixed from my POV, so I'll close this.