sbrudenell / sb8200_exporter

A prometheus exporter for the Arris SB8200
MIT License
4 stars 9 forks source link

Periodic broken pipe messages. #6

Closed cypherstream closed 4 years ago

cypherstream commented 4 years ago

I'm testing this and pointed prometheus to localhost:9195 but it still says down, despite the fact I can put this URL in my browser and see the data (its loads very slowly, but so does my sb8200 stats page).

I notice an occasional message to the console when running this interactivly and I wonder if this means anythign to why I can't get Prometheus to see this data?

I even did wget http://localhost:9195 and it took almost 5 minutes to connect and get a 200 OK response and download the contents to index.html

Exception happened during processing of request from ('127.0.0.1', 57138) 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 "/usr/local/lib/python3.8/dist-packages/prometheus_client/exposition.py", line 174, in do_GET self.wfile.write(output) File "/usr/lib/python3.8/socketserver.py", line 799, in write self._sock.sendall(b) BrokenPipeError: [Errno 32] Broken pipe

cypherstream commented 4 years ago

I got prometheus to log the data.

In my prometheus.yaml file I had to increase the timeouts.

metrics_path: '/'

static_configs:

that scrape_interval and scrape_timeout I think are defaulted to 5s if not specified. Well that page takes MUCH longer than 5 seconds to load. Heck the SB8200 stats screen takes almost 30 seconds to load, and even then its just text... its another 30 seconds almost for all the css and graphics to load. The modem is the slowest modem I ever had in terms of accessing the statistics page.

Don't know about the random broken pipes, maybe because its just the SB8200 is very slow to respond to http requests. Much slower than my older 6183.

sbrudenell commented 4 years ago

Good find about the default scrape_timeout.

I no longer have my SB8200 (I moved out of the service area where I could use it), and I definitely saw it take arbitrarily long to load sometimes.

cypherstream commented 4 years ago

Yes and I think those occasional broken pipe messages are just timeouts reaching the modem. It continually retries so it does grab the data. It's probably occasional noise that isn't necessary to worry about if you are still receiving data.

This isn't an issue with this github repo, but I am researching now how to turn this into a service. I noticed when I closed putty last night to my ubuntu box, the service must have stopped (it was running interactively in bash, which is how I saw those broken pipe messages). If I get this configured as a service and also start at boot then I'll be golden.

Thank you for your work. It may be rudimentary to scrape data from the HTML page, but without any other SNMP or monitoring tools open between the customer and the modem, this way achieves the end goal.

sbrudenell commented 4 years ago

Indeed, most programs will die if you run them interactively in a shell, then kill the shell.

I recommend docker-compose for organizing services like this.

Thanks for the info though!