Get the image containing the Prometheus SNMP webhook into registry.opensuse.org. OBS-URL: https://build.opensuse.org/request/show/835207 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/prometheus-webhook-snmp-image?expand=0&rev=1
1.5 KiB
Networking
You need to publish the port the Prometheus receiver is listening on by
using the command line argument --publish <HOST_PORT>:<CONTAINER_PORT>
when running the container because the port is not exposed automatically
because it is configurable. The default port is 9099
.
Additionally the SNMP host needs to be configured. Use the container's network gateway to be able to receive SNMP traps outside the container.
$ docker run --publish <LISTENING_PORT>:<LISTENING_PORT> --env ARGS="--debug --snmp-host=<CONTAINER_GATEWAY>" ...
Alternatively simply connect the container to the host network.
$ docker run --network=host ...
Configure prometheus-webhook-snmp
The configuration documentation can be found here.
The container can be configured via the environment variables ARGS
and
RUN_ARGS
or by mounting a configuration file into the container.
Using environment variables
Use ARGS
to set global options
and RUN_ARGS
for the run command options.
The environment variable ARGS
defaults to --debug
.
$ docker run --env ARGS="--debug --snmp-community=foo" --env RUN_ARGS="--metrics" ...
Using a configuration file
$ docker run -v $(pwd)/prometheus-webhook-snmp.conf:/etc/prometheus-webhook-snmp.conf ...