commit version 22.12.12447

This commit is contained in:
2023-01-01 22:36:12 -05:00
parent af1b03d79f
commit b948283a96
744 changed files with 620715 additions and 27381 deletions

View File

@ -1,5 +1,4 @@
<?php
/**
* Observium
*
@ -7,21 +6,22 @@
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
if (is_numeric($vars['id']))
{
if (is_numeric($vars['id'])) {
$data = dbFetchRow("SELECT * FROM `bgpPeers` WHERE `bgpPeer_id` = ?", array($vars['id']));
$data = dbFetchRow("SELECT * FROM `bgpPeers` WHERE `bgpPeer_id` = ?", [ $vars['id'] ]);
if (is_numeric($data['device_id']) && ($auth || device_permitted($data['device_id'])))
{
if (is_numeric($data['device_id']) && ($auth || device_permitted($data['device_id']))) {
$device = device_by_id_cache($data['device_id']);
$graph_title = $device['hostname'];
$graph_title .= " :: AS" . ($config['web_show_bgp_asdot'] ? bgp_asplain_to_asdot($data['bgpPeerRemoteAs']) : $data['bgpPeerRemoteAs']);
if (!safe_empty($data['astext'])) {
$graph_title .= ' (' . truncate($data['astext']) . ')';
}
$auth = TRUE;
}
}

View File

@ -51,18 +51,22 @@ if ($vars['inverse']) {
$inverse = FALSE;
}
if ($vars['legend'] === 'no') {
$rrd_options .= ' -g';
$legend = 'no';
}
if (get_var_true($vars['title']) && !safe_empty($graph_title)) {
$rrd_options .= " --title='" . rrdtool_escape($graph_title) . "' ";
// Note, do not escape title by rrdtool escape
//$rrd_options .= " --title='" . rrdtool_escape($graph_title) . "' ";
$rrd_options .= " --title=" . escapeshellarg($graph_title) . " ";
}
if (isset($vars['graph_title'])) {
$rrd_options .= " --title='" . rrdtool_escape($vars['graph_title']) . "' ";
// Note, do not escape title by rrdtool escape
//$rrd_options .= " --title='" . rrdtool_escape($vars['graph_title']) . "' ";
$rrd_options .= " --title=" . escapeshellarg($vars['graph_title']) . " ";
}
// Vertical label
if (!safe_empty($graph_label)) {
// Note, do not escape title by rrdtool escape
$rrd_options .= " --vertical-label=" . escapeshellarg($graph_label) . " ";
}
if (isset($log_y)) {
@ -90,7 +94,9 @@ if (isset($vars['style']) && $vars['style']) {
}
// Autoscale
if (!isset($scale_min) && !isset($scale_max)) {
if(isset($vars['force_autoscale']) && in_array($vars['force_autoscale'], ['yes', 'true', 1])) {
$rrd_options .= ' -A';
} elseif (!isset($scale_min) && !isset($scale_max)) {
if ($graph_style === 'mrtg' && !isset($log_y)) { // Don't use this if we're doing logarithmic scale, else it breaks.
$rrd_options .= ' --alt-autoscale-max';
} else {
@ -137,19 +143,14 @@ if (!$config['graphs']['always_draw_max']) {
}
}
$rrd_options .= ' --start ' . rrdtool_escape($from) .
' --end ' . rrdtool_escape($to) .
' --width ' . rrdtool_escape($width) .
' --height ' . rrdtool_escape($height) . ' ';
// Parse pango markup. Breaks chevrons and other stuff.
//$rrd_options .= ' -P ';
if ($config['themes'][$_SESSION['theme']]['type'] === 'dark') {
$rrd_options .= str_replace(" ", " ", $config['rrdgraph']['dark']);
$rrd_options .= ' ' .str_replace(" ", " ", $config['rrdgraph']['dark']);
$nan_colour = "#FF000020";
} else {
$rrd_options .= str_replace(" ", " ", $config['rrdgraph']['light']);
$rrd_options .= ' '. str_replace(" ", " ", $config['rrdgraph']['light']);
$nan_colour = "#FFAAAA20";
}
@ -169,8 +170,11 @@ if ($width <= '350') {
$rrd_options .= " --font LEGEND:8:'" . $config['mono_font'] . "' --font AXIS:7:'" . $config['mono_font'] . "'";
}
//$rrd_options .= ' --font-render-mode normal --dynamic-labels'; // dynamic-labels not supported in rrdtool < 1.4
$rrd_options .= ' --font-render-mode normal';
if ($config['graphs']['dynamic_labels']) {
// dynamic-labels not supported in rrdtool < 1.4
$rrd_options .= ' --dynamic-labels';
}
if ($step != TRUE) {
$rrd_options .= ' -E';

View File

@ -20,7 +20,7 @@ foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_des
$rrd_list[] = [ 'filename' => $rrd_filename,
'descr' => $port['hostname'] ."-". $port['ifDescr'],
'descr_in' => device_name($port, TRUE),
'descr_out' => short_ifname($port['ifDescr'], NULL, FALSE) ]; // Options sets for skip htmlentities
'descr_out' => short_ifname($port['port_label'], NULL, FALSE) ]; // Options sets for skip htmlentities
}
}

View File

@ -15,7 +15,7 @@
$ds_in = "INOCTETS";
$ds_out = "OUTOCTETS";
$graph_return = array('descr' => 'Device total traffic in bits/sec.');
$graph_return['descr'] = 'Device total traffic in bits/sec.';
// init
$i = 0;

View File

@ -1,5 +1,4 @@
<?php
/**
* Observium
*
@ -7,14 +6,14 @@
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
$sql = "SELECT * FROM `processors` WHERE `processor_type` != 'hr-average' AND `device_id` = ?";
if (isset($vars['filter_id']))
{
$sql .= generate_query_values($vars['filter_id'], 'processor_id');
$sql .= generate_query_values_and($vars['filter_id'], 'processor_id');
}
$procs = dbFetchRows($sql, array($device['device_id']));

View File

@ -1,5 +1,4 @@
<?php
/**
* Observium
*
@ -164,8 +163,6 @@ $rrd_options .= $rrd_options_lc;
$rrd_options .= $rrd_options_bg;
$rrd_options .= " COMMENT:'\l'"; # matt.ayre: annotation showing smokeping parameters
$rrd_options .= " COMMENT:'probes\:\t$pings ICMP Echo Pings ($description) every ${interval}s\l'";
$rrd_options .= " COMMENT:'probes\:\t$pings ICMP Echo Pings ($description) every {$interval}s\l'";
?>
// EOF

View File

@ -15,18 +15,22 @@ $scale_max = "100";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
if($width > 500)
if($width > 350)
{
$descr_len = 22;
$padding = 45;
$text_width = 7;
} else {
$descr_len = 12;
$padding = 39;
$text_width = 6;
}
$descr_len += round(($width - 250) / 8);
$legend_len = ($vars['width'] + $padding) / $text_width;
$descr_len = $legend_len - 31;
$iter = 0;
$colours = 'mixed-10c';
$rrd_options .= " COMMENT:'".str_pad('Size Used %used', $descr_len+31, ' ', STR_PAD_LEFT)."\\l'";
//$rrd_options .= " COMMENT:' Size Used %age\\l'";
$rrd_options .= " COMMENT:'".str_pad('Size Used % Used', $legend_len, ' ', STR_PAD_LEFT)."\\l'";
$graph_return['legend_lines'] = 1;
foreach (dbFetchRows("SELECT * FROM storage where device_id = ?", array($device['device_id'])) as $storage)
{
@ -47,7 +51,14 @@ foreach (dbFetchRows("SELECT * FROM storage where device_id = ?", array($device[
$rrd_options .= " GPRINT:".$storage['storage_id']."used:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:".$storage['storage_id']."perc:LAST:%5.2lf%%\\l";
$iter++;
$graph_return['legend_lines']++;
$graph_return['rrds'][] = $rrd;
} else {
$graph_return['missing_rrds'][] = $rrd;
}
}
// EOF

View File

@ -1,5 +1,4 @@
<?php
/**
* Observium
*
@ -7,7 +6,7 @@
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
@ -17,12 +16,13 @@
include($config['html_dir']."/includes/graphs/common.inc.php");
$graph_return['valid_options'][] = "previous";
//$graph_return['valid_options'][] = "total";
$graph_return['valid_options'][] = "95th";
$graph_return['valid_options'][] = "trend";
$graph_return['valid_options'][] = "inverse";
switch ($format)
{
$do_95th = !(isset($vars['95th']) && get_var_false($vars['95th']));
switch ($format) {
case 'octets':
case 'bytes':
//$units = "Bps";
@ -58,14 +58,12 @@ if ($format == "octets" || $format == "bytes")
$i = 0;
$unit_text = rrdtool_escape($unit_text, 9);
if (!$noheader)
{
$rrd_options .= " COMMENT:'$unit_text Last Avg Max 95th \\n'";
if (!$noheader) {
$rrd_options .= " COMMENT:'$unit_text Last Avg Max" . ($do_95th ? " 95th" : "") . " \\n'";
}
// Alternative style
if ($graph_style == 'mrtg')
{
if ($graph_style == 'mrtg') {
$out_scale = 1;
} else {
$out_scale = -1;
@ -200,7 +198,8 @@ $rrd_options .= ":'In '";
$rrd_options .= " GPRINT:in".$format.":LAST:%6.2lf%s";
$rrd_options .= " GPRINT:in".$format.":AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:in".$format."_max:MAX:%6.2lf%s";
$rrd_options .= " GPRINT:95thin:%6.2lf%s\\n";
if ($do_95th) { $rrd_options .= " GPRINT:95thin:%6.2lf%s"; }
$rrd_options .= " COMMENT:\\n";
if ($graph_max)
{
@ -222,27 +221,32 @@ $rrd_options .= " LINE1.25:dout".$format."#".$config['colours']['graphs']['data'
$rrd_options .= " GPRINT:out".$format.":LAST:%6.2lf%s";
$rrd_options .= " GPRINT:out".$format.":AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:out".$format."_max:MAX:%6.2lf%s";
$rrd_options .= " GPRINT:95thout:%6.2lf%s\\n";
if ($do_95th) { $rrd_options .= " GPRINT:95thout:%6.2lf%s"; }
$rrd_options .= " COMMENT:\\n";
if ($config['rrdgraph_real_95th'])
{
$rrd_options .= " HRULE:95thhigh#FF0000:'Highest'";
$rrd_options .= " GPRINT:95thhigh:%30.2lf%s\\n";
} else {
//$rrd_options .= " LINE1:95thin#aa0000";
//$rrd_options .= " LINE1:d95thout#bb0000";
$rrd_options .= " HRULE:95thin#aa0000";
$rrd_options .= " HRULE:d95thout#aa0000";
if ($do_95th) {
if ($config['rrdgraph_real_95th']) {
$rrd_options .= " HRULE:95thhigh#FF0000:'Highest'";
$rrd_options .= " GPRINT:95thhigh:%30.2lf%s\\n";
} else {
$rrd_options .= " HRULE:95thin#aa0000";
$rrd_options .= " HRULE:d95thout#aa0000";
}
}
$rrd_options .= " GPRINT:tot:'Total %6.2lf%s'";
$rrd_options .= " GPRINT:totin:'(In %6.2lf%s'";
$rrd_options .= " GPRINT:totout:'Out %6.2lf%s)\\l'";
$graph_return['legend_lines'] = 4;
if ($vars['previous'] == "yes")
{
$rrd_options .= " LINE1.25:in".$format."X#009900:'Prev In \\n'";
$rrd_options .= " LINE1.25:dout".$format."X#000099:'Prev Out'";
$graph_return['legend_lines'] += 2;
} else {
$rrd_options .= " AREA:wrongin".$nan_colour;
$rrd_options .= " AREA:wrongout".$nan_colour;
@ -267,7 +271,7 @@ if ($vars['trend'])
// $midnight = strtotime('today midnight');
// for ($i = 1; $i <= 2; $i++)
// {
// $rrd_options .= " VRULE:${midnight}#FF0000";
// $rrd_options .= " VRULE:{$midnight}#FF0000";
// $midnight -= 86400;
// }
//}

View File

@ -12,6 +12,12 @@
$graph_def = $config['graph_types'][$type][$subtype];
$graph_return['legend_lines'] = 0;
if(isset($graph_def['descr'])) {
$graph_return['descr'] = $graph_def['descr'];
}
// Set some defaults and convert $graph_def values to global values for use by common.inc.php.
// common.inc.php needs converted to use $graph_def so we can remove this.
@ -149,6 +155,8 @@ foreach ($graph_def['ds'] as $ds_name => $ds)
$cmd_def .= " CDEF:".$ds_name."_max=".$ds_name;
}
//$graph_return['rrds'][$ds['file']][] = $ds_name;
if (!empty($ds['cdef']))
{
$ds_name = $ds_name."_c";
@ -217,6 +225,7 @@ foreach ($graph_def['ds'] as $ds_name => $ds)
}
}
$cmd_graph .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
if ($ds['line']) {
if (is_numeric($ds['line'])) {

View File

@ -184,7 +184,7 @@ $rrd_options .= " HRULE:0#999999";
// $midnight = strtotime('today midnight');
// for ($i = 1; $i <= 2; $i++)
// {
// $rrd_options .= " VRULE:${midnight}#FF0000";
// $rrd_options .= " VRULE:{$midnight}#FF0000";
// $midnight -= 86400;
// }
//}

View File

@ -117,7 +117,7 @@ if ($i)
if ($vars['previous'] == "yes")
{
$rrd_options .= " AREA:inbitsX#9999966:";
$rrd_options .= " AREA:inbitsX#99999966:";
$rrd_options .= " AREA:doutbitsX#99999966:";
}

View File

@ -16,6 +16,8 @@ $graph_return['valid_options'][] = "previous";
$graph_return['valid_options'][] = "total";
$graph_return['valid_options'][] = "trend";
$graph_return['legend_lines'] = 0;
// Here we scale the number of numerical columns shown to make sure we keep the text.
if ($width > 600) {
@ -74,6 +76,9 @@ if ($legend != 'no')
if (in_array("max", $data_show)) { $rrd_options .= " COMMENT:' Max'"; }
if (in_array("tot", $data_show)) { $rrd_options .= " COMMENT:' Total'"; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
}
$i = 0;
@ -150,18 +155,20 @@ foreach ($rrd_list as $rrd)
if (in_array("min", $data_show)) { $rrd_options .= " GPRINT:inbits".$i.":MIN:%6.2lf%s"; }
if (in_array("max", $data_show)) { $rrd_options .= " GPRINT:inbits".$i.":MAX:%6.2lf%s"; }
if (in_array("tot", $data_show)) { $rrd_options .= " GPRINT:totinB".$i.":%6.2lf%s".$total_units; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
$rrd_optionsb .= " AREA:outbits".$i."_neg#" . $colour_out . ":".$stack;
$rrd_options .= " HRULE:999999999999999#" . $colour_out . ":'" . rrdtool_escape($rrd['descr_out'], $descr_len - 3) . " Tx'";
if (in_array("lst", $data_show)) { $rrd_options .= " GPRINT:outbits".$i.":LAST:%6.2lf%s"; }
if (in_array("avg", $data_show)) { $rrd_options .= " GPRINT:outbits".$i.":AVERAGE:%6.2lf%s"; }
if (in_array("min", $data_show)) { $rrd_options .= " GPRINT:outbits".$i.":MIN:%6.2lf%s"; }
if (in_array("max", $data_show)) { $rrd_options .= " GPRINT:outbits".$i.":MAX:%6.2lf%s"; }
if (in_array("tot", $data_show)) { $rrd_options .= " GPRINT:totoutB".$i.":%6.2lf%s".$total_units; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
$i++; $iter++;
}
@ -208,6 +215,7 @@ if (in_array("tot", $data_show))
$rrd_options .= " VDEF:tot=octets,TOTAL";
$rrd_options .= " COMMENT:' \\l'";
$graph_return['legend_lines']++;
$rrd_options .= " HRULE:999999999999999#FFFFFF:'" . rrdtool_escape("Total", $descr_len - 3) . " Rx'";
if (in_array("lst", $data_show)) { $rrd_options .= " GPRINT:inbits:LAST:%6.2lf%s"; }
@ -216,6 +224,7 @@ if (in_array("tot", $data_show))
if (in_array("max", $data_show)) { $rrd_options .= " GPRINT:inbits:MAX:%6.2lf%s"; }
if (in_array("tot", $data_show)) { $rrd_options .= " GPRINT:totin:%6.2lf%s".$total_units; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
$rrd_options .= " HRULE:999999999999999#FFFFFF:'" . rrdtool_escape("", $descr_len - 3) . " Tx'";
if (in_array("lst", $data_show)) { $rrd_options .= " GPRINT:outbits:LAST:%6.2lf%s"; }
@ -224,6 +233,7 @@ if (in_array("tot", $data_show))
if (in_array("max", $data_show)) { $rrd_options .= " GPRINT:outbits:MAX:%6.2lf%s"; }
if (in_array("tot", $data_show)) { $rrd_options .= " GPRINT:totout:%6.2lf%s".$total_units; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
$rrd_options .= " HRULE:999999999999999#FFFFFF:'" . rrdtool_escape("", $descr_len - 4) . " Agg'";
if (in_array("lst", $data_show)) { $rrd_options .= " GPRINT:bits:LAST:%6.2lf%s"; }
@ -232,6 +242,7 @@ if (in_array("tot", $data_show))
if (in_array("max", $data_show)) { $rrd_options .= " GPRINT:bits:MAX:%6.2lf%s"; }
if (in_array("tot", $data_show)) { $rrd_options .= " GPRINT:tot:%6.2lf%s".$total_units; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
if ($vars['trend'])
{
@ -251,6 +262,7 @@ if (in_array("tot", $data_show) && $vars['previous'] == "yes")
$rrd_options .= " VDEF:totoutX=outBX,TOTAL";
$rrd_options .= " VDEF:totX=octetsX,TOTAL";
$rrd_options .= " COMMENT:' \\l'";
$graph_return['legend_lines']++;
$rrd_options .= " HRULE:999999999999999#AAAAAA:'" . rrdtool_escape("Prev Total", $descr_len - 3) . " Rx'";
if (in_array("lst", $data_show)) { $rrd_options .= " GPRINT:inbitsX:LAST:%6.2lf%s"; }
@ -259,6 +271,7 @@ if (in_array("tot", $data_show) && $vars['previous'] == "yes")
if (in_array("max", $data_show)) { $rrd_options .= " GPRINT:inbitsX:MAX:%6.2lf%s"; }
if (in_array("tot", $data_show)) { $rrd_options .= " GPRINT:totinX:%6.2lf%s".$total_units; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
$rrd_options .= " HRULE:999999999999999#AAAAAA:'" . rrdtool_escape("", $descr_len - 3) . " Tx'";
if (in_array("lst", $data_show)) { $rrd_options .= " GPRINT:outbitsX:LAST:%6.2lf%s"; }
@ -267,6 +280,7 @@ if (in_array("tot", $data_show) && $vars['previous'] == "yes")
if (in_array("max", $data_show)) { $rrd_options .= " GPRINT:outbitsX:MAX:%6.2lf%s"; }
if (in_array("tot", $data_show)) { $rrd_options .= " GPRINT:totoutX:%6.2lf%s".$total_units; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
$rrd_options .= " HRULE:999999999999999#AAAAAA:'" . rrdtool_escape("", $descr_len - 4) . " Agg'";
if (in_array("lst", $data_show)) { $rrd_options .= " GPRINT:bitsX:LAST:%6.2lf%s"; }
@ -275,6 +289,7 @@ if (in_array("tot", $data_show) && $vars['previous'] == "yes")
if (in_array("max", $data_show)) { $rrd_options .= " GPRINT:bitsX:MAX:%6.2lf%s"; }
if (in_array("tot", $data_show)) { $rrd_options .= " GPRINT:totX:%6.2lf%s".$total_units; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
}

View File

@ -25,14 +25,15 @@ $graph_return['valid_options'][] = "trend";
include($config['html_dir']."/includes/graphs/common.inc.php");
$unit_text = str_pad(truncate($unit_text,18,''),18);
$line_text = str_pad(truncate($line_text,12,''),12);
// Fix length before escaping for layout purposes
$unit_text = rrdtool_escape(str_pad(truncate($unit_text,17,''),17));
$line_text = rrdtool_escape(str_pad(truncate($line_text,11,''),11));
if (isset($unit_integer) && $unit_integer)
{
$ds_format = '"%6.0lf "'; //NOTE. max value 999999
$ds_format = '"%6.0lf"'; //NOTE. max value 999999
} else {
$ds_format = '"%6.2lf%s"';
$ds_format = '"%5.1lf%s"';
}
if ($multiplier)
@ -98,13 +99,13 @@ if ($vars['previous'] == "yes")
if ($graph_max) {
$rrd_options .= " CDEF:" . $ds . "_minmax=" . $ds . "_max," . $ds . "_min,-";
$rrd_options .= " AREA:" . $ds . "_min#ffffff00";
$rrd_options .= " AREA:" . $ds . "_minmax#" . $colour_line . "60:STACK";
$rrd_options .= " AREA:" . $ds . "_minmax#" . $colour_line . "30:STACK";
} else {
$rrd_options .= " AREA:".$ds."#".$colour_area.":";
}
//}
$rrd_options .= " COMMENT:'".$unit_text."Now Avg Max ";
$rrd_options .= " COMMENT:'".$unit_text."Now Avg Min Max";
if ($percentile)
{
@ -119,7 +120,7 @@ $rrd_options .= " GPRINT:".$ds.":AVERAGE:".$ds_format;
// if ($print_min || TRUE)
// {
// $rrd_options .= " GPRINT:".$ds."_min:MIN:%6.2lf%s";
$rrd_options .= " GPRINT:".$ds."_min:MIN:".$ds_format;
// }
$rrd_options .= " GPRINT:".$ds."_max:MAX:".$ds_format;

View File

@ -6,7 +6,7 @@
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
@ -43,7 +43,7 @@ if (isset($vars['format']) && array_key_exists($vars['format'], $config['graph_f
$graphfile = $config['temp_dir'] . "/" . strgen() . "." . $extension;
if (OBS_DEBUG) { print_vars($graphtype); }
if (OBS_DEBUG) { print_vars($vars); print_vars($graphtype); }
if (isset($graphtype['type']) && isset($graphtype['subtype'])) {
$type = $graphtype['type'];
@ -76,22 +76,26 @@ if (preg_match(OBS_PATTERN_RRDTIME, $vars['to'])) { $to = $vars['to']; }//
if (preg_match(OBS_PATTERN_RRDTIME, $vars['from'])) { $from = $vars['from']; }// else { $from = $config['time']['day']; }
if (isset($vars['period']) && is_numeric($vars['period'])) {
$to = time();
$from = time() - $vars['period'];
$to = get_time();
$from = get_time() - $vars['period'];
$period = $vars['period'];
} elseif(preg_match('/[\-]*\d+[s|w|m|d|y|h]/', $vars['from'])) {
} elseif (preg_match('/[\-]*\d+[s|w|m|d|y|h]/', $vars['from'])) {
// It seems we have AT-style/timespec. Just pass it through (some features will break because we can't calculate period)
$from = $vars['from'];
if(preg_match('/[\-]*\d+[s|w|m|d|y|h]/', $vars['to'])) { $to = $vars['to']; } else { $to = 'NOW'; }
if (preg_match('/[\-]*\d+[s|w|m|d|y|h]/', $vars['to'])) {
$to = $vars['to'];
} else {
$to = 'now';
}
} else {
$from = (isset($vars['from'])) ? $vars['from'] : time() - 86400;
$to = (isset($vars['to'])) ? $vars['to'] : time();
$from = (isset($vars['from']) && is_numeric($vars['from'])) ? $vars['from'] : get_time() - 86400;
$to = (isset($vars['to']) && is_numeric($vars['to'])) ? $vars['to'] : time();
if ($from < 0) { $from = $to + $from; }
$period = $to - $from;
}
// Set prev_from & prev_to if we have a period
if(isset($period)) {
if (isset($period)) {
$prev_from = $from - $period;
$prev_to = $from;
}
@ -100,41 +104,62 @@ $graph_include = FALSE;
$definition_include = FALSE;
//print_message("Graph type: $type, subtype: $subtype");
if (is_file($config['html_dir'] . "/includes/graphs/$type/$subtype.inc.php"))
{
if (is_file($config['html_dir'] . "/includes/graphs/$type/$subtype.inc.php")) {
$graph_include = $config['html_dir'] . "/includes/graphs/$type/$subtype.inc.php";
}
elseif (is_array($config['graph_types'][$type][$subtype]['ds']))
{
} elseif (is_array($config['graph_types'][$type][$subtype]['ds'])) {
// Init tags array
$tags = [];
// Additional include with define some graph variables like $unit_text, $graph_title
// Currently only for indexed definitions
if ($config['graph_types'][$type][$subtype]['index'] &&
is_file($config['html_dir'] . "/includes/graphs/$type/definition.inc.php"))
{
is_file($config['html_dir'] . "/includes/graphs/$type/definition.inc.php")) {
$definition_include = $config['html_dir'] . "/includes/graphs/$type/definition.inc.php";
}
$graph_include = $config['html_dir'] . "/includes/graphs/generic_definition.inc.php";
}
elseif (is_file($config['html_dir'] . "/includes/graphs/$type/graph.inc.php"))
{
} elseif (is_file($config['html_dir'] . "/includes/graphs/$type/graph.inc.php")) {
$graph_include = $config['html_dir'] . "/includes/graphs/$type/graph.inc.php";
}
if ($graph_include)
{
if ($graph_include) {
include($config['html_dir'] . "/includes/graphs/$type/auth.inc.php");
if (isset($auth) && $auth)
{
if ($definition_include)
{
if (isset($auth) && $auth) {
if ($definition_include) {
include_once($definition_include);
}
include($graph_include);
// Requested a rigid height graph, probably for the dashboard.
// If we don't know the legend height, turn off legend.
// If we know the height and it won't fit, turn it off.
if ( !(isset($vars['legend']) && $vars['legend'] == 'no') &&
(isset($vars['rigid_height']) && $vars['rigid_height'] == 'yes') ) {
$line_height = ($width > 350 ? 14 : 12); // Set line height based on font size chosen by width
if (!isset($graph_return['legend_lines'])) { // Don't know legend length
print_debug('no legend height');
$vars['legend'] = 'no';
}
else if (($graph_return['legend_lines'] * $line_height) > ($height - 100)) { // Legend too long
print_debug('legend too tall: ' . $graph_return['legend_lines'] * $line_height);
$vars['legend'] = 'no';
}
else { // Legend fits
$height = $height - ($graph_return['legend_lines'] * $line_height);
}
}
$rrd_options .= ' --start ' . rrdtool_escape($from) .
' --end ' . rrdtool_escape($to) .
' --width ' . rrdtool_escape($width) .
' --height ' . rrdtool_escape($height) . ' ';
if ($vars['legend'] === 'no') {
$rrd_options .= ' -g';
$legend = 'no';
}
}
} elseif(!isset($vars['command_only'])) {
graph_error('no '. $type.'_'.$subtype.''); // Graph Template Missing

View File

@ -65,6 +65,9 @@ if ($legend != 'no')
if (in_array("max", $data_show)) { $rrd_options .= " COMMENT:' Max'"; }
if (in_array("tot", $data_show)) { $rrd_options .= " COMMENT:' Total'"; }
$rrd_options .= " COMMENT:'\\l'";
$graph_return['legend_lines']++;
}
// EOF

View File

@ -0,0 +1,61 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
// FIXME - expand $vars['data']['groups'] for auth. For now only allow for >5
// FIXME - do special handling of descriptions if all oid are identical or all devices are identical
// remove device/oid from descr if all identical
// arrange device/oid into aligned columns if the graph is wide enough
if (!is_array($vars['id'])) { $vars['id'] = array($vars['id']); }
$is_permitted = FALSE;
$oids = [];
$rrd_list = [];
foreach ($vars['id'] as $oid_entry_id) {
$sql = "SELECT *";
$sql .= " FROM `oids_entries`";
$sql .= " LEFT JOIN `oids` USING(`oid_id`)";
$sql .= " LEFT JOIN `devices` USING(`device_id`)";
$sql .= " WHERE `oid_entry_id` = ?";
$oid = dbFetchRow($sql, array($oid_entry_id));
if (is_numeric($oid['device_id']) && ($auth || device_permitted($oid['device_id']))) {
$oids[] = $oid;
$is_permitted = TRUE;
$rrd_file = get_rrd_path($oid, "oid-" . $oid['oid'] . "-" . $oid['oid_type'] . ".rrd");
if (rrd_is_file($rrd_file, TRUE)) {
$rrd_list[] = [ 'filename' => $rrd_file,
'descr' => $oid['hostname'] . ' ' . $oid['oid_name'],
'ds' => 'value'];
}
} else {
// Bail on first rejection
$is_permitted = FALSE;
}
}
if ($auth || $is_permitted || $_SESSION['userlevel'] >= 5) {
$title_array = array();
$title_array[] = array('text' => 'Multiple OIDs');
$title_array[] = array('text' => safe_count($vars['id']) . ' Entries');
$auth = TRUE;
}
unset($is_permitted);
// EOF

View File

@ -0,0 +1,25 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
$units = '';
$unit_text = $oid['oid_unit'];
$total_units = '';
if ($oid['oid_logy'] == 1) { $log_y = TRUE; }
if ($oid['oid_kibi'] == 1) { $kibi = 1; }
$colours='mixed';
//$scale_min = "0";
$nototal = 1;
include($config['html_dir']."/includes/graphs/generic_multi_line.inc.php");

View File

@ -0,0 +1,24 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
$units = '';
$unit_text = ''; // Multiple OIDs can have different units.
$total_units = '';
$i = 1;
$scale_min = "0";
$colours='mixed-q12';
$nototal = 1;
$show_aggregate = TRUE;
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");

View File

@ -62,6 +62,12 @@ if (is_numeric($vars['id']) && ($auth || port_permitted($vars['id'])))
$title_array[] = array('text' => escape_html($port['port_label']) . (strlen($port['ifAlias']) ? " (".escape_html($port['ifAlias']).")" : ''), 'url' => generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'port', 'port' => $port['port_id'])));
$graph_title = device_name($device, TRUE) . " :: " . $port['port_label_short'];
// check if the port has an alias available and add it to the title
if(!empty($port['ifAlias'])) {
$graph_title = $graph_title . " :: " . $port['ifAlias'];
}
$rrd_filename = get_port_rrdfilename($port, NULL, TRUE);
if ($vars['type'] == 'port_bits')

View File

@ -1,30 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor:LAST:%3.0lfCFM";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lfCFM\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Air flow sensor measured in CFM.';
// EOF

View File

@ -1,38 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " -A ";
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename_escape:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename_escape:sensor:MIN";
$rrd_options .= " AREA:sensor_max#c5c5c5";
$rrd_options .= " AREA:sensor_min#ffffffff";
#$rrd_options .= " AREA:sensor#FFFF99";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],22)."'";
$rrd_options .= " GPRINT:sensor:LAST:%6.2lfW";
$rrd_options .= " GPRINT:sensor:MAX:%6.2lfW\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Apparent power sensor measured in voltampere.';
// EOF

View File

@ -1,32 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "cc3300";
$colour_area = "FFBBBB";
$colour_minmax = "c5c5c5";
$graph_max = 1;
$unit_text = "ppm";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
//if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
//if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Concentration in ppm.';
// EOF

View File

@ -1,38 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " -A ";
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename_escape:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename_escape:sensor:MIN";
$rrd_options .= " AREA:sensor_max#c5c5c5";
$rrd_options .= " AREA:sensor_min#ffffffff";
#$rrd_options .= " AREA:sensor#FFFF99";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],22)."'";
$rrd_options .= " GPRINT:sensor:LAST:%6.2lf";
$rrd_options .= " GPRINT:sensor:MAX:%6.2lf\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Crest Factor';
// EOF

View File

@ -1,41 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor$current_id:MIN:%5.2lfA";
$rrd_options .= " GPRINT:sensor:LAST:%5.2lfA";
$rrd_options .= " GPRINT:sensor:MAX:%5.2lfA\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
if (get_var_true($vars['previous']))
{
$rrd_options .= " DEF:sensorX=$rrd_filename_escape:sensor:AVERAGE:start=".$prev_from.":end=".$from;
$rrd_options .= " LINE1.5:sensorX#0000cc:'Prev " . rrdtool_escape($sensor['sensor_descr'],18)."'";
$rrd_options .= " SHIFT:sensorX:$period";
$rrd_options .= " GPRINT:sensorX$current_id:MIN:%5.2lfA";
$rrd_options .= " GPRINT:sensorX:LAST:%5.2lfA";
$rrd_options .= " GPRINT:sensorX:MAX:%5.2lfA\\l";
}
$graph_return['descr'] = 'Current sensor measured in Amperes.';
$graph_return['valid_options'] = array('previous');
// EOF

View File

@ -1,47 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
*
*/
$scale_min = "0";
$scale_max = "60";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename_escape:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename_escape:sensor:MIN";
$rrd_options .= " CDEF:sensor_diff=sensor_max,sensor_min,-";
$rrd_options .= " AREA:sensor_min";
$rrd_options .= " AREA:sensor_diff#c5c5c5::STACK";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor_min:MIN:%4.1lfdB";
$rrd_options .= " GPRINT:sensor:LAST:%4.1lfdB";
$rrd_options .= " GPRINT:sensor_max:MAX:%4.1lfdB\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
#wtfbroken code.
if (get_var_true($vars['previous'])) {
$rrd_options .= " DEF:sensorX=$rrd_filename_escape:sensor:AVERAGE:start=".$prev_from.":end=".$from;
$rrd_options .= " LINE1.5:sensorX#0000cc:'Prev " . rrdtool_escape($sensor['sensor_descr'],18)."'";
$rrd_options .= " SHIFT:sensorX:$period";
$rrd_options .= " GPRINT:sensorX$current_id:MIN:%5.2lfA";
$rrd_options .= " GPRINT:sensorX:LAST:%5.2lfA";
$rrd_options .= " GPRINT:sensorX:MAX:%5.2lfA\\l";
}
$graph_return['descr'] = nicecase($sensor['sensor_class']).' sensor measured in db.';
// EOF

View File

@ -1,31 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor$current_id:MIN:%5.2lfdBm";
$rrd_options .= " GPRINT:sensor:LAST:%5.2lfdBm";
$rrd_options .= " GPRINT:sensor:MAX:%5.2lfdBm\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'dBm sensor.';
// EOF

View File

@ -1,48 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
*
*/
$scale_min = "0";
$scale_max = "60";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename_escape:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename_escape:sensor:MIN";
$rrd_options .= " CDEF:sensor_diff=sensor_max,sensor_min,-";
$rrd_options .= " AREA:sensor_min";
$rrd_options .= " AREA:sensor_diff#c5c5c5::STACK";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor_min:MIN:%4.1lfC";
$rrd_options .= " GPRINT:sensor:LAST:%4.1lfC";
$rrd_options .= " GPRINT:sensor_max:MAX:%4.1lfC\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
#wtfbroken code.
if (get_var_true($vars['previous']))
{
$rrd_options .= " DEF:sensorX=$rrd_filename_escape:sensor:AVERAGE:start=".$prev_from.":end=".$from;
$rrd_options .= " LINE1.5:sensorX#0000cc:'Prev " . rrdtool_escape($sensor['sensor_descr'],18)."'";
$rrd_options .= " SHIFT:sensorX:$period";
$rrd_options .= " GPRINT:sensorX$current_id:MIN:%5.2lfC";
$rrd_options .= " GPRINT:sensorX:LAST:%5.2lfC";
$rrd_options .= " GPRINT:sensorX:MAX:%5.2lfC\\l";
}
$graph_return['descr'] = 'Dew point measured in celsius.';
// EOF

View File

@ -1,33 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "cc1100";
$colour_area = "FFFF99";
$colour_minmax = "c5c5c5";
$scale_min = 0;
$graph_max = 1;
$unit_text = "m";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
if (is_numeric($sensor['sensor_limit'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit']."#99999960::dashes"; }
if (is_numeric($sensor['sensor_limit_low'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#99999960::dashes"; }
$graph_return['descr'] = 'Distance sensor measured in m.';
// EOF

View File

@ -1,34 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "cc0000";
$colour_area = "FFBBBB";
$colour_minmax = "c5c5c5";
$graph_max = 1;
$unit_text = "mg/M3";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
//if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
//if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Dust';
// EOF

View File

@ -1,30 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor:LAST:%3.0lfrpm";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lfrpm\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Rotational fan speed sensor measured in RPM.';
// EOF

View File

@ -1,30 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor:LAST:%6.2lf%sHz";
$rrd_options .= " GPRINT:sensor:MAX:%6.2lf%sHz\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Frequency sensor measured in hertz';
// EOF

View File

@ -1,30 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 20);
$colour_line = "cc0000";
$colour_area = "FFBBBB";
$colour_minmax = "c5c5c5";
$graph_max = 1;
$unit_text = "Gauge";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
$graph_return['descr'] = 'Gauges.';
// EOF

View File

@ -6,31 +6,55 @@
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
/// FIXME. To unify all sensor graphs.
$include = $config['html_dir'] . "/includes/graphs/$type/";
// Some Class specific options
switch ($sensor['sensor_class']) {
case 'humidity':
case 'capacity':
case 'load':
case 'progress':
include($include."percent.inc.php");
$scale_min = "0";
$scale_max = "100";
break;
case 'snr':
case 'attenuation':
case 'sound':
include($include."db.inc.php");
$scale_min = "0";
$scale_max = "60";
break;
default:
if (is_file($include.$sensor['sensor_class'].".inc.php")) {
include($include.$sensor['sensor_class'].".inc.php");
} else {
graph_error($type.'_'.$subtype); // Graph Template Missing;
}
}
unset($include);
$ds = "sensor";
$sensor_type = $config['sensor_types'][$sensor['sensor_type']];
$line_text = $sensor['sensor_descr'];
$colour_line = "cc0000";
$colour_area = "FFBBBB";
$colour_minmax = "c5c5c5";
$graph_max = 1;
if (isset($sensor_type['graph_unit'])) {
$unit_text = $sensor_type['graph_unit'];
} else {
$unit_text = $sensor_type['symbol'];
}
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
if (is_numeric($sensor['sensor_limit'])) {
$rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
}
if (is_numeric($sensor['sensor_limit_low'])) {
$rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
}
$graph_return['descr'] = $sensor_type['descr'];
// EOF

View File

@ -1,34 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "cc0000";
$colour_area = "FFFF99";
$colour_minmax = "c5c5c5";
$scale_min = 0;
$graph_max = 1;
$unit_text = "lux";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
if (is_numeric($sensor['sensor_limit'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes"; }
if (is_numeric($sensor['sensor_limit_low'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes"; }
$graph_return['descr'] = 'Illuminance sensor measured in lux.';
// EOF

View File

@ -1,31 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor$current_id:MIN:%5.2lfΩ";
$rrd_options .= " GPRINT:sensor:LAST:%5.2lfΩ";
$rrd_options .= " GPRINT:sensor:MAX:%5.2lfΩ\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Resistance sensor.';
// EOF

View File

@ -1,38 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
$scale_max = "100";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename_escape:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename_escape:sensor:MIN";
$rrd_options .= " CDEF:sensor_diff=sensor_max,sensor_min,-";
$rrd_options .= " AREA:sensor_min";
$rrd_options .= " AREA:sensor_diff#c5c5c5::STACK";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor_min:MIN:%4.1lf%%";
$rrd_options .= " GPRINT:sensor:LAST:%4.1lf%%";
$rrd_options .= " GPRINT:sensor_max:MAX:%4.1lf%%\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = nicecase($sensor['sensor_class']).' sensor measured in percent.';
// EOF

View File

@ -1,34 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'],8);
$colour_line = "cc0000";
$colour_area = "FFBBBB";
$colour_minmax = "c5c5c5";
$graph_max = 1;
$unit_text = "Watts";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
//if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
//if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Power sensor measured in watts.';
// EOF

View File

@ -1,38 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " -A ";
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename_escape:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename_escape:sensor:MIN";
$rrd_options .= " AREA:sensor_max#c5c5c5";
$rrd_options .= " AREA:sensor_min#ffffffff";
#$rrd_options .= " AREA:sensor#FFFF99";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],22)."'";
$rrd_options .= " GPRINT:sensor:LAST:%6.2lf";
$rrd_options .= " GPRINT:sensor:MAX:%6.2lf\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Power Factor';
// EOF

View File

@ -1,33 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "cc0000";
$colour_area = "FFFF99";
$colour_minmax = "c5c5c5";
$graph_max = 1;
$unit_text = "Pa";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
if (is_numeric($sensor['sensor_limit'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes"; }
if (is_numeric($sensor['sensor_limit_low'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes"; }
$graph_return['descr'] = 'Pressure sensor measured in Pascal.';
// EOF

View File

@ -1,31 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor$current_id:MIN:%5.2lfΩ";
$rrd_options .= " GPRINT:sensor:LAST:%5.2lfΩ";
$rrd_options .= " GPRINT:sensor:MAX:%5.2lfΩ\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Resistance sensor.';
// EOF

View File

@ -1,38 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " -A ";
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename_escape:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename_escape:sensor:MIN";
$rrd_options .= " AREA:sensor_max#c5c5c5";
$rrd_options .= " AREA:sensor_min#ffffffff";
#$rrd_options .= " AREA:sensor#FFFF99";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],22)."'";
$rrd_options .= " GPRINT:sensor:LAST:%6.2lfW";
$rrd_options .= " GPRINT:sensor:MAX:%6.2lfW\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Reactive power sensor measured in voltampere reactive.';
// EOF

View File

@ -1,38 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " -A ";
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename_escape:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename_escape:sensor:MIN";
$rrd_options .= " AREA:sensor_max#c5c5c5";
$rrd_options .= " AREA:sensor_min#ffffffff";
#$rrd_options .= " AREA:sensor#FFFF99";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],22)."'";
$rrd_options .= " GPRINT:sensor:LAST:%6.2lf%smin";
$rrd_options .= " GPRINT:sensor:MAX:%6.2lf%smin\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Runtime sensor measured in minutes.';
// EOF

View File

@ -1,28 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor:LAST:%3.0lf";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lf\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
// EOF

View File

@ -1,33 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "CC0000";
$colour_minmax = "FF5555";
$scale_min = 0;
$graph_max = 60;
$unit_text = "C";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
if (is_numeric($sensor['sensor_limit'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes"; }
if (is_numeric($sensor['sensor_limit_low'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes"; }
$graph_return['descr'] = 'Temperature sensor measured in celsius.';
// EOF

View File

@ -1,34 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "cc0000";
$colour_area = "FFFF99";
$colour_minmax = "c5c5c5";
$scale_min = 0;
$graph_max = 1;
$unit_text = "m/s";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
if (is_numeric($sensor['sensor_limit'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit']."#99999960::dashes"; }
if (is_numeric($sensor['sensor_limit_low'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#99999960::dashes"; }
$graph_return['descr'] = 'Velocity sensor measured in m/s.';
// EOF

View File

@ -1,39 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " -A ";
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename_escape:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename_escape:sensor:MIN";
$rrd_options .= " CDEF:sensor_minmax=sensor_max,sensor_min,-";
$rrd_options .= " AREA:sensor_min#00000000";
$rrd_options .= " AREA:sensor_minmax#ff333360:STACK";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],22)."'";
$rrd_options .= " GPRINT:sensor:LAST:%6.2lfV";
$rrd_options .= " GPRINT:sensor:MAX:%6.2lfV\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Potential sensor measured in volts.';
// EOF

View File

@ -1,34 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "cc0000";
$colour_area = "FFBBBB";
$colour_minmax = "c5c5c5";
$graph_max = 1;
$unit_text = "Litres";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
//if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
//if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Volume.';
// EOF

View File

@ -1,30 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$scale_min = "0";
include_once($config['html_dir']."/includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " DEF:sensor=$rrd_filename_escape:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],20)."'";
$rrd_options .= " GPRINT:sensor:LAST:%3.0lfl/min";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lfl/min\\l";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
$graph_return['descr'] = 'Water flow sensor measured in l/min.';
// EOF

View File

@ -1,34 +0,0 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "cc0000";
$colour_area = "FFFF99";
$colour_minmax = "c5c5c5";
$scale_min = 0;
$graph_max = 1;
$unit_text = "nm";
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
if (is_numeric($sensor['sensor_limit'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes"; }
if (is_numeric($sensor['sensor_limit_low'])) { $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes"; }
$graph_return['descr'] = 'Wavelength sensor measured in nm.';
// EOF

View File

@ -1,5 +1,4 @@
<?php
/**
* Observium
*
@ -7,7 +6,7 @@
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
@ -46,11 +45,10 @@ $target = $device['hostname'];
if($config['smokeping']['suffix']) $target = str_replace($config['smokeping']['suffix'],"",$target);
if($config['smokeping']['split_char']) $target = str_replace(".", $config['smokeping']['split_char'],$target);
if (isset($config['smokeping']['master_hostname']))
{
if (isset($config['smokeping']['master_hostname'])) {
$master_hostname = $config['smokeping']['master_hostname'];
} else {
$master_hostname = $config['own_hostname'];
$master_hostname = $config['own_hostname'] ?: get_localhost();
}
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($config['smokeping']['dir'])) as $filename_dir)

View File

@ -1,5 +1,4 @@
<?php
/**
* Observium
*
@ -7,7 +6,7 @@
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
@ -46,11 +45,10 @@ $target=$dest['hostname'];
if($config['smokeping']['suffix']) $target = str_replace($config['smokeping']['suffix'],"",$target);
if($config['smokeping']['split_char']) $target = str_replace(".", $config['smokeping']['split_char'],$target);
if (isset($config['smokeping']['master_hostname']))
{
if (isset($config['smokeping']['master_hostname'])) {
$master_hostname = $config['smokeping']['master_hostname'];
} else {
$master_hostname = $config['own_hostname'];
$master_hostname = $config['own_hostname'] ?: get_localhost();
}
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($config['smokeping']['dir'])) as $filename_dir)