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;
|
||||
|
||||
$src = device_by_id_cache($_GET['src']);
|
||||
|
||||
// This is my translation of Smokeping's graphing.
|
||||
@@ -11,7 +13,7 @@ require 'includes/html/graphs/common.inc.php';
|
||||
require 'includes/html/graphs/device/smokeping_common.inc.php';
|
||||
|
||||
$i = 0;
|
||||
$pings = $config['smokeping']['pings'];
|
||||
$pings = Config::get('smokeping.pings');
|
||||
$iter = 0;
|
||||
$colourset = 'mixed';
|
||||
|
||||
@@ -28,7 +30,7 @@ if ($width > '500') {
|
||||
}
|
||||
|
||||
$filename_dir = generate_smokeping_file($device);
|
||||
if ($src['hostname'] == $config['own_hostname']) {
|
||||
if ($src['hostname'] == Config::get('own_hostname')) {
|
||||
$filename = $filename_dir . $device['hostname'].'.rrd';
|
||||
if (!rrdtool_check_rrd_exists($filename_dir.$device['hostname'].'.rrd')) {
|
||||
// Try with dots in hostname replaced by underscores
|
||||
@@ -42,11 +44,11 @@ if ($src['hostname'] == $config['own_hostname']) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($config['graph_colours'][$colourset][$iter])) {
|
||||
if (!Config::has("graph_colours.$colourset.$iter")) {
|
||||
$iter = 0;
|
||||
}
|
||||
|
||||
$colour = $config['graph_colours'][$colourset][$iter];
|
||||
$colour = Config::get("graph_colours.$colourset.$iter");
|
||||
$iter++;
|
||||
|
||||
$descr = rrdtool_escape($source, $descr_len);
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\Config;
|
||||
|
||||
$dest = device_by_id_cache($_GET['dest']);
|
||||
|
||||
// This is my translation of Smokeping's graphing.
|
||||
@@ -11,7 +13,7 @@ require 'includes/html/graphs/common.inc.php';
|
||||
require 'includes/html/graphs/device/smokeping_common.inc.php';
|
||||
|
||||
$i = 0;
|
||||
$pings = $config['smokeping']['pings'];
|
||||
$pings = Config::get('smokeping.pings');
|
||||
$iter = 0;
|
||||
$colourset = 'mixed';
|
||||
|
||||
@@ -27,25 +29,26 @@ if ($width > '500') {
|
||||
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, ($descr_len + 5)), 0, ($descr_len + 5))." RTT Loss SDev RTT\:SDev \l'";
|
||||
}
|
||||
|
||||
if ($device['hostname'] == $config['own_hostname']) {
|
||||
$filename = $config['smokeping']['dir'].$dest['hostname'].'.rrd';
|
||||
if ($device['hostname'] == Config::get('own_hostname')) {
|
||||
$filename = Config::get('smokeping.dir') . $dest['hostname'] . '.rrd';
|
||||
if (!rrdtool_check_rrd_exists($filename)) {
|
||||
// Try with dots in hostname replaced by underscores
|
||||
$filename = $config['smokeping']['dir'].str_replace('.', '_', $dest['hostname']).'.rrd';
|
||||
$filename = Config::get('smokeping.dir') . str_replace('.', '_', $dest['hostname']) . '.rrd';
|
||||
}
|
||||
} else {
|
||||
$filename = $config['smokeping']['dir'].$dest['hostname'].'~'.$device['hostname'].'.rrd';
|
||||
$filename = Config::get('smokeping.dir') . $dest['hostname'] . '~' . $device['hostname'] . '.rrd';
|
||||
if (!rrdtool_check_rrd_exists($filename)) {
|
||||
// Try with dots in hostname replaced by underscores
|
||||
$filename = $config['smokeping']['dir'].str_replace('.', '_', $dest['hostname']).'~'.$device['hostname'].'.rrd';
|
||||
$filename = Config::get('smokeping.dir') . str_replace('.', '_', $dest['hostname']) . '~' . $device['hostname'] . '.rrd';
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($config['graph_colours'][$colourset][$iter])) {
|
||||
|
||||
if (!Config::has("graph_colours.$colourset.$iter")) {
|
||||
$iter = 0;
|
||||
}
|
||||
|
||||
$colour = $config['graph_colours'][$colourset][$iter];
|
||||
$colour = Config::get("graph_colours.$colourset.$iter");
|
||||
$iter++;
|
||||
|
||||
$descr = rrdtool_escape($source, $descr_len);
|
||||
|
Reference in New Issue
Block a user