Commit version 24.12.13800
This commit is contained in:
@ -6,24 +6,26 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
if (is_numeric($vars['id'])) {
|
||||
if (!is_intnum($vars['id'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = dbFetchRow("SELECT * FROM `bgpPeers` WHERE `bgpPeer_id` = ?", [ $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'];
|
||||
$auth = TRUE;
|
||||
|
||||
$graph_title = device_name($device, TRUE);
|
||||
$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']) . ')';
|
||||
$graph_title .= ' (' . truncate($data['astext']) . ')';
|
||||
}
|
||||
$auth = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
@ -5,22 +5,21 @@
|
||||
*
|
||||
* 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 (preg_match('/^(?<subtype>prefixes)_(?<afi>ipv[46])(?<safi>\w+)/', $subtype, $matches))
|
||||
{
|
||||
// prefixes_ipv4unicast -> $data['bgpPeerRemoteAddr'] . ".ipv4.unicast
|
||||
$subtype = $matches['subtype'];
|
||||
$index = $data['bgpPeerRemoteAddr'] . '.' . $matches['afi'] . '.' . $matches['safi'];
|
||||
$graph_title .= " :: Prefixes " . escape_html($data['bgpPeerRemoteAddr'] . ' - ' . $matches['afi'] . '.' . $matches['safi']);
|
||||
if (preg_match('/^(?<subtype>prefixes)_(?<afi>ipv[46])(?<safi>\w+)/', $subtype, $matches)) {
|
||||
// prefixes_ipv4unicast -> $data['bgpPeerRemoteAddr'] . ".ipv4.unicast
|
||||
$subtype = $matches['subtype'];
|
||||
$index = $data['bgpPeerRemoteAddr'] . '.' . $matches['afi'] . '.' . $matches['safi'];
|
||||
$graph_title .= " :: Prefixes " . escape_html($data['bgpPeerRemoteAddr'] . ' - ' . $matches['afi'] . '.' . $matches['safi']);
|
||||
|
||||
} else {
|
||||
$subtype = 'updates';
|
||||
$graph_title .= " :: Updates " . escape_html($data['bgpPeerRemoteAddr']);
|
||||
$subtype = 'updates';
|
||||
$graph_title .= " :: Updates " . escape_html($data['bgpPeerRemoteAddr']);
|
||||
}
|
||||
|
||||
include($config['html_dir'] . "/includes/graphs/generic_definition.inc.php");
|
||||
|
@ -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
|
||||
*
|
||||
*/
|
||||
|
||||
@ -18,18 +18,18 @@ $rrd_filename = get_rrd_path($device, "bgp-" . $data['bgpPeerRemoteAddr'] . ".rr
|
||||
$ds_in = "bgpPeerInUpdates";
|
||||
$ds_out = "bgpPeerOutUpdates";
|
||||
|
||||
$colour_area_in = "AA66AA90";
|
||||
$colour_line_in = darken_color($colour_area_in, 1);
|
||||
$colour_area_in = "AA66AA90";
|
||||
$colour_line_in = darken_color($colour_area_in, 1);
|
||||
$colour_area_out = "FF660090";
|
||||
$colour_line_out = darken_color($colour_area_out, 1);
|
||||
|
||||
$colour_area_in_max = "FFEE99";
|
||||
$colour_area_in_max = "FFEE99";
|
||||
$colour_area_out_max = "FF7711";
|
||||
|
||||
$graph_max = 1;
|
||||
|
||||
$unit_text = "Updates";
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_duplex.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_duplex.inc.php");
|
||||
|
||||
// EOF
|
||||
|
Reference in New Issue
Block a user