Commit version 24.12.13800
This commit is contained in:
@ -5,9 +5,9 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -16,44 +16,46 @@
|
||||
// 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']); }
|
||||
if (!is_array($vars['id'])) {
|
||||
$vars['id'] = [$vars['id']];
|
||||
}
|
||||
|
||||
$is_permitted = FALSE;
|
||||
|
||||
$oids = [];
|
||||
$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` = ?";
|
||||
$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;
|
||||
$oid = dbFetchRow($sql, [$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'];
|
||||
$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;
|
||||
}
|
||||
|
||||
} 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;
|
||||
$title_array = [];
|
||||
$title_array[] = ['text' => 'Multiple OIDs'];
|
||||
$title_array[] = ['text' => safe_count($vars['id']) . ' Entries'];
|
||||
$auth = TRUE;
|
||||
}
|
||||
|
||||
unset($is_permitted);
|
||||
|
@ -4,22 +4,26 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
$units = '';
|
||||
$unit_text = $oid['oid_unit'];
|
||||
$units = '';
|
||||
$unit_text = $oid['oid_unit'];
|
||||
$total_units = '';
|
||||
|
||||
if ($oid['oid_logy'] == 1) { $log_y = TRUE; }
|
||||
if ($oid['oid_kibi'] == 1) { $kibi = 1; }
|
||||
if ($oid['oid_logy'] == 1) {
|
||||
$log_y = TRUE;
|
||||
}
|
||||
if ($oid['oid_kibi'] == 1) {
|
||||
$kibi = 1;
|
||||
}
|
||||
|
||||
$colours='mixed';
|
||||
$colours = 'mixed';
|
||||
|
||||
//$scale_min = "0";
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_line.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_line.inc.php");
|
||||
|
@ -4,21 +4,21 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
$units = '';
|
||||
$unit_text = ''; // Multiple OIDs can have different units.
|
||||
$units = '';
|
||||
$unit_text = ''; // Multiple OIDs can have different units.
|
||||
$total_units = '';
|
||||
|
||||
$i = 1;
|
||||
|
||||
$scale_min = "0";
|
||||
$colours='mixed-q12';
|
||||
$nototal = 1;
|
||||
$scale_min = "0";
|
||||
$colours = 'mixed-q12';
|
||||
$nototal = 1;
|
||||
$show_aggregate = TRUE;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_simplex_separated.inc.php");
|
Reference in New Issue
Block a user