Closed jvillal-amp closed 9 months ago
See #1045 , the problem is that the main
Docker image tag is built with a generator binary using the latest tagged release in the repository, and not a binary using the latest state/commit of the main
branch.
The error you see is because the generator.yml
file in main
requires a recent feature not yet in a tagged release.
If you want to try a quick local fix, edit the generator/Dockerfile
file and change @latest
to @main
.
Afterwards, running make docker-generate
should work as expected.
Now that #1045 was merged, this should work as expected:
$ git clone git@github.com:prometheus/snmp_exporter.git
Cloning into 'snmp_exporter'...
remote: Enumerating objects: 7644, done.
remote: Counting objects: 100% (1680/1680), done.
remote: Compressing objects: 100% (462/462), done.
remote: Total 7644 (delta 1303), reused 1328 (delta 1192), pack-reused 5964
Receiving objects: 100% (7644/7644), 9.55 MiB | 8.07 MiB/s, done.
Resolving deltas: 100% (4297/4297), done.
$ cd snmp_exporter/generator/
$ make docker-generate
docker build --build-arg REPO_TAG="main" -t "prom/snmp-generator:main" .
(...)
>> Downloading apc-powernet-mib
# Workaround to make DisplayString available (#867)
>> Downloading Cisco AIRESPACE-REF-MIB
>> Downloading Cisco AIRESPACE-WIRELESS-MIB
>> Downloading ARISTA-ENTITY-SENSOR-MIB
(...)
docker run -ti -v "/home/hromic/temp/snmp_exporter/generator:/opt/" "prom/snmp-generator:main" generate
ts=2023-11-21T10:57:58.161Z caller=net_snmp.go:175 level=info msg="Loading MIBs" from=mibs
ts=2023-11-21T10:57:58.343Z caller=main.go:53 level=info msg="Generating config for module" module=ubiquiti_airmax
ts=2023-11-21T10:57:58.359Z caller=main.go:68 level=info msg="Generated metrics" module=ubiquiti_airmax metrics=79
ts=2023-11-21T10:57:58.359Z caller=main.go:53 level=info msg="Generating config for module" module=keepalived
ts=2023-11-21T10:57:58.400Z caller=main.go:68 level=info msg="Generated metrics" module=keepalived metrics=187
(...)
ts=2023-11-21T10:58:14.737Z caller=main.go:93 level=info msg="Config written" file=/opt/snmp.yml
Thanks. I will test this when I get back from vacation next week.
I have tested it this morning.
I am getting the following error now:
ts=2023-11-27T15:48:48.150Z caller=net_snmp.go:175 level=info msg="Loading MIBs" from=mibs
ts=2023-11-27T15:48:48.150Z caller=main.go:134 level=error msg="Error generating config netsnmp" err="unable to determine absolute path for output"
make: *** [Makefile:92: docker-generate] Error 1
Not sure if I should open a new issue or not.
Current tip is:
commit d404ca54576558b2489504f50e309796f134d9d7 (HEAD -> refs/heads/main, refs/remotes/origin/main, refs/remotes/origin/HEAD)
Author: Nico <rey.nico@gmail.com>
Date: Sat Nov 25 05:33:53 2023 -0300
Add Netgear ReadyNAS and ReadyData appliances support (#1053)
<snip>
Never mind. I forgot to modify the Makefile to allow selinux
to work. Once I did that then everything is working.
Thanks for the help @hhromic !!
@hhromic I created a PR to resolve my SELINUX issue. https://github.com/prometheus/snmp_exporter/pull/1054
Error seen is:
Using: