Code Monkey home page Code Monkey logo

Comments (6)

DRuggeri avatar DRuggeri commented on July 28, 2024

Hi, @klein5656 - this would indicate that the collector is able to reach out to your router, but doesn't seem to like the XML response that came back. Can you share debug logs (being careful to redact any sensitive information)? This seems to be a totally different error message from what is seen in #12 so probably worth examining the debug info.

from netgear_exporter.

klein5656 avatar klein5656 commented on July 28, 2024

Hello @DRuggeri,

Here is the output from --clientdebug

root@raspberrypi:/home/netgear_exporter# /usr/local/bin/netgear_exporter --url=https://{router_IP} --web.auth.username=admin --insecure --timeout=1 --filter.collectors=Traffic --clientdebug
INFO[0000] Starting node_exporter testing source="netgear_exporter.go:180"
2022/12/17 14:30:26 netgear_client.go: Constructing debug client
INFO[0000] Listening on :9192 source="netgear_exporter.go:230"
2022/12/17 14:30:27 netgear_client.go: full url (derived)='https://{roter_IP}/soap/server_sa/', data='
<SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
SOAP-ENV:Header
A7D88AE69687E58D9A00
</SOAP-ENV:Header>
SOAP-ENV:Body
<M1:GetTrafficMeterStatistics xmlns:M1="urn:NETGEAR-ROUTER:service:DeviceConfig:1">
</M1:GetTrafficMeterStatistics>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>'
2022/12/17 14:30:27 netgear_client.go: Sending HTTP request to https://{roter_IP}/soap/server_sa/...
2022/12/17 14:30:27 netgear_client.go: Request headers:
2022/12/17 14:30:27 netgear_client.go: Content-Type: text/xml;charset=utf-8
2022/12/17 14:30:27 netgear_client.go: Soapaction: urn:NETGEAR-ROUTER:service:DeviceConfig:1#GetTrafficMeterStatistics
2022/12/17 14:30:27 netgear_client.go: Host: routerlogin.net
2022/12/17 14:30:27 netgear_client.go: Cookie: UNSET
2022/12/17 14:30:27 netgear_client.go: Content-Length: 580
2022/12/17 14:30:27 netgear_client.go: User-Agent: curl/7.59.0
2022/12/17 14:30:27 netgear_client.go: BODY:
2022/12/17 14:30:27
<SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
SOAP-ENV:Header
A7D88AE69687E58D9A00
</SOAP-ENV:Header>
SOAP-ENV:Body
<M1:GetTrafficMeterStatistics xmlns:M1="urn:NETGEAR-ROUTER:service:DeviceConfig:1">
</M1:GetTrafficMeterStatistics>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
2022/12/17 14:30:27 netgear_client.go: Response code: 401
2022/12/17 14:30:27 netgear_client.go: Response headers:
2022/12/17 14:30:27 netgear_client.go: Set-Cookie: XSRF_TOKEN=186932223; Path=/
2022/12/17 14:30:27 netgear_client.go: Www-Authenticate: Basic realm="NETGEAR R7000"
2022/12/17 14:30:27 netgear_client.go: Content-Type: text/html
2022/12/17 14:30:27 netgear_client.go: X-Frame-Options: SAMEORIGIN
ERRO[0001] Error while collecting traffic statistics: XML syntax error on line 4: element closed by source="traffic_collector.go:126"

It might just be I have a wrong config

from netgear_exporter.

DRuggeri avatar DRuggeri commented on July 28, 2024

Thanks, @klein5656 - this seems to be formatted differently or something. There appears to be several missing > and < characters in the output. Maybe that's just because GitHub has eaten some of the characters because they weren't captured in a preformtted output. Can you please double-check if that's the case? You can post pre-formatted/code text by using three ` characters in a row on an empty line, then paste the contents and close it out with another three ` characters

Debugging what I can tell, the HTTP response code coming back is a 401 with BASIC auth as the requested way to authenticate and a content-type of text/html. This is very different from my testing system - when I attempt to make a request before authorizing, I instead get a 200 response, content-type of text/xml, and in the body of the XML contents, receive the real response code:

2022/12/17 17:04:04 netgear_client.go: Response code: 200
2022/12/17 17:04:04 netgear_client.go: Response headers:
2022/12/17 17:04:04 netgear_client.go:   Content-Type: text/xml; charset="UTF-8"
2022/12/17 17:04:04 netgear_client.go:   Date: Sat, 17 Dec 2022 23:04:04 GMT
2022/12/17 17:04:04 netgear_client.go:   Content-Length: 389
2022/12/17 17:04:04 netgear_client.go:   Server: Linux/2.6.15 uhttpd/1.0.0 soap/1.0
2022/12/17 17:04:04 netgear_client.go: BODY:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<m:GetSystemInfoResponse xmlns:m="urn:NETGEAR-ROUTER:service:DeviceInfo:1"></m:GetSystemInfoResponse>
<ResponseCode>401</ResponseCode>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Your inclination that perhaps the URL is incorrect seems like a possible issue... but the URL that works on my system is https://{router_ip}/soap/server_sa/ - which is what you have as well.

My best guess is that perhaps this particular router (NETGEAR R7000 according to the auth header) doesn't support the Netgear SOAP API.

from netgear_exporter.

klein5656 avatar klein5656 commented on July 28, 2024

@DRuggeri I think you are right about the router not supporting the Netgear SOAP API. I'm checking with Netgear and will update you.

Thanks

from netgear_exporter.

klein5656 avatar klein5656 commented on July 28, 2024

@DRuggeri this can be closed. I'm almost positive my router is not compatible.

Thank you for your help!

from netgear_exporter.

DRuggeri avatar DRuggeri commented on July 28, 2024

All good, @klein5656

Cheers

from netgear_exporter.

Related Issues (14)

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.