Also, look at the body of the HTTP error response (again, tcpdump can help 
there) and you may get a clue.  For example:

# *curl -v localhost:9116/snmp*
*   Trying 127.0.0.1:9116...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9116 (#0)
> GET /snmp HTTP/1.1
> Host: localhost:9116
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
*< HTTP/1.1 400 Bad Request*
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 22 Dec 2022 14:04:17 GMT
< Content-Length: 42
<
*'target' parameter must be specified once*
* Connection #0 to host localhost left intact


# *curl -v 'localhost:9116/snmp?target=1.2.3.4&module=wombat'*
*   Trying 127.0.0.1:9116...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9116 (#0)
> GET /snmp?target=1.2.3.4&module=wombat HTTP/1.1
> Host: localhost:9116
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse

*< HTTP/1.1 400 Bad Request*< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 22 Dec 2022 14:06:45 GMT
< Content-Length: 24
<
*Unknown module 'wombat'*
* Connection #0 to host localhost left intact

On Thursday, 22 December 2022 at 11:50:13 UTC Brian Candler wrote:

> That's an error telling you that *you* did something wrong.
>
> If you want *us* to help you find the solution to your problem, then 
> you'll need to show some more information [^1].  What request are you 
> sending? If it's curl, show the command line.  If it's a prometheus scrape, 
> then show the scrape job configuration.
>
> You can also look at the actual request and response using tcpdump: e.g. 
> if you're sending requests to snmp_exporter on localhost (127.0.0.1), which 
> is a common configuration, then:
>
> tcpdump -i lo -nn -s0 -A tcp port 9116
>
> [^1] Recommended reading: 
> http://www.catb.org/~esr/faqs/smart-questions.html#intro
>
> On Thursday, 22 December 2022 at 10:38:12 UTC ktorce wrote:
>
>> "server returned HTTP status 400 Bad Request"
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/fd7de4cd-831b-44b3-b132-ad9aef2c2458n%40googlegroups.com.

Reply via email to