File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ public function __construct()
51
51
52
52
$ this ->client = Http::client ()->baseUrl ($ this ->base_uri );
53
53
54
+ $ user = Config::get ('prometheus.user ' , '' );
55
+ $ passwd = Config::get ('prometheus.password ' , '' );
56
+ if ($ user && $ passwd ) {
57
+ $ this ->client = $ this ->client ->withBasicAuth ($ user , $ passwd );
58
+ }
59
+
54
60
$ this ->prefix = Config::get ('prometheus.prefix ' , '' );
55
61
if ($ this ->prefix ) {
56
62
$ this ->prefix = "$ this ->prefix " . '_ ' ;
Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ continue to function as normal.
35
35
lnms config: set prometheus.prefix 'librenms'
36
36
```
37
37
38
+ If your pushgateway uses basic authentication, configure the following:
39
+
40
+ !!! setting "poller/prometheus"
41
+ ```bash
42
+ lnms config: set prometheus.user username
43
+ lnms config: set prometheus.password password
44
+ ```
45
+
38
46
## Prefix
39
47
40
48
Setting the 'prefix' option will cause all metric names to begin with
Original file line number Diff line number Diff line change 5524
5524
"section" : " prometheus" ,
5525
5525
"order" : 4
5526
5526
},
5527
+ "prometheus.user" : {
5528
+ "default" : " " ,
5529
+ "type" : " text" ,
5530
+ "group" : " poller" ,
5531
+ "section" : " prometheus" ,
5532
+ "order" : 5
5533
+ },
5534
+ "prometheus.password" : {
5535
+ "default" : " " ,
5536
+ "type" : " text" ,
5537
+ "group" : " poller" ,
5538
+ "section" : " prometheus" ,
5539
+ "order" : 6
5540
+ },
5527
5541
"public_status" : {
5528
5542
"default" : false ,
5529
5543
"group" : " auth" ,
You can’t perform that action at this time.
0 commit comments