commit version 22.12.12447
This commit is contained in:
61
html/includes/graphs/multi-oid-entry/auth.inc.php
Normal file
61
html/includes/graphs/multi-oid-entry/auth.inc.php
Normal 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
|
25
html/includes/graphs/multi-oid-entry/line.inc.php
Normal file
25
html/includes/graphs/multi-oid-entry/line.inc.php
Normal 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");
|
24
html/includes/graphs/multi-oid-entry/stacked.inc.php
Normal file
24
html/includes/graphs/multi-oid-entry/stacked.inc.php
Normal 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");
|
Reference in New Issue
Block a user