Commit version 24.12.13800
This commit is contained in:
@ -5,15 +5,14 @@
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
if ($_SESSION['userlevel'] >= 5)
|
||||
{
|
||||
$auth = 1;
|
||||
if ($_SESSION['userlevel'] >= 5) {
|
||||
$auth = 1;
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
@ -4,74 +4,74 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
// Generate a list of ports and then call the multi_bits grapher to generate from the list
|
||||
|
||||
$param = array();
|
||||
$param = [];
|
||||
|
||||
$sql = "SELECT `port_id`, `ifIndex`, `ifAlias`, `ifName`, `ifType`, `ifDescr`, `port_label`, `port_label_short`, `device_id`, `hostname`, `ports`.`ignore`";
|
||||
$sql = "SELECT `port_id`, `ifIndex`, `ifAlias`, `ifName`, `ifType`, `ifDescr`, `port_label`, `port_label_short`, `device_id`, `hostname`, `ports`.`ignore`";
|
||||
$sql .= " FROM `ports`";
|
||||
$sql .= " INNER JOIN `devices` USING (`device_id`)";
|
||||
$sql .= " WHERE ";
|
||||
|
||||
if (isset($vars['port_type'])) {
|
||||
$sql .= " `port_descr_type` = ? ";
|
||||
$param[] = $vars['port_type'];
|
||||
$sql .= " `port_descr_type` = ? ";
|
||||
$param[] = $vars['port_type'];
|
||||
} else {
|
||||
$sql .= "1 ";
|
||||
$sql .= "1 ";
|
||||
}
|
||||
|
||||
$sql .= generate_query_permitted(array('port', 'device'));
|
||||
$sql .= generate_query_permitted(['port', 'device']);
|
||||
|
||||
$ports = dbFetchRows($sql, $param);
|
||||
|
||||
// init
|
||||
$i = 0;
|
||||
$rrd_list = [];
|
||||
$i = 0;
|
||||
$rrd_list = [];
|
||||
$rrd_filenames = [];
|
||||
|
||||
foreach ($ports as $port) {
|
||||
|
||||
if (!isset($vars['port_type']) && is_array($config['device_traffic_iftype'])) {
|
||||
foreach ($config['device_traffic_iftype'] as $iftype) {
|
||||
if (preg_match($iftype ."i", $port['ifType'])) {
|
||||
continue 2;
|
||||
}
|
||||
if (!isset($vars['port_type']) && is_array($config['device_traffic_iftype'])) {
|
||||
foreach ($config['device_traffic_iftype'] as $iftype) {
|
||||
if (preg_match($iftype . "i", $port['ifType'])) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isset($vars['port_type']) && !$config['os'][$port['os']]['ports_unignore_descr'] &&
|
||||
is_array($config['device_traffic_descr'])) {
|
||||
foreach ($config['device_traffic_descr'] as $ifdescr) {
|
||||
if (preg_match($ifdescr."i", $port['ifDescr']) ||
|
||||
preg_match($ifdescr."i", $port['ifName']) ||
|
||||
preg_match($ifdescr."i", $port['port_label'])) {
|
||||
continue 2;
|
||||
}
|
||||
if (!isset($vars['port_type']) && !$config['os'][$port['os']]['ports_unignore_descr'] &&
|
||||
is_array($config['device_traffic_descr'])) {
|
||||
foreach ($config['device_traffic_descr'] as $ifdescr) {
|
||||
if (preg_match($ifdescr . "i", $port['ifDescr']) ||
|
||||
preg_match($ifdescr . "i", $port['ifName']) ||
|
||||
preg_match($ifdescr . "i", $port['port_label'])) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rrd_filename = get_port_rrdfilename($port, NULL, TRUE);
|
||||
if (rrd_is_file($rrd_filename)) {
|
||||
$rrd_filenames[] = $rrd_filename;
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $port['hostname'] . " " . $port['ifDescr'];
|
||||
$rrd_list[$i]['descr_in'] = $port['hostname'];
|
||||
$rrd_list[$i]['descr_out'] = $port['port_label_short'];
|
||||
$rrd_filename = get_port_rrdfilename($port, NULL, TRUE);
|
||||
if (rrd_is_file($rrd_filename)) {
|
||||
$rrd_filenames[] = $rrd_filename;
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $port['hostname'] . " " . $port['ifDescr'];
|
||||
$rrd_list[$i]['descr_in'] = $port['hostname'];
|
||||
$rrd_list[$i]['descr_out'] = $port['port_label_short'];
|
||||
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$units ='bps';
|
||||
$total_units ='B';
|
||||
$colours_in ='greens';
|
||||
$multiplier = "8";
|
||||
$units = 'bps';
|
||||
$total_units = 'B';
|
||||
$colours_in = 'greens';
|
||||
$multiplier = "8";
|
||||
$colours_out = 'blues';
|
||||
|
||||
$nototal = 1;
|
||||
@ -87,9 +87,9 @@ $graph_title .= "::bits";
|
||||
//$colour_area_out = "C3D9FF";
|
||||
|
||||
if (get_var_true($vars['separate'])) {
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_bits_separated.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_bits_separated.inc.php");
|
||||
} else {
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_bits.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_bits.inc.php");
|
||||
}
|
||||
|
||||
?>
|
||||
// EOF
|
||||
|
@ -4,40 +4,38 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
$params = array();
|
||||
$params = [];
|
||||
|
||||
$sql = "SELECT `port_id`, `ifIndex`, `ifAlias`, `ifName`, `ifType`, `ifDescr`, `port_label`, `port_label_short`, `device_id`, `hostname`, `ports`.`ignore`";
|
||||
$sql = "SELECT `port_id` ";
|
||||
$sql = "SELECT `port_id`, `ifIndex`, `ifAlias`, `ifName`, `ifType`, `ifDescr`, `port_label`, `port_label_short`, `device_id`, `hostname`, `ports`.`ignore`";
|
||||
$sql = "SELECT `port_id` ";
|
||||
$sql .= " FROM `ports`";
|
||||
$sql .= " INNER JOIN `devices` USING (`device_id`)";
|
||||
$sql .= " WHERE `port_descr_type` = ? ";
|
||||
|
||||
$sql .= generate_query_permitted(array('port', 'device'));
|
||||
$sql .= generate_query_permitted(['port', 'device']);
|
||||
|
||||
$params = array($vars['type_a']);
|
||||
foreach(dbFetchRows($sql, $params) AS $port)
|
||||
{
|
||||
$transit_ports[] = $port['port_id'];
|
||||
$params = [$vars['type_a']];
|
||||
foreach (dbFetchRows($sql, $params) as $port) {
|
||||
$transit_ports[] = $port['port_id'];
|
||||
}
|
||||
|
||||
$sql = "SELECT `port_id`, `ifIndex`, `ifAlias`, `ifName`, `ifType`, `ifDescr`, `port_label`, `port_label_short`, `device_id`, `hostname`, `ports`.`ignore`";
|
||||
$sql = "SELECT `port_id` ";
|
||||
$sql = "SELECT `port_id`, `ifIndex`, `ifAlias`, `ifName`, `ifType`, `ifDescr`, `port_label`, `port_label_short`, `device_id`, `hostname`, `ports`.`ignore`";
|
||||
$sql = "SELECT `port_id` ";
|
||||
$sql .= " FROM `ports`";
|
||||
$sql .= " INNER JOIN `devices` USING (`device_id`)";
|
||||
$sql .= " WHERE `port_descr_type` = ? ";
|
||||
|
||||
$sql .= generate_query_permitted(array('port', 'device'));
|
||||
$sql .= generate_query_permitted(['port', 'device']);
|
||||
|
||||
$params = array($vars['type_b']);
|
||||
foreach(dbFetchRows($sql, $params) AS $port)
|
||||
{
|
||||
$peering_ports[] = $port['port_id'];
|
||||
$params = [$vars['type_b']];
|
||||
foreach (dbFetchRows($sql, $params) as $port) {
|
||||
$peering_ports[] = $port['port_id'];
|
||||
}
|
||||
|
||||
$vars['id'] = $transit_ports;
|
||||
|
@ -5,62 +5,63 @@
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
$units = "b";
|
||||
$total_units = "B";
|
||||
$units = "b";
|
||||
$total_units = "B";
|
||||
|
||||
$nototal = 1;
|
||||
$nototal = 1;
|
||||
|
||||
$queue = (is_numeric($vars['queue']) ? $vars['queue'] : 1);
|
||||
$queue = (is_numeric($vars['queue']) ? $vars['queue'] : 1);
|
||||
|
||||
$metrics = array('QedBytes',
|
||||
'QedPkts',
|
||||
'TailDropPkts',
|
||||
'TotalRedDropPkts',
|
||||
'TotalRedDropBytes',
|
||||
);
|
||||
$metrics = ['QedBytes',
|
||||
'QedPkts',
|
||||
'TailDropPkts',
|
||||
'TotalRedDropPkts',
|
||||
'TotalRedDropBytes',
|
||||
];
|
||||
|
||||
if(in_array($vars['ds'], $metrics)) { $ds = $vars['ds']; } else { $ds = array_pop($metrics); }
|
||||
if (in_array($vars['ds'], $metrics)) {
|
||||
$ds = $vars['ds'];
|
||||
} else {
|
||||
$ds = array_pop($metrics);
|
||||
}
|
||||
|
||||
switch($ds)
|
||||
{
|
||||
case 'QedBytes':
|
||||
case 'TotalRedDropBytes':
|
||||
$multiplier = 8;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
switch ($ds) {
|
||||
case 'QedBytes':
|
||||
case 'TotalRedDropBytes':
|
||||
$multiplier = 8;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$rows = dbFetchRows("SELECT * FROM `entity_attribs` WHERE `attrib_type` = 'jnx_cos_queues'");
|
||||
|
||||
foreach ($rows as $row)
|
||||
{
|
||||
foreach ($rows as $row) {
|
||||
|
||||
$queues = json_decode($row['attrib_value']);
|
||||
$queues = json_decode($row['attrib_value']);
|
||||
|
||||
if(in_array($queue, $queues))
|
||||
{
|
||||
if (in_array($queue, $queues)) {
|
||||
|
||||
$port = get_port_by_id_cache($row['entity_id']);
|
||||
$device = device_by_id_cache($port['device_id']);
|
||||
$port = get_port_by_id_cache($row['entity_id']);
|
||||
$device = device_by_id_cache($port['device_id']);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.'port-'.get_port_rrdindex($port).'-'.$queue.'-jnx_cos_qstat.rrd';
|
||||
$rrd_list[] = array ('filename' => $rrd_filename,
|
||||
'descr' => $device['hostname'] . ' ' . $port['port_label_short'],
|
||||
'ds' => $ds);
|
||||
}
|
||||
$rrd_filename = $config['rrd_dir'] . '/' . $device['hostname'] . '/' . 'port-' . get_port_rrdindex($port) . '-' . $queue . '-jnx_cos_qstat.rrd';
|
||||
$rrd_list[] = ['filename' => $rrd_filename,
|
||||
'descr' => $device['hostname'] . ' ' . $port['port_label_short'],
|
||||
'ds' => $ds];
|
||||
}
|
||||
}
|
||||
|
||||
//print_r($rrd_list);
|
||||
|
||||
$colours = 'mixed';
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -17,40 +17,42 @@ $i = 0;
|
||||
$where = [];
|
||||
$args = [];
|
||||
|
||||
if(!safe_empty($vars['poller_id'])) {
|
||||
$where[] = "`poller_id` = ?";
|
||||
$args[] = $vars['poller_id'];
|
||||
if (!safe_empty($vars['poller_id'])) {
|
||||
$where[] = "`poller_id` = ?";
|
||||
$args[] = $vars['poller_id'];
|
||||
}
|
||||
|
||||
$query = "SELECT * FROM `devices`";
|
||||
if(safe_count($where)) {
|
||||
$query .= " WHERE ";
|
||||
$query .= implode(" AND ", $where);
|
||||
if (safe_count($where)) {
|
||||
$query .= " WHERE ";
|
||||
$query .= implode(" AND ", $where);
|
||||
}
|
||||
|
||||
foreach (dbFetchRows($query, $args) as $device) {
|
||||
$devices[$device['device_id']] = $device;
|
||||
$devices[$device['device_id']] = $device;
|
||||
}
|
||||
|
||||
$devices = array_sort_by($devices, 'last_polled_timetaken', SORT_DESC, SORT_NUMERIC);
|
||||
|
||||
foreach ($devices as $device_id => $device) {
|
||||
|
||||
$rrd_filename = get_rrd_path($device, 'perf-poller.rrd');
|
||||
$rrd_filename = get_rrd_path($device, 'perf-poller.rrd');
|
||||
|
||||
if (rrd_is_file($rrd_filename, TRUE)) {
|
||||
if (rrd_is_file($rrd_filename, TRUE)) {
|
||||
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_pad($device['hostname'], 25) ." (".$device['os'].")";
|
||||
$rrd_list[$i]['ds'] = "val";
|
||||
$i++;
|
||||
}
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_pad($device['hostname'], 25) . " (" . $device['os'] . ")";
|
||||
$rrd_list[$i]['ds'] = "val";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$units = 'Seconds';
|
||||
$total_units = 'Sec';
|
||||
|
||||
$colours = 'bluegrey';
|
||||
$colours = 'bluegrey';
|
||||
|
||||
$colour_scheme = "interpolateCubehelixDefault";
|
||||
|
||||
#$scale_min = "0";
|
||||
#$scale_max = "100";
|
||||
@ -59,6 +61,6 @@ $colours = 'bluegrey';
|
||||
#$text_orig = 1;
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
|
||||
// EOF
|
||||
|
@ -4,34 +4,34 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
$i = 0;
|
||||
|
||||
$query = "SELECT * FROM `devices`";
|
||||
$query = "SELECT * FROM `devices`";
|
||||
$devices = dbFetchRows($query, $sql_param);
|
||||
|
||||
foreach ($devices as $device) {
|
||||
$rrd_filename = get_rrd_path($device, "perf-poller.rrd");
|
||||
$rrd_filename = get_rrd_path($device, "perf-poller.rrd");
|
||||
|
||||
if (device_permitted($device) && rrd_is_file($rrd_filename, TRUE)) {
|
||||
if (device_permitted($device) && rrd_is_file($rrd_filename, TRUE)) {
|
||||
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_pad($device['hostname'], 25) ." (".$device['os'].")";
|
||||
$rrd_list[$i]['ds'] = "val";
|
||||
$i++;
|
||||
}
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_pad($device['hostname'], 25) . " (" . $device['os'] . ")";
|
||||
$rrd_list[$i]['ds'] = "val";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units = 'Seconds';
|
||||
$units = 'Seconds';
|
||||
$total_units = 'Sec';
|
||||
$colours ='mixed-q12';
|
||||
$colours = 'mixed-q12';
|
||||
|
||||
#$scale_min = "0";
|
||||
#$scale_max = "100";
|
||||
@ -40,6 +40,6 @@ $colours ='mixed-q12';
|
||||
#$text_orig = 1;
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_line.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_line.inc.php");
|
||||
|
||||
// EOF
|
||||
|
@ -4,34 +4,34 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
$i = 0;
|
||||
|
||||
$query = "SELECT * FROM `devices`";
|
||||
$query = "SELECT * FROM `devices`";
|
||||
$devices = dbFetchRows($query, $sql_param);
|
||||
|
||||
foreach ($devices as $device) {
|
||||
$rrd_filename = get_rrd_path($device, "perf-poller.rrd");
|
||||
$rrd_filename = get_rrd_path($device, "perf-poller.rrd");
|
||||
|
||||
if (device_permitted($device) && rrd_is_file($rrd_filename, TRUE)) {
|
||||
if (device_permitted($device) && rrd_is_file($rrd_filename, TRUE)) {
|
||||
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_pad($device['hostname'],25) ." (".$device['os'].")";
|
||||
$rrd_list[$i]['ds'] = "val";
|
||||
$i++;
|
||||
}
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_pad($device['hostname'], 25) . " (" . $device['os'] . ")";
|
||||
$rrd_list[$i]['ds'] = "val";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units = 'Seconds';
|
||||
$units = 'Seconds';
|
||||
$total_units = 'Sec';
|
||||
$colours ='mixed-q12';
|
||||
$colours = 'mixed-q12';
|
||||
|
||||
#$scale_min = "0";
|
||||
#$scale_max = "100";
|
||||
@ -40,6 +40,6 @@ $colours ='mixed-q12';
|
||||
#$text_orig = 1;
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
|
||||
// EOF
|
||||
|
@ -4,9 +4,9 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -17,58 +17,56 @@ $i = 0;
|
||||
$where = [];
|
||||
$args = [];
|
||||
|
||||
if(!safe_empty($vars['poller_id'])) {
|
||||
$where[] = "`poller_id` = ?";
|
||||
$args[] = $vars['poller_id'];
|
||||
if (!safe_empty($vars['poller_id'])) {
|
||||
$where[] = "`poller_id` = ?";
|
||||
$args[] = $vars['poller_id'];
|
||||
}
|
||||
|
||||
$query = "SELECT * FROM `devices`";
|
||||
if(safe_count($where)) {
|
||||
$query .= " WHERE ";
|
||||
$query .= implode(" AND ", $where);
|
||||
if (safe_count($where)) {
|
||||
$query .= " WHERE ";
|
||||
$query .= implode(" AND ", $where);
|
||||
}
|
||||
|
||||
foreach (dbFetchRows($query, $args) as $device) {
|
||||
$devices[$device['device_id']] = $device;
|
||||
$devices[$device['device_id']] = $device;
|
||||
|
||||
// Reference the cache.
|
||||
//$device = &$cache['devices']['id'][$id];
|
||||
$device['state'] = safe_unserialize($device['device_state']);
|
||||
|
||||
$device['state'] = safe_unserialize($device['device_state']);
|
||||
|
||||
foreach($device['state']['poller_mod_perf'] as $mod => $time) {
|
||||
$mods[$mod]['time'] += $time;
|
||||
$mods[$mod]['count']++;
|
||||
$mod_total += $time;
|
||||
if($mod == $vars['module'])
|
||||
{
|
||||
$device['mod_time'] = $time;
|
||||
$devices[$device['device_id']] = $device;
|
||||
foreach ($device['state']['poller_mod_perf'] as $mod => $time) {
|
||||
$mods[$mod]['time'] += $time;
|
||||
$mods[$mod]['count']++;
|
||||
$mod_total += $time;
|
||||
if ($mod == $vars['module']) {
|
||||
$device['mod_time'] = $time;
|
||||
$devices[$device['device_id']] = $device;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//r($devices);
|
||||
|
||||
$devices = array_sort_by($devices, 'mod_time', SORT_DESC, SORT_NUMERIC);
|
||||
|
||||
foreach ($devices AS $device_id => $device) {
|
||||
foreach ($devices as $device_id => $device) {
|
||||
|
||||
$rrd_filename = get_rrd_path($device, 'perf-pollermodule-'.$vars['module'].'.rrd');
|
||||
$rrd_filename = get_rrd_path($device, 'perf-pollermodule-' . $vars['module'] . '.rrd');
|
||||
|
||||
if (rrd_is_file($rrd_filename, TRUE)) {
|
||||
if (rrd_is_file($rrd_filename, TRUE)) {
|
||||
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_pad($device['hostname'],25) ." (".$device['os'].")";
|
||||
$rrd_list[$i]['ds'] = "val";
|
||||
$i++;
|
||||
}
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_pad($device['hostname'], 25) . " (" . $device['os'] . ")";
|
||||
$rrd_list[$i]['ds'] = "val";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$units = 'Seconds';
|
||||
$total_units = 'Sec';
|
||||
$colours = 'lgreen';
|
||||
|
||||
$scheme_colours = interpolateCubehelixGreen(safe_count($rrd_list));
|
||||
|
||||
$scale_min = "0";
|
||||
#$scale_max = "100";
|
||||
|
||||
@ -76,6 +74,6 @@ $scale_min = "0";
|
||||
#$text_orig = 1;
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
|
||||
// EOF
|
||||
|
@ -4,9 +4,9 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -14,67 +14,62 @@
|
||||
|
||||
$i = 0;
|
||||
|
||||
$mods = [];
|
||||
$mod_total = 0;
|
||||
$modules = [];
|
||||
$module_total_time = 0;
|
||||
|
||||
$where = [];
|
||||
$args = [];
|
||||
|
||||
if(!safe_empty($vars['poller_id'])) {
|
||||
$where[] = "`poller_id` = ?";
|
||||
$args[] = $vars['poller_id'];
|
||||
if (!safe_empty($vars['poller_id'])) {
|
||||
$where[] = "`poller_id` = ?";
|
||||
$args[] = $vars['poller_id'];
|
||||
}
|
||||
|
||||
$query = "SELECT * FROM `devices`";
|
||||
if(safe_count($where)) {
|
||||
$query .= " WHERE ";
|
||||
$query .= implode(" AND ", $where);
|
||||
if (safe_count($where)) {
|
||||
$query .= " WHERE ";
|
||||
$query .= implode(" AND ", $where);
|
||||
}
|
||||
|
||||
foreach (dbFetchRows($query, $args) as $device) {
|
||||
|
||||
$device['state'] = safe_unserialize($device['device_state']);
|
||||
$device['state'] = safe_unserialize($device['device_state']);
|
||||
|
||||
$devices[$device['device_id']] = $device;
|
||||
$devices[$device['device_id']] = $device;
|
||||
|
||||
foreach($device['state']['poller_mod_perf'] as $mod => $time) {
|
||||
$mods[$mod]['time'] += $time;
|
||||
$mods[$mod]['count']++;
|
||||
$mod_total += $time;
|
||||
}
|
||||
foreach ($device['state']['poller_mod_perf'] as $mod => $time) {
|
||||
$modules[$mod]['time'] += $time;
|
||||
$modules[$mod]['count']++;
|
||||
$module_total_time += $time;
|
||||
}
|
||||
}
|
||||
|
||||
$mods = array_sort_by($mods, 'time', SORT_DESC, SORT_NUMERIC);
|
||||
$modules = array_sort_by($modules, 'time', SORT_DESC, SORT_NUMERIC);
|
||||
|
||||
foreach($mods as $mod => $mod_data) {
|
||||
foreach ($modules as $mod => $mod_data) {
|
||||
|
||||
$groups[$mod]['descr'] = $mod;
|
||||
$groups[$mod]['descr'] = $mod;
|
||||
|
||||
foreach ($devices as $device_id => $device) {
|
||||
foreach ($devices as $device_id => $device) {
|
||||
|
||||
$rrd_filename = get_rrd_path($device, 'perf-pollermodule-'.$mod.'.rrd');
|
||||
$rrd_filename = get_rrd_path($device, 'perf-pollermodule-' . $mod . '.rrd');
|
||||
|
||||
if (rrd_is_file($rrd_filename, TRUE)) {
|
||||
$groups[$mod]['list'][] = [
|
||||
'filename' => $rrd_filename,
|
||||
'descr' => str_pad($device['hostname'],25) ." (".$device['os'].")",
|
||||
'ds' => "val"
|
||||
];
|
||||
if (rrd_is_file($rrd_filename, TRUE)) {
|
||||
$groups[$mod]['list'][] = [
|
||||
'filename' => $rrd_filename,
|
||||
'descr' => str_pad($device['hostname'], 25) . " (" . $device['os'] . ")",
|
||||
'ds' => "val"
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$units = 'Seconds';
|
||||
$total_units = 'Sec';
|
||||
$colours = 'mixed';
|
||||
|
||||
#$scale_min = "0";
|
||||
#$scale_max = "100";
|
||||
|
||||
#$divider = $i;
|
||||
#$text_orig = 1;
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_group_simplex_separated.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_group_simplex_separated.inc.php");
|
||||
|
||||
// EOF
|
||||
|
@ -4,41 +4,39 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
$i = 0;
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `processors` AS P, devices AS D WHERE D.device_id = P.device_id") as $proc)
|
||||
{
|
||||
$rrd_filename = get_rrd_path($device, "processor-" . $proc['processor_type'] . "-" . $proc['processor_index'] . ".rrd");
|
||||
foreach (dbFetchRows("SELECT * FROM `processors` AS P, devices AS D WHERE D.device_id = P.device_id") as $proc) {
|
||||
$rrd_filename = get_rrd_path($proc, get_processor_rrd($proc, $proc));
|
||||
|
||||
if (rrd_is_file($rrd_filename))
|
||||
{
|
||||
$descr = rewrite_entity_name($proc['processor_descr'], 'processor');
|
||||
if (rrd_is_file($rrd_filename)) {
|
||||
$descr = rewrite_entity_name($proc['processor_descr'], 'processor');
|
||||
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['ds'] = "usage";
|
||||
$rrd_list[$i]['area'] = 1;
|
||||
$i++;
|
||||
}
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['ds'] = "usage";
|
||||
$rrd_list[$i]['area'] = 1;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units = '%';
|
||||
$units = '%';
|
||||
$total_units = '%';
|
||||
$colours ='mixed';
|
||||
$colours = 'mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
$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,42 +4,40 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
$i = 0;
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `processors` AS P, devices AS D WHERE D.device_id = P.device_id") as $proc)
|
||||
{
|
||||
$rrd_filename = get_rrd_path($device, "processor-" . $proc['processor_type'] . "-" . $proc['processor_index'] . ".rrd");
|
||||
foreach (dbFetchRows("SELECT * FROM `processors` AS P, devices AS D WHERE D.device_id = P.device_id") as $proc) {
|
||||
$rrd_filename = get_rrd_path($proc, get_processor_rrd($proc, $proc));
|
||||
|
||||
if (rrd_is_file($rrd_filename))
|
||||
{
|
||||
$descr = rewrite_entity_name($proc['processor_descr'], 'processor');
|
||||
if (rrd_is_file($rrd_filename)) {
|
||||
$descr = rewrite_entity_name($proc['processor_descr'], 'processor');
|
||||
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['ds'] = "usage";
|
||||
$i++;
|
||||
}
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['ds'] = "usage";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units = '%';
|
||||
$units = '%';
|
||||
$total_units = '%';
|
||||
$colours ='oranges';
|
||||
$colours = 'oranges';
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
$divider = $i;
|
||||
$divider = $i;
|
||||
$text_orig = 1;
|
||||
$nototal = 1;
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
|
||||
?>
|
||||
|
@ -5,33 +5,36 @@
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
$dir = ($vars['dir'] == 'egress' ? 'egress' : 'ingress');
|
||||
$queue = (is_numeric($vars['queue']) ? $vars['queue'] : 1);
|
||||
$dir = ($vars['dir'] == 'egress' ? 'egress' : 'ingress');
|
||||
$queue = (is_numeric($vars['queue']) ? $vars['queue'] : 1);
|
||||
|
||||
$metrics = array('FwdInProfOcts',
|
||||
'FwdOutProfOcts',
|
||||
'FwdInProfPkts',
|
||||
'FwdOutProfPkts',
|
||||
'DroInProfOcts',
|
||||
'DroOutProfOcts',
|
||||
'DroInProfPkts',
|
||||
'DroOutProfPkts');
|
||||
$metrics = ['FwdInProfOcts',
|
||||
'FwdOutProfOcts',
|
||||
'FwdInProfPkts',
|
||||
'FwdOutProfPkts',
|
||||
'DroInProfOcts',
|
||||
'DroOutProfOcts',
|
||||
'DroInProfPkts',
|
||||
'DroOutProfPkts'];
|
||||
|
||||
if(in_array($vars['ds'], $metrics)) { $ds = $vars['ds']; } else { $ds = array_pop($metrics); }
|
||||
if (in_array($vars['ds'], $metrics)) {
|
||||
$ds = $vars['ds'];
|
||||
} else {
|
||||
$ds = array_pop($metrics);
|
||||
}
|
||||
|
||||
if(strstr("Octs", $ds))
|
||||
{
|
||||
if (strstr("Octs", $ds)) {
|
||||
$multiplier = 8;
|
||||
}
|
||||
|
||||
$rows = dbFetchRows("SELECT * FROM `entity_attribs` WHERE `attrib_type` = 'sros_".$dir."_queues'");
|
||||
$rows = dbFetchRows("SELECT * FROM `entity_attribs` WHERE `attrib_type` = 'sros_" . $dir . "_queues'");
|
||||
|
||||
//print_r($rows);
|
||||
|
||||
@ -39,27 +42,25 @@ $rows = dbFetchRows("SELECT * FROM `entity_attribs` WHERE `attrib_type` = 'sros_
|
||||
|
||||
//print_r($queues);
|
||||
|
||||
foreach ($rows as $row)
|
||||
{
|
||||
foreach ($rows as $row) {
|
||||
|
||||
$queues = json_decode($row['attrib_value']);
|
||||
$queues = json_decode($row['attrib_value']);
|
||||
|
||||
if(in_array($queue, $queues))
|
||||
{
|
||||
if (in_array($queue, $queues)) {
|
||||
|
||||
$port = get_port_by_id_cache($row['entity_id']);
|
||||
$device = device_by_id_cache($port['device_id']);
|
||||
$port = get_port_by_id_cache($row['entity_id']);
|
||||
$device = device_by_id_cache($port['device_id']);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.'port-'.get_port_rrdindex($port).'-'.$queue.'-sros_'.$dir.'_qstat.rrd';
|
||||
$rrd_list[] = array ('filename' => $rrd_filename,
|
||||
'descr' => $device['hostname'] . ' ' . $port['port_label_short'],
|
||||
'ds' => $ds);
|
||||
}
|
||||
$rrd_filename = $config['rrd_dir'] . '/' . $device['hostname'] . '/' . 'port-' . get_port_rrdindex($port) . '-' . $queue . '-sros_' . $dir . '_qstat.rrd';
|
||||
$rrd_list[] = ['filename' => $rrd_filename,
|
||||
'descr' => $device['hostname'] . ' ' . $port['port_label_short'],
|
||||
'ds' => $ds];
|
||||
}
|
||||
}
|
||||
|
||||
//print_r($rrd_list);
|
||||
|
||||
$colours = 'mixed';
|
||||
|
||||
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