Skip to content

Commit

Permalink
Merge pull request #5 from wakeful/feature/add-env-config
Browse files Browse the repository at this point in the history
fix #1 add / replace "flag" pkg to support env config,
  • Loading branch information
wakeful authored Apr 30, 2018
2 parents f3215f7 + e7f281e commit b237874
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ Usage of ./pve_exporter:
-version
show version and exit
```
### Configuration

| Type | Flag | Environment |
| ------ | :------------------------------ | :----------------------------- |
| string | -listen-address :9090 | LISTEN_ADDRESS=:9090 |
| string | -telemetry-path /metrics | TELEMETRY_PATH=/metrics |
| string | -pve-url https://127.0.0.1:8006 | PVE_URL=https://127.0.0.1:8006 |
| int | -timeout 5 | TIMEOUT=5 |
| string | -user root | USER=root |
| string | -password 1234 | PASSWORD=1234 |
| string | -realm pam | REALM=pam |

## Metrics

Expand Down
2 changes: 1 addition & 1 deletion pve_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"bytes"
"crypto/tls"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
"time"

"github.com/namsral/flag"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
Expand Down

0 comments on commit b237874

Please sign in to comment.