mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add support for Prometheus pushgateway basic auth (#16230)
Co-authored-by: Joe Clarke <jclarke@cisco.com>
This commit is contained in:
@@ -51,6 +51,12 @@ class Prometheus extends BaseDatastore
|
||||
|
||||
$this->client = Http::client()->baseUrl($this->base_uri);
|
||||
|
||||
$user = Config::get('prometheus.user', '');
|
||||
$passwd = Config::get('prometheus.password', '');
|
||||
if ($user && $passwd) {
|
||||
$this->client = $this->client->withBasicAuth($user, $passwd);
|
||||
}
|
||||
|
||||
$this->prefix = Config::get('prometheus.prefix', '');
|
||||
if ($this->prefix) {
|
||||
$this->prefix = "$this->prefix" . '_';
|
||||
|
Reference in New Issue
Block a user