initial commit; version 22.5.12042
This commit is contained in:
29
html/includes/graphs/bgp/auth.inc.php
Normal file
29
html/includes/graphs/bgp/auth.inc.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?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']))
|
||||
{
|
||||
|
||||
$data = dbFetchRow("SELECT * FROM `bgpPeers` WHERE `bgpPeer_id` = ?", array($vars['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'];
|
||||
$graph_title .= " :: AS" . ($config['web_show_bgp_asdot'] ? bgp_asplain_to_asdot($data['bgpPeerRemoteAs']) : $data['bgpPeerRemoteAs']);
|
||||
$auth = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
28
html/includes/graphs/bgp/graph.inc.php
Normal file
28
html/includes/graphs/bgp/graph.inc.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
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']);
|
||||
}
|
||||
|
||||
include($config['html_dir'] . "/includes/graphs/generic_definition.inc.php");
|
||||
|
||||
// EOF
|
35
html/includes/graphs/bgp/updates.inc.php
Normal file
35
html/includes/graphs/bgp/updates.inc.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
$rrd_filename = get_rrd_path($device, "bgp-" . $data['bgpPeerRemoteAddr'] . ".rrd");
|
||||
|
||||
$ds_in = "bgpPeerInUpdates";
|
||||
$ds_out = "bgpPeerOutUpdates";
|
||||
|
||||
$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_out_max = "FF7711";
|
||||
|
||||
$graph_max = 1;
|
||||
|
||||
$unit_text = "Updates";
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_duplex.inc.php");
|
||||
|
||||
// EOF
|
Reference in New Issue
Block a user