mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\Config;
|
||||
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
@@ -14,8 +16,8 @@
|
||||
|
||||
function prometheus_push($device, $measurement, $tags, $fields)
|
||||
{
|
||||
global $prometheus, $config;
|
||||
if ($config['prometheus']['enable'] === true) {
|
||||
global $prometheus;
|
||||
if (Config::get('prometheus.enable') === true) {
|
||||
if ($prometheus !== false) {
|
||||
try {
|
||||
$ch = curl_init();
|
||||
@@ -36,7 +38,7 @@ function prometheus_push($device, $measurement, $tags, $fields)
|
||||
}
|
||||
}
|
||||
|
||||
$promurl = $config['prometheus']['url'].'/metrics/job/'.$config['prometheus']['job'].'/instance/'.$device['hostname'].$promtags;
|
||||
$promurl = Config::get('prometheus.url') . '/metrics/job/' . Config::get('prometheus.job') . '/instance/' . $device['hostname'] . $promtags;
|
||||
$promurl = str_replace(" ", "-", $promurl); // Prometheus doesn't handle tags with spaces in url
|
||||
|
||||
d_echo("\nPrometheus data:\n");
|
||||
|
Reference in New Issue
Block a user