File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ See the `-help` output for more options.
5050 Path under which to expose metrics. (default "/metrics")
5151```
5252
53+ ### Environment Variables
54+
55+ Some values can be set via environment variables:
56+
57+ | Name | Description |
58+ | -------- | ----------- |
59+ | ICINGA2_EXPORTER_HTTP_PASSWORD | Password to use for basic auth |
60+
5361### Cache
5462
5563The exporter caches the responses from the Icinga2 API to decrease load on the API.
Original file line number Diff line number Diff line change @@ -111,6 +111,12 @@ func main() {
111111 Level : logLevel ,
112112 }))
113113
114+ if cliPassword == "" {
115+ if v , ok := os .LookupEnv ("ICINGA2_EXPORTER_HTTP_PASSWORD" ); ok {
116+ cliPassword = v
117+ }
118+ }
119+
114120 // In general, listen to gosec. But it this case, I don't think someone
115121 // is going to overflow the uint TTL for the cache lifetime.
116122 // nolint:gosec
You can’t perform that action at this time.
0 commit comments