Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form action wrong in snmp-exporter Docker container / version 0.28.0 #1386

Closed
4N-TE opened this issue Mar 7, 2025 · 1 comment
Closed

Form action wrong in snmp-exporter Docker container / version 0.28.0 #1386

4N-TE opened this issue Mar 7, 2025 · 1 comment

Comments

@4N-TE
Copy link

4N-TE commented Mar 7, 2025

Hi,

if I run SNMP Exporter as docker container like this:

docker run -p 9116:9116 -v ./snmp.yml:/etc/snmp_exporter/snmp.yml -d prom/snmp-exporter

and then connect to http://localhost:9116 using a browser I get a form where I can enter Target, Auth and Module to do a test run of polling SNMP data.

Once I click submit I get an error that hostname "snmp" cannot be resolved. I can see that the URL the brower (Firefox or Chrome) tries to open is this:

http://snmp/?target=1.2.3.4&auth=v3&module=if_mib

If I run snmp-exporter without using a docker container the URL is correctly generated as:

http://localhost:9116/snmp?target=1.2.3.4&auth=v3&module=if_mib

The version in the container is 0.28.0:
snmp_exporter, version 0.28.0 (branch: HEAD, revision: 9f9547f)

The version I have outside the container is slightly older at 0.26.0:
snmp_exporter, version 0.26.0 (branch: main, revision: e9a9866)

The reason for the error is that in the container (0.28.0) the HTML that displays the form reads

<form action="//snmp">

while outside the container (0.26.0) it reads:

<form action="/snmp">

If I user browser side tools to modify the HTML to just use /snmp as the form action then submitting my query also works with 0.28.0.

When manually entering the correctly formatted URL that works with 0.28.0, too - so at least Prometheus does not have issues scraping the metrics.

I assume the form HTML is wrong in 0.28.0.

Regards
Thomas

@bastischubert
Copy link
Member

duplicate of #1366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants