Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ See the `-help` output for more options.
Path under which to expose metrics. (default "/metrics")
```

### Environment Variables

Some values can be set via environment variables:

| Name | Description |
| -------- | ----------- |
| ICINGA2_EXPORTER_HTTP_PASSWORD | Password to use for basic auth |

### Cache

The exporter caches the responses from the Icinga2 API to decrease load on the API.
Expand Down
6 changes: 6 additions & 0 deletions icinga2_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ func main() {
Level: logLevel,
}))

if cliPassword == "" {
if v, ok := os.LookupEnv("ICINGA2_EXPORTER_HTTP_PASSWORD"); ok {
cliPassword = v
}
}

// In general, listen to gosec. But it this case, I don't think someone
// is going to overflow the uint TTL for the cache lifetime.
// nolint:gosec
Expand Down