initial commit; version 22.5.12042
This commit is contained in:
30
html/includes/graphs/cefswitching/auth.inc.php
Normal file
30
html/includes/graphs/cefswitching/auth.inc.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
if (is_numeric($vars['id']))
|
||||
{
|
||||
$cef = dbFetchRow("SELECT * FROM `cef_switching` AS C, `devices` AS D WHERE C.cef_switching_id = ? AND C.device_id = D.device_id", array($vars['id']));
|
||||
|
||||
if (is_numeric($cef['device_id']) && ($auth || device_permitted($cef['device_id'])))
|
||||
{
|
||||
$device = device_by_id_cache($cef['device_id']);
|
||||
|
||||
$rrd_filename = get_rrd_path($device, "cefswitching-".$cef['entPhysicalIndex']."-".$cef['afi']."-".$cef['cef_index'].".rrd");
|
||||
|
||||
$title = generate_device_link($device);
|
||||
$title .= " :: CEF Switching :: " . escape_html($cef['cef_descr']);
|
||||
$auth = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
40
html/includes/graphs/cefswitching/graph.inc.php
Normal file
40
html/includes/graphs/cefswitching/graph.inc.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
|
||||
|
||||
$oids = array('drop', 'punt', 'hostpunt');
|
||||
$i = 0;
|
||||
|
||||
if (rrd_is_file($rrd_filename))
|
||||
{
|
||||
foreach ($oids as $oid)
|
||||
{
|
||||
$oid = str_replace("dot3Stats", "", $oid);
|
||||
$oid_ds = truncate($oid, 19, '');
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $oid;
|
||||
$rrd_list[$i]['ds'] = $oid_ds;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$colours = "mixed";
|
||||
$nototal = 1;
|
||||
$unit_text = "Errors";
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
} else {
|
||||
graph_error($type.'_'.$subtype); // Graph Template Missing;
|
||||
}
|
||||
|
||||
// EOF
|
Reference in New Issue
Block a user