Skip to content

Commit 7fcb4d2

Browse files
authored
introduce var CLUSTERCHECK_BW (#2)
1 parent d6cf662 commit 7fcb4d2

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ export PROM_PASS=xxxx
3636

3737
## Bitwarden feature
3838

39-
Start the programm with `-bw`.
39+
Start the programm with `-bw` or set env var
40+
41+
```
42+
export CLUSTERCHECK_BW=1
43+
```
4044

4145
In this version the programm expect an item on a Bitwarden service containing username/password for HTTP Basic Auth on
4246
Prometheus API

main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,9 @@ func main() {
231231

232232
username := os.Getenv("PROM_USER")
233233
password := os.Getenv("PROM_PASS")
234+
clcBW := os.Getenv("CLUSTERCHECK_BW")
234235

235-
if *bitwarden == true {
236+
if *bitwarden == true || clcBW != ""{
236237
// doing bitwarden stuff here to get prometheus credentials
237238
itemName := "Prometheus Agent RemoteWrite"
238239
jsonData, err := getBitwardenItemJSON(itemName)
@@ -298,7 +299,7 @@ func main() {
298299

299300
icon.TextSize = 32
300301
text := canvas.NewText(statusText, color.White)
301-
text.TextSize = 24
302+
text.TextSize = 18
302303
text.Alignment = fyne.TextAlignLeading
303304

304305
metricLines = append(metricLines, container.NewHBox(icon, text))

0 commit comments

Comments
 (0)