You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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
The text was updated successfully, but these errors were encountered: