initial commit; version 22.5.12042
This commit is contained in:
39
html/includes/graphs/port/adsl_attainable.inc.php
Normal file
39
html/includes/graphs/port/adsl_attainable.inc.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$rrd_filename = get_port_rrdfilename($port, "adsl", TRUE);
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = "Downstream";
|
||||
$rrd_list[0]['ds'] = "AturCurrAttainableR";
|
||||
|
||||
$rrd_list[1]['filename'] = $rrd_filename;
|
||||
$rrd_list[1]['descr'] = "Upstream";
|
||||
$rrd_list[1]['ds'] = "AtucCurrAttainableR";
|
||||
|
||||
$unit_text = "Bits/sec";
|
||||
|
||||
$units='';
|
||||
$total_units='';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
if ($rrd_list)
|
||||
{
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_line.inc.php");
|
||||
}
|
||||
|
||||
?>
|
39
html/includes/graphs/port/adsl_attenuation.inc.php
Normal file
39
html/includes/graphs/port/adsl_attenuation.inc.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$rrd_filename = get_port_rrdfilename($port, "adsl", TRUE);
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = "Downstream";
|
||||
$rrd_list[0]['ds'] = "AturCurrAtn";
|
||||
|
||||
$rrd_list[1]['filename'] = $rrd_filename;
|
||||
$rrd_list[1]['descr'] = "Upstream";
|
||||
$rrd_list[1]['ds'] = "AtucCurrAtn";
|
||||
|
||||
$unit_text = "dB";
|
||||
|
||||
$units='';
|
||||
$total_units='';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
if ($rrd_list)
|
||||
{
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_line.inc.php");
|
||||
}
|
||||
|
||||
?>
|
39
html/includes/graphs/port/adsl_power.inc.php
Normal file
39
html/includes/graphs/port/adsl_power.inc.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$rrd_filename = get_port_rrdfilename($port, "adsl", TRUE);
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = "Downstream";
|
||||
$rrd_list[0]['ds'] = "AturCurrOutputPwr";
|
||||
|
||||
$rrd_list[1]['filename'] = $rrd_filename;
|
||||
$rrd_list[1]['descr'] = "Upstream";
|
||||
$rrd_list[1]['ds'] = "AtucCurrOutputPwr";
|
||||
|
||||
$unit_text = "dBm";
|
||||
|
||||
$units='';
|
||||
$total_units='';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
if ($rrd_list)
|
||||
{
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_line.inc.php");
|
||||
}
|
||||
|
||||
?>
|
39
html/includes/graphs/port/adsl_snr.inc.php
Normal file
39
html/includes/graphs/port/adsl_snr.inc.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$rrd_filename = get_port_rrdfilename($port, "adsl", TRUE);
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = "Downstream";
|
||||
$rrd_list[0]['ds'] = "AturCurrSnrMgn";
|
||||
|
||||
$rrd_list[1]['filename'] = $rrd_filename;
|
||||
$rrd_list[1]['descr'] = "Upstream";
|
||||
$rrd_list[1]['ds'] = "AtucCurrSnrMgn";
|
||||
|
||||
$unit_text = "dB";
|
||||
|
||||
$units='';
|
||||
$total_units='';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
if ($rrd_list)
|
||||
{
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_line.inc.php");
|
||||
}
|
||||
|
||||
?>
|
39
html/includes/graphs/port/adsl_speed.inc.php
Normal file
39
html/includes/graphs/port/adsl_speed.inc.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$rrd_filename = get_port_rrdfilename($port, "adsl", TRUE);
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = "Downstream";
|
||||
$rrd_list[0]['ds'] = "AturChanCurrTxRate";
|
||||
|
||||
$rrd_list[1]['filename'] = $rrd_filename;
|
||||
$rrd_list[1]['descr'] = "Upstream";
|
||||
$rrd_list[1]['ds'] = "AtucChanCurrTxRate";
|
||||
|
||||
$unit_text = "Bits/sec";
|
||||
|
||||
$units='';
|
||||
$total_units='';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
if ($rrd_list)
|
||||
{
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_line.inc.php");
|
||||
}
|
||||
|
||||
?>
|
97
html/includes/graphs/port/auth.inc.php
Normal file
97
html/includes/graphs/port/auth.inc.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Get port ID by ifIndex/ifDescr/ifAlias or customer circuit
|
||||
// variables: ifindex, ifdescr (or port), ifalias, circuit
|
||||
if (!is_numeric($vars['id']))
|
||||
{
|
||||
if (is_numeric($device['device_id']))
|
||||
{
|
||||
if (is_numeric($vars['ifindex']))
|
||||
{
|
||||
// Get port by ifIndex
|
||||
$port = get_port_by_index_cache($device['device_id'], $vars['ifindex']);
|
||||
if ($port) { $vars['id'] = $port['port_id']; }
|
||||
}
|
||||
else if (!empty($vars['ifdescr']))
|
||||
{
|
||||
// Get port by ifDescr
|
||||
$port_id = get_port_id_by_ifDescr($device['device_id'], $vars['ifdescr']);
|
||||
if ($port_id) { $vars['id'] = $port_id; }
|
||||
}
|
||||
else if (!empty($vars['port']))
|
||||
{
|
||||
// Get port by ifDescr (backward compatibility)
|
||||
$port_id = get_port_id_by_ifDescr($device['device_id'], $vars['port']);
|
||||
if ($port_id) { $vars['id'] = $port_id; }
|
||||
}
|
||||
else if (!empty($vars['ifalias']))
|
||||
{
|
||||
// Get port by ifAlias
|
||||
$port_id = get_port_id_by_ifAlias($device['device_id'], $vars['ifalias']);
|
||||
if ($port_id) { $vars['id'] = $port_id; }
|
||||
}
|
||||
}
|
||||
else if (!empty($vars['circuit']))
|
||||
{
|
||||
// Get port by circuit id
|
||||
$port_id = get_port_id_by_customer(array('circuit' => $vars['circuit']));
|
||||
if ($port_id) { $vars['id'] = $port_id; }
|
||||
}
|
||||
}
|
||||
|
||||
if (is_numeric($vars['id']) && ($auth || port_permitted($vars['id'])))
|
||||
{
|
||||
$auth = TRUE;
|
||||
|
||||
$port = get_port_by_id($vars['id']);
|
||||
$device = device_by_id_cache($port['device_id']);
|
||||
|
||||
$title_array = array();
|
||||
$title_array[] = array('text' => $device['hostname'], 'url' => generate_url(array('page' => 'device', 'device' => $device['device_id'])));
|
||||
$title_array[] = array('text' => 'Ports', 'url' => generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'ports')));
|
||||
$title_array[] = array('text' => escape_html($port['port_label']) . (strlen($port['ifAlias']) ? " (".escape_html($port['ifAlias']).")" : ''), 'url' => generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'port', 'port' => $port['port_id'])));
|
||||
|
||||
$graph_title = device_name($device, TRUE) . " :: " . $port['port_label_short'];
|
||||
$rrd_filename = get_port_rrdfilename($port, NULL, TRUE);
|
||||
|
||||
if ($vars['type'] == 'port_bits')
|
||||
{
|
||||
$scale = (isset($vars['scale']) ? $vars['scale'] : $config['graphs']['ports_scale_default']);
|
||||
|
||||
if ($scale != 'auto')
|
||||
{
|
||||
if ($scale == 'speed' && $port['ifSpeed'] > 0)
|
||||
{
|
||||
$scale_max = $port['ifSpeed'];
|
||||
if ($graph_style != 'mrtg')
|
||||
{
|
||||
$scale_min = -1 * $scale_max;
|
||||
}
|
||||
} else {
|
||||
$scale = intval(unit_string_to_numeric($scale, 1000));
|
||||
if (is_numeric($scale) && $scale > 0)
|
||||
{
|
||||
$scale_max = $scale;
|
||||
if ($graph_style != 'mrtg')
|
||||
{
|
||||
$scale_min = -1 * $scale_max;
|
||||
}
|
||||
}
|
||||
}
|
||||
$scale_rigid = isset($config['graphs']['ports_scale_force']) && $config['graphs']['ports_scale_force'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
21
html/includes/graphs/port/bits.inc.php
Normal file
21
html/includes/graphs/port/bits.inc.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$ds_in = "INOCTETS";
|
||||
$ds_out = "OUTOCTETS";
|
||||
|
||||
$graph_max = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_data.inc.php");
|
||||
|
||||
// EOF
|
35
html/includes/graphs/port/discards.inc.php
Normal file
35
html/includes/graphs/port/discards.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
|
||||
*
|
||||
*/
|
||||
|
||||
$ds_in = "INDISCARDS";
|
||||
$ds_out = "OUTDISCARDS";
|
||||
|
||||
$colour_area_in = $config['colours']['graphs']['pkts']['in_area'];
|
||||
$colour_line_in = darken_color($colour_area_in);
|
||||
//$colour_line_in = $config['colours']['graphs']['pkts']['in_line'];
|
||||
$colour_area_out = $config['colours']['graphs']['pkts']['out_area'];
|
||||
$colour_line_out = $config['colours']['graphs']['pkts']['out_line'];
|
||||
|
||||
$colour_area_in_max = $config['colours']['graphs']['pkts']['in_max'];
|
||||
$colour_area_out_max = $config['colours']['graphs']['pkts']['out_max'];
|
||||
|
||||
$graph_max = 1;
|
||||
$unit_text = "Packets/s";
|
||||
|
||||
$args['nototal'] = 1;
|
||||
$print_total = 0;
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_duplex.inc.php");
|
||||
|
||||
// EOF
|
68
html/includes/graphs/port/errors.inc.php
Normal file
68
html/includes/graphs/port/errors.inc.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$ds_in = "INERRORS";
|
||||
$ds_out = "OUTERRORS";
|
||||
|
||||
$colour_area_in = $config['colours']['graphs']['errors']['in_area'];
|
||||
$colour_line_in = $config['colours']['graphs']['errors']['in_line'];
|
||||
|
||||
$colour_area_out = $config['colours']['graphs']['errors']['out_area'];
|
||||
$colour_line_out = $config['colours']['graphs']['errors']['out_line'];
|
||||
|
||||
$colour_area_in_max = $config['colours']['graphs']['errors']['in_max'];
|
||||
$colour_area_out_max = $config['colours']['graphs']['errors']['out_max'];
|
||||
|
||||
$graph_max = 1;
|
||||
$unit_text = "Errors/s";
|
||||
|
||||
$args['nototal'] = 1;
|
||||
$print_total = 0;
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_duplex.inc.php");
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
$rrd_list[1]['filename'] = $rrd_filename;
|
||||
$rrd_list[1]['descr'] = $int['ifDescr'];
|
||||
$rrd_list[1]['ds_in'] = "INERRORS";
|
||||
$rrd_list[1]['ds_out'] = "OUTERRORS";
|
||||
$rrd_list[1]['descr'] = "Errors";
|
||||
$rrd_list[1]['colour_area_in'] = "FF3300";
|
||||
$rrd_list[1]['colour_area_out'] = "FF6633";
|
||||
|
||||
/*
|
||||
$rrd_list[4]['filename'] = $rrd_filename;
|
||||
$rrd_list[4]['descr'] = $int['ifDescr'];
|
||||
$rrd_list[4]['ds_in'] = "INDISCARDS";
|
||||
$rrd_list[4]['ds_out'] = "OUTDISCARDS";
|
||||
$rrd_list[4]['descr'] = "Discards";
|
||||
$rrd_list[4]['colour_area_in'] = "805080";
|
||||
$rrd_list[4]['colour_area_out'] = "c0a060";
|
||||
*/
|
||||
/*
|
||||
$units='';
|
||||
$unit_text='Errors/sec';
|
||||
$total_units='B';
|
||||
$colours_in='greens';
|
||||
$multiplier = "1";
|
||||
$colours_out = 'blues';
|
||||
|
||||
$args['nototal'] = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_separated.inc.php");
|
||||
*/
|
||||
// EOF
|
45
html/includes/graphs/port/etherlike.inc.php
Normal file
45
html/includes/graphs/port/etherlike.inc.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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('dot3StatsAlignmentErrors', 'dot3StatsFCSErrors', 'dot3StatsSingleCollisionFrames', 'dot3StatsMultipleCollisionFrames',
|
||||
'dot3StatsSQETestErrors', 'dot3StatsDeferredTransmissions', 'dot3StatsLateCollisions', 'dot3StatsExcessiveCollisions',
|
||||
'dot3StatsInternalMacTransmitErrors', 'dot3StatsCarrierSenseErrors', 'dot3StatsFrameTooLongs', 'dot3StatsInternalMacReceiveErrors',
|
||||
'dot3StatsSymbolErrors');
|
||||
|
||||
$i = 0;
|
||||
$rrd_filename = get_port_rrdfilename($port, "dot3", TRUE);
|
||||
|
||||
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++;
|
||||
}
|
||||
}
|
||||
#} else { echo("file missing: $file"); }
|
||||
|
||||
$colours = "mixed";
|
||||
$nototal = 1;
|
||||
$unit_text = "Errors/sec";
|
||||
$simple_rrd = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
|
||||
?>
|
35
html/includes/graphs/port/fdb_count.inc.php
Normal file
35
html/includes/graphs/port/fdb_count.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;
|
||||
|
||||
include_once($config['html_dir'].'/includes/graphs/common.inc.php');
|
||||
|
||||
$rrd = get_port_rrdfilename($port, 'fdbcount', TRUE);
|
||||
if (rrd_is_file($rrd))
|
||||
{
|
||||
$rrd_filename = $rrd;
|
||||
}
|
||||
|
||||
$ds = 'value';
|
||||
|
||||
$colour_area = 'EEEEEE';
|
||||
$colour_line = '36393D';
|
||||
$colour_area_max = 'FFEE99';
|
||||
$unit_text = 'MACs';
|
||||
$unit_integer = TRUE;
|
||||
$line_text = 'Count';
|
||||
|
||||
include_once($config['html_dir'].'/includes/graphs/generic_simplex.inc.php');
|
||||
|
||||
// EOF
|
23
html/includes/graphs/port/ipv6_bits.inc.php
Normal file
23
html/includes/graphs/port/ipv6_bits.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$rrd_filename = get_port_rrdfilename($port, "ipv6-octets", TRUE);
|
||||
|
||||
$ds_in = "InOctets";
|
||||
$ds_out = "OutOctets";
|
||||
|
||||
$graph_max = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_data.inc.php");
|
||||
|
||||
// EOF
|
23
html/includes/graphs/port/jnx_QedBytes.inc.php
Normal file
23
html/includes/graphs/port/jnx_QedBytes.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'greens';
|
||||
|
||||
$ds = 'QedBytes';
|
||||
|
||||
include("jnx_cos_queues_common.inc.php");
|
||||
|
23
html/includes/graphs/port/jnx_QedPkts.inc.php
Normal file
23
html/includes/graphs/port/jnx_QedPkts.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
//$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'purples';
|
||||
|
||||
$ds = 'QedPkts';
|
||||
|
||||
include("jnx_cos_queues_common.inc.php");
|
||||
|
23
html/includes/graphs/port/jnx_TailDropPkts.inc.php
Normal file
23
html/includes/graphs/port/jnx_TailDropPkts.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
//$multiplier = "8";
|
||||
|
||||
$graph_title = "Tail Dropped Packets";
|
||||
$colours = 'reds';
|
||||
|
||||
$ds = 'TailDropPkts';
|
||||
|
||||
include("jnx_cos_queues_common.inc.php");
|
||||
|
23
html/includes/graphs/port/jnx_TotalRedDropBytes.inc.php
Normal file
23
html/includes/graphs/port/jnx_TotalRedDropBytes.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
//$multiplier = "8";
|
||||
|
||||
$graph_title = "RED Dropped Bytes";
|
||||
$colours = 'reds';
|
||||
|
||||
$ds = 'TotalRedDropBytes';
|
||||
|
||||
include("jnx_cos_queues_common.inc.php");
|
||||
|
23
html/includes/graphs/port/jnx_TotalRedDropPkts.inc.php
Normal file
23
html/includes/graphs/port/jnx_TotalRedDropPkts.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
//$multiplier = "8";
|
||||
|
||||
$graph_title = "RED Dropped Packets";
|
||||
$colours = 'reds';
|
||||
|
||||
$ds = 'TotalRedDropPkts';
|
||||
|
||||
include("jnx_cos_queues_common.inc.php");
|
||||
|
98
html/includes/graphs/port/jnx_cos_queue.inc.php
Normal file
98
html/includes/graphs/port/jnx_cos_queue.inc.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
$queue = $vars['queue'];
|
||||
$metric = $vars['metric'];
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.'port-'.get_port_rrdindex($port).'-'.$queue.'-jnx_cos_qstat.rrd';
|
||||
|
||||
if ($vars['metric'] == 'pkts')
|
||||
{
|
||||
$rrd_list[] = array('filename' => $rrd_filename,
|
||||
'descr' => 'Queued Packets',
|
||||
'ds' => 'QedPkts',
|
||||
'colour' => $config['graph_colours']['purples'][3]);
|
||||
|
||||
$rrd_list[] = array('filename' => $rrd_filename,
|
||||
'descr' => 'Transmitted Packets',
|
||||
'ds' => 'TxedPkts',
|
||||
'colour' => $config['graph_colours']['oranges'][3],
|
||||
'invert' => TRUE);
|
||||
|
||||
$rrd_list[] = array('filename' => $rrd_filename,
|
||||
'descr' => 'Tail Dropped Packets',
|
||||
'ds' => 'TailDropPkts',
|
||||
'colour' => $config['graph_colours']['reds'][0],
|
||||
'invert' => TRUE);
|
||||
|
||||
$rrd_list[] = array('filename' => $rrd_filename,
|
||||
'descr' => 'RED Dropped Packets',
|
||||
'ds' => 'TotalRedDropPkts',
|
||||
'colour' => $config['graph_colours']['reds'][5],
|
||||
'invert' => TRUE);
|
||||
|
||||
} else {
|
||||
|
||||
$rrd_list[] = array('filename' => $rrd_filename,
|
||||
'descr' => 'Queued Bits',
|
||||
'ds' => 'QedBytes',
|
||||
'colour' => $config['graph_colours']['greens'][3]);
|
||||
|
||||
$rrd_list[] = array('filename' => $rrd_filename,
|
||||
'descr' => 'Transmitted Bits',
|
||||
'ds' => 'TxedBytes',
|
||||
'colour' => $config['graph_colours']['blues'][3],
|
||||
'invert' => TRUE);
|
||||
|
||||
$rrd_list[] = array('filename' => $rrd_filename,
|
||||
'descr' => 'RED Dropped Bits',
|
||||
'ds' => 'TotalRedDropBytes',
|
||||
'colour' => $config['graph_colours']['reds'][5],
|
||||
'invert' => TRUE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
$i=0;
|
||||
foreach ($stats[$metric] as $stat => $descr)
|
||||
{
|
||||
$i++;
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['ds'] = $stat;
|
||||
if (strpos($stat, "Dro") !== FALSE)
|
||||
{
|
||||
$rrd_list[$i]['invert'] = TRUE;
|
||||
$rrd_list[$i]['colour'] = $config['graph_colours']['reds'][$i];
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
if($metric == 'bits')
|
||||
{
|
||||
$colours = 'greens';
|
||||
$unit_text = 'Bits/sec';
|
||||
$multiplier = 8;
|
||||
} else {
|
||||
$colours = 'purples';
|
||||
$unit_text = 'Pkts/sec';
|
||||
}
|
||||
|
||||
$scale_min = "0";
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi.inc.php");
|
53
html/includes/graphs/port/jnx_cos_queues_common.inc.php
Normal file
53
html/includes/graphs/port/jnx_cos_queues_common.inc.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$units = "b";
|
||||
$total_units = "B";
|
||||
|
||||
$scale_min = 0;
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
$queue_list = json_decode(get_entity_attrib('port', $port['port_id'], 'jnx_cos_queues'));
|
||||
|
||||
$queues = array();
|
||||
|
||||
foreach(json_decode(get_entity_attrib('device', $device['device_id'], 'jnx_cos_queues'), TRUE) as $data)
|
||||
{
|
||||
if(isset($data['queue']))
|
||||
{
|
||||
$queues[$data['queue']] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//print_r($queues);
|
||||
|
||||
foreach ($queue_list as $queue)
|
||||
{
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.'port-'.get_port_rrdindex($port).'-'.$queue.'-jnx_cos_qstat.rrd';
|
||||
$rrd_filenames[] = $rrd_filename;
|
||||
$rrd_list[$queue]['filename'] = $rrd_filename;
|
||||
|
||||
$text = 'Queue '.$queue;
|
||||
if(isset($queues[$queue]['name'])) { $text = $queues[$queue]['name'].' ('.$queue.')'; }
|
||||
if(isset($queues[$queue]['prio'])) { $text .= ' (' . $queues[$queue]['prio']. ')'; }
|
||||
|
||||
$rrd_list[$queue]['descr'] = $text;
|
||||
$rrd_list[$queue]['ds'] = $ds;
|
||||
}
|
||||
|
||||
$colours = 'mixed';
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
|
139
html/includes/graphs/port/mac_acc_total.inc.php
Normal file
139
html/includes/graphs/port/mac_acc_total.inc.php
Normal file
@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
if (!isset($vars['stat'])) { $vars['stat'] = "bits"; }
|
||||
if (is_numeric($vars['topn']) && $vars['topn'] > 0 && $vars['topn'] < 1024) { $topn = $vars['topn']; } else { $topn = '10'; }
|
||||
|
||||
include_once($config['html_dir']."/includes/graphs/common.inc.php");
|
||||
|
||||
switch($vars['stat'])
|
||||
{
|
||||
case "pkts":
|
||||
$units = 'pps';
|
||||
$unit = 'p';
|
||||
$multiplier = '1';
|
||||
$colours_in = 'purples';
|
||||
$colours_out = 'oranges';
|
||||
$prefix = "P";
|
||||
if ($vars['sort'] == "in")
|
||||
{
|
||||
$sort = "pkts_input_rate";
|
||||
}
|
||||
else if ($vars['sort'] == "out")
|
||||
{
|
||||
$sort = "pkts_output_rate";
|
||||
} else {
|
||||
$sort = "pps";
|
||||
}
|
||||
break;
|
||||
case "bits":
|
||||
$units = 'bps';
|
||||
$unit = 'B';
|
||||
$multiplier = '8';
|
||||
$colours_in = 'greens';
|
||||
$colours_out = 'blues';
|
||||
if ($vars['sort'] == "in")
|
||||
{
|
||||
$sort = "bytes_input_rate";
|
||||
} elseif ($vars['sort'] == "out") {
|
||||
$sort = "bytes_output_rate";
|
||||
} else {
|
||||
$sort = "bps";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(isset($sort))
|
||||
{
|
||||
$query = "SELECT *, (bytes_input_rate + bytes_output_rate) AS bps,
|
||||
(pkts_input_rate + pkts_output_rate) AS pps
|
||||
FROM `mac_accounting`
|
||||
WHERE `mac_accounting`.port_id = ?
|
||||
ORDER BY ".$sort." DESC LIMIT 0, ".$topn;
|
||||
|
||||
$mas = dbFetchRows($query, array($port['port_id'], $sort, $topn));
|
||||
}
|
||||
|
||||
$pluses = "";
|
||||
$iter = '0';
|
||||
$rrd_options .= " COMMENT:' In\: Current Maximum Total Out\: Current Maximum Total\\n'";
|
||||
|
||||
foreach ($mas as $ma)
|
||||
{
|
||||
$this_rrd = get_rrd_path($device, "mac_acc-" . $port['ifIndex'] . "-" . $ma['vlan_id'] ."-" . $ma['mac'] . ".rrd");
|
||||
|
||||
if (rrd_is_file($this_rrd))
|
||||
{
|
||||
$mac = format_mac($ma['mac']);
|
||||
$name = $mac;
|
||||
$addy = dbFetchRow("SELECT * FROM `ip_mac` WHERE `mac_address` = ? AND `port_id` = ?", array($ma['mac'], $ma['port_id']));
|
||||
|
||||
if ($addy)
|
||||
{
|
||||
$name = $addy['ipv4_address'] . " (".$mac.")";
|
||||
$peer = dbFetchRow("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D
|
||||
WHERE A.ipv4_address = ? AND I.port_id = A.port_id AND D.device_id = I.device_id", array($addy['ipv4_address']));
|
||||
if ($peer)
|
||||
{
|
||||
$name = $peer['hostname'] . " " . short_ifname($port['ifDescr'], NULL, FALSE) . " (".$mac.")";
|
||||
}
|
||||
|
||||
//if (dbFetchCell("SELECT COUNT(*) FROM bgpPeers WHERE device_id = ? AND bgpPeerIdentifier = ?", array($ma['device_id'], $addy['ipv4_address'])))
|
||||
if (dbExist('bgpPeers', '`device_id` = ? AND `bgpPeerIdentifier` = ?', array($ma['device_id'], $addy['ipv4_address'])))
|
||||
{
|
||||
$peer_info = dbFetchRow("SELECT * FROM bgpPeers WHERE device_id = ? AND bgpPeerIdentifier = ?", array($ma['device_id'], $addy['ipv4_address']));
|
||||
$name .= " - AS".$peer_info['bgpPeerRemoteAs'];
|
||||
}
|
||||
|
||||
if ($peer_info)
|
||||
{
|
||||
$asn = "AS".$peer_info['bgpPeerRemoteAs']; $astext = $peer_info['astext'];
|
||||
} else {
|
||||
unset ($as); unset ($astext); unset($asn);
|
||||
}
|
||||
}
|
||||
|
||||
$this_id = str_replace(".", "", $ma['mac']);
|
||||
if (!$config['graph_colours'][$colours_in][$iter] || !$config['graph_colours'][$colours_out][$iter]) { $iter = 0; }
|
||||
|
||||
$colour_in = $config['graph_colours'][$colours_in][$iter];
|
||||
$colour_out = $config['graph_colours'][$colours_out][$iter];
|
||||
$descr = rrdtool_escape($name, 36);
|
||||
$rrd_options .= " DEF:in".$this_id."=$this_rrd:".$prefix."IN:AVERAGE ";
|
||||
$rrd_options .= " DEF:out".$this_id."temp=$this_rrd:".$prefix."OUT:AVERAGE ";
|
||||
$rrd_options .= " CDEF:inB".$this_id."=in".$this_id.",$multiplier,* ";
|
||||
$rrd_options .= " CDEF:outB".$this_id."temp=out".$this_id."temp,$multiplier,*";
|
||||
$rrd_options .= " CDEF:outB".$this_id."=outB".$this_id."temp,-1,*";
|
||||
$rrd_options .= " CDEF:octets".$this_id."=inB".$this_id.",outB".$this_id."temp,+";
|
||||
$rrd_options .= " VDEF:totin".$this_id."=inB".$this_id.",TOTAL";
|
||||
$rrd_options .= " VDEF:totout".$this_id."=outB".$this_id."temp,TOTAL";
|
||||
$rrd_options .= " VDEF:tot".$this_id."=octets".$this_id.",TOTAL";
|
||||
$rrd_options .= " AREA:inB".$this_id."#" . $colour_in . ":'" . $descr . "':STACK";
|
||||
if ($rrd_optionsb) { $stack=":STACK"; }
|
||||
$rrd_optionsb .= " AREA:outB".$this_id."#" . $colour_out . ":$stack";
|
||||
$rrd_options .= " GPRINT:inB".$this_id.":LAST:%6.2lf%s$units";
|
||||
$rrd_options .= " GPRINT:inB".$this_id.":MAX:%6.2lf%s$units";
|
||||
$rrd_options .= " GPRINT:totin".$this_id.":%6.2lf%s$unit";
|
||||
$rrd_options .= " COMMENT:' '";
|
||||
$rrd_options .= " HRULE:999999999999999#" . $colour_out . ":' '";
|
||||
$rrd_options .= " GPRINT:outB".$this_id."temp:LAST:%6.2lf%s$units";
|
||||
$rrd_options .= " GPRINT:outB".$this_id."temp:MAX:%6.2lf%s$units";
|
||||
$rrd_options .= " GPRINT:totout".$this_id.":%6.2lf%s$unit\\n";
|
||||
$iter++;
|
||||
}
|
||||
}
|
||||
|
||||
$rrd_options .= $rrd_optionsb;
|
||||
$rrd_options .= " HRULE:0#999999";
|
||||
|
||||
// EOF
|
48
html/includes/graphs/port/nupkts.inc.php
Normal file
48
html/includes/graphs/port/nupkts.inc.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
# $rrd_list[1]['filename'] = get_port_rrdfilename($port, NULL, TRUE);
|
||||
# $rrd_list[1]['descr'] = $int['ifDescr'];
|
||||
# $rrd_list[1]['ds_in'] = "INNUCASTPKTS";
|
||||
# $rrd_list[1]['ds_out'] = "OUTNUCASTPKTS";
|
||||
# $rrd_list[1]['descr'] = "NonUnicast";
|
||||
# $rrd_list[1]['colour_area_in'] = "BB77BB";
|
||||
# $rrd_list[1]['colour_area_out'] = $config['colours']['graphs']['pkts']['out_area'];
|
||||
|
||||
$rrd_list[2]['filename'] = get_port_rrdfilename($port, NULL, TRUE);
|
||||
$rrd_list[2]['descr'] = $int['ifDescr'];
|
||||
$rrd_list[2]['ds_in'] = "INBROADCASTPKTS";
|
||||
$rrd_list[2]['ds_out'] = "OUTBROADCASTPKTS";
|
||||
$rrd_list[2]['descr'] = "Broadcast";
|
||||
$rrd_list[2]['colour_area_in'] = "905090";
|
||||
$rrd_list[2]['colour_area_out'] = "CCA514";
|
||||
|
||||
$rrd_list[4]['filename'] = get_port_rrdfilename($port, NULL, TRUE);
|
||||
$rrd_list[4]['descr'] = $int['ifDescr'];
|
||||
$rrd_list[4]['ds_in'] = "INMULTICASTPKTS";
|
||||
$rrd_list[4]['ds_out'] = "OUTMULTICASTPKTS";
|
||||
$rrd_list[4]['descr'] = "Multicast";
|
||||
$rrd_list[4]['colour_area_in'] = "DC91DC";
|
||||
$rrd_list[4]['colour_area_out'] = "FFE940";
|
||||
|
||||
$units='';
|
||||
$unit_text='Packets/sec';
|
||||
$colours_in='purples';
|
||||
$multiplier = "1";
|
||||
$colours_out = 'oranges';
|
||||
|
||||
$args['nototal'] = 1; $print_total = 0; $nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_separated.inc.php");
|
||||
|
||||
?>
|
40
html/includes/graphs/port/pagp_bits.inc.php
Normal file
40
html/includes/graphs/port/pagp_bits.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
|
||||
*
|
||||
*/
|
||||
|
||||
// Generate a list of ports and then call the multi_bits grapher to generate from the list
|
||||
|
||||
$i=0;
|
||||
foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ? AND `pagpGroupIfIndex` = ?", array($port['device_id'], $port['ifIndex'])) as $int)
|
||||
{
|
||||
$rrdfile = get_port_rrdfilename($int, NULL, TRUE);
|
||||
if (rrd_is_file($rrdfile))
|
||||
{
|
||||
$rrd_list[$i]['filename'] = $rrdfile;
|
||||
$rrd_list[$i]['descr'] = $int['ifDescr'];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$units='bps';
|
||||
$total_units='B';
|
||||
$colours_in='greens';
|
||||
$multiplier = "8";
|
||||
$colours_out = 'blues';
|
||||
|
||||
$nototal = 1;
|
||||
$ds_in = "INOCTETS";
|
||||
$ds_out = "OUTOCTETS";
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_bits_separated.inc.php");
|
||||
|
||||
?>
|
50
html/includes/graphs/port/percent.inc.php
Normal file
50
html/includes/graphs/port/percent.inc.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$rrd_filename_escape = rrdtool_escape($rrd_filename);
|
||||
|
||||
$defs = ' DEF:in_octets='.$rrd_filename_escape.':INOCTETS:AVERAGE';
|
||||
$defs .= ' DEF:out_octets='.$rrd_filename_escape.':OUTOCTETS:AVERAGE';
|
||||
$defs .= ' CDEF:in_bits=in_octets,8,*';
|
||||
$defs .= ' CDEF:out_bits=out_octets,8,*';
|
||||
|
||||
$defs .= ' CDEF:in=in_bits,'.$port['ifSpeed'].',/,100,*';
|
||||
$defs .= ' CDEF:out=out_bits,'.$port['ifSpeed'].',/,100,*';
|
||||
|
||||
$defs .= ' CDEF:in_max=in';
|
||||
$defs .= ' CDEF:out_max=out';
|
||||
|
||||
$defs .= ' HRULE:100#555:';
|
||||
$defs .= ' HRULE:-100#555:';
|
||||
|
||||
$colour_area_out = '3E629F';
|
||||
$colour_line_out = '070A64';
|
||||
|
||||
$colour_area_in = '72B240';
|
||||
$colour_line_in = '285B00';
|
||||
|
||||
#$colour_area_in_max = 'cc88cc';
|
||||
#$colour_area_out_max = 'FFefaa';
|
||||
|
||||
$graph_max = 0;
|
||||
|
||||
$scale_max = '100';
|
||||
$scale_min = '-100';
|
||||
|
||||
$unit_text = '% of '.formatRates($port['ifSpeed'], 4, 4);
|
||||
|
||||
$args['nototal'] = 1; $print_total = 0; $nototal = 1;
|
||||
|
||||
include($config['html_dir'].'/includes/graphs/generic_duplex.inc.php');
|
||||
|
||||
// EOF
|
57
html/includes/graphs/port/pktsize.inc.php
Normal file
57
html/includes/graphs/port/pktsize.inc.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$rrd_filename_escape = rrdtool_escape($rrd_filename);
|
||||
|
||||
$defs = ' DEF:in_octets='.$rrd_filename_escape.':INOCTETS:AVERAGE';
|
||||
$defs .= ' DEF:out_octets='.$rrd_filename_escape.':OUTOCTETS:AVERAGE';
|
||||
$defs .= ' DEF:in_upkts='.$rrd_filename_escape.':INUCASTPKTS:AVERAGE';
|
||||
$defs .= ' DEF:out_upkts='.$rrd_filename_escape.':OUTUCASTPKTS:AVERAGE';
|
||||
|
||||
$defs .= ' DEF:in_bpkts='.$rrd_filename_escape.':INBROADCASTPKTS:AVERAGE';
|
||||
$defs .= ' DEF:out_bpkts='.$rrd_filename_escape.':OUTBROADCASTPKTS:AVERAGE';
|
||||
$defs .= ' DEF:in_mpkts='.$rrd_filename_escape.':INMULTICASTPKTS:AVERAGE';
|
||||
$defs .= ' DEF:out_mpkts='.$rrd_filename_escape.':OUTMULTICASTPKTS:AVERAGE';
|
||||
|
||||
#$defs .= ' CDEF:in_bits=in_octets,8,*';
|
||||
#$defs .= ' CDEF:out_bits=out_octets,8,*';
|
||||
$defs .= ' CDEF:in_nupkts=in_bpkts,in_mpkts,+';
|
||||
$defs .= ' CDEF:out_nupkts=out_bpkts,out_mpkts,+';
|
||||
$defs .= ' CDEF:in_pkts=in_upkts,in_nupkts,+';
|
||||
$defs .= ' CDEF:out_pkts=out_upkts,out_nupkts,+';
|
||||
|
||||
$defs .= ' CDEF:in=in_octets,in_pkts,/';
|
||||
$defs .= ' CDEF:out=out_octets,out_pkts,/';
|
||||
|
||||
$defs .= ' CDEF:in_max=in';
|
||||
$defs .= ' CDEF:out_max=out';
|
||||
|
||||
$colour_area_in = '53BBAD';
|
||||
$colour_line_in = '2D9284';
|
||||
$colour_area_out = 'FFAC72';
|
||||
$colour_line_out = 'C7763D';
|
||||
|
||||
$colour_area_out = 'FFF772';
|
||||
$colour_line_out = 'C7BF3D';
|
||||
|
||||
#$colour_area_in_max = 'cc88cc';
|
||||
#$colour_area_out_max = 'FFefaa';
|
||||
|
||||
$graph_max = 0;
|
||||
$unit_text = 'Octets/Pkts';
|
||||
|
||||
$args['nototal'] = 1; $print_total = 0; $nototal = 1;
|
||||
|
||||
include('includes/graphs/generic_duplex.inc.php');
|
||||
|
||||
// EOF
|
25
html/includes/graphs/port/sros_EgressDroInProfOcts.inc.php
Normal file
25
html/includes/graphs/port/sros_EgressDroInProfOcts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'greens';
|
||||
|
||||
$ds = 'DroInProfOcts';
|
||||
|
||||
$dir = 'egress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_EgressDroInProfPkts.inc.php
Normal file
25
html/includes/graphs/port/sros_EgressDroInProfPkts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'purples';
|
||||
|
||||
$ds = 'DroInProfPkts';
|
||||
|
||||
$dir = 'egress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_EgressDroOutProfOcts.inc.php
Normal file
25
html/includes/graphs/port/sros_EgressDroOutProfOcts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'greens';
|
||||
|
||||
$ds = 'DroOutProfOcts';
|
||||
|
||||
$dir = 'egress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_EgressDroOutProfPkts.inc.php
Normal file
25
html/includes/graphs/port/sros_EgressDroOutProfPkts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'purples';
|
||||
|
||||
$ds = 'DroOutProfPkts';
|
||||
|
||||
$dir = 'egress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_EgressFwdInProfOcts.inc.php
Normal file
25
html/includes/graphs/port/sros_EgressFwdInProfOcts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'greens';
|
||||
|
||||
$ds = 'FwdInProfOcts';
|
||||
|
||||
$dir = 'egress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_EgressFwdInProfPkts.inc.php
Normal file
25
html/includes/graphs/port/sros_EgressFwdInProfPkts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'purples';
|
||||
|
||||
$ds = 'FwdInProfPkts';
|
||||
|
||||
$dir = 'egress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_EgressFwdOutProfOcts.inc.php
Normal file
25
html/includes/graphs/port/sros_EgressFwdOutProfOcts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'greens';
|
||||
|
||||
$ds = 'FwdOutProfOcts';
|
||||
|
||||
$dir = 'egress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_EgressFwdOutProfPkts.inc.php
Normal file
25
html/includes/graphs/port/sros_EgressFwdOutProfPkts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'purples';
|
||||
|
||||
$ds = 'FwdOutProfPkts';
|
||||
|
||||
$dir = 'egress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_IngressDroInProfOcts.inc.php
Normal file
25
html/includes/graphs/port/sros_IngressDroInProfOcts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'greens';
|
||||
|
||||
$ds = 'DroInProfOcts';
|
||||
|
||||
$dir = 'ingress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_IngressDroInProfPkts.inc.php
Normal file
25
html/includes/graphs/port/sros_IngressDroInProfPkts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'purples';
|
||||
|
||||
$ds = 'DroInProfPkts';
|
||||
|
||||
$dir = 'ingress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_IngressDroOutProfOcts.inc.php
Normal file
25
html/includes/graphs/port/sros_IngressDroOutProfOcts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'greens';
|
||||
|
||||
$ds = 'DroOutProfOcts';
|
||||
|
||||
$dir = 'ingress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_IngressDroOutProfPkts.inc.php
Normal file
25
html/includes/graphs/port/sros_IngressDroOutProfPkts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'purples';
|
||||
|
||||
$ds = 'DroOutProfPkts';
|
||||
|
||||
$dir = 'ingress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_IngressFwdInProfOcts.inc.php
Normal file
25
html/includes/graphs/port/sros_IngressFwdInProfOcts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'blues';
|
||||
|
||||
$ds = 'FwdInProfOcts';
|
||||
|
||||
$dir = 'ingress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_IngressFwdInProfPkts.inc.php
Normal file
25
html/includes/graphs/port/sros_IngressFwdInProfPkts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'purples';
|
||||
|
||||
$ds = 'FwdInProfPkts';
|
||||
|
||||
$dir = 'ingress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_IngressFwdOutProfOcts.inc.php
Normal file
25
html/includes/graphs/port/sros_IngressFwdOutProfOcts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'greens';
|
||||
|
||||
$ds = 'FwdOutProfOcts';
|
||||
|
||||
$dir = 'ingress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
25
html/includes/graphs/port/sros_IngressFwdOutProfPkts.inc.php
Normal file
25
html/includes/graphs/port/sros_IngressFwdOutProfPkts.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-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$total_units = "B";
|
||||
$multiplier = "8";
|
||||
|
||||
$graph_title = "Queued Bytes";
|
||||
$colours = 'purples';
|
||||
|
||||
$ds = 'FwdOutProfPkts';
|
||||
|
||||
$dir = 'ingress';
|
||||
|
||||
include("sros_queues_common.inc.php");
|
||||
|
61
html/includes/graphs/port/sros_queue.inc.php
Normal file
61
html/includes/graphs/port/sros_queue.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
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
$stats['bits'] = array('FwdInProfOcts' => 'Fwd In-Profile Traffic',
|
||||
'FwdOutProfOcts' => 'Fwd Out-Profile Traffic',
|
||||
'DroInProfOcts' => 'Drop In-Profile Traffic',
|
||||
'DroOutProfOcts' => 'Drop Out-Profile Traffic',
|
||||
);
|
||||
|
||||
$stats['pkts'] = array(
|
||||
'FwdInProfPkts' => 'Forwarded In-Profile Packets',
|
||||
'FwdOutProfPkts' => 'Forwarded Out-Profile Packets',
|
||||
'DroInProfPkts' => 'Dropped In-Profile Packets',
|
||||
'DroOutProfPkts' => 'Dropped Out-Profile Packets'
|
||||
);
|
||||
|
||||
|
||||
$queue = $vars['queue'];
|
||||
$metric = $vars['metric'];
|
||||
$dir = $vars['dir'];
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.'port-'.get_port_rrdindex($port).'-'.$queue.'-sros_'.$dir.'_qstat.rrd';
|
||||
|
||||
$i=0;
|
||||
foreach ($stats[$metric] as $stat => $descr)
|
||||
{
|
||||
$i++;
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['ds'] = $stat;
|
||||
if (strpos($stat, "Dro") !== FALSE)
|
||||
{
|
||||
$rrd_list[$i]['invert'] = TRUE;
|
||||
$rrd_list[$i]['colour'] = $config['graph_colours']['reds'][$i];
|
||||
}
|
||||
}
|
||||
|
||||
if($metric == 'bits')
|
||||
{
|
||||
$colours = 'greens';
|
||||
$unit_text = 'Bits/sec';
|
||||
$multiplier = 8;
|
||||
} else {
|
||||
$colours = 'purples';
|
||||
$unit_text = 'Pkts/sec';
|
||||
}
|
||||
|
||||
$scale_min = "0";
|
||||
$nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi.inc.php");
|
47
html/includes/graphs/port/sros_queues_common.inc.php
Normal file
47
html/includes/graphs/port/sros_queues_common.inc.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$units = "b";
|
||||
$total_units = "B";
|
||||
$scale_min = 0;
|
||||
$nototal = 1;
|
||||
|
||||
|
||||
$queues = json_decode(get_entity_attrib('port', $port['port_id'], 'sros_'.$dir.'_queues'));
|
||||
|
||||
//print_r($queues);
|
||||
|
||||
foreach ($queues as $queue)
|
||||
{
|
||||
|
||||
|
||||
if(isset($config['sros_queues'][$dir]['labels'][$queue]))
|
||||
{
|
||||
$label = $config['sros_queues'][$dir]['labels'][$queue] . ' ('.$queue.')';
|
||||
} else {
|
||||
$label = 'Queue '.$queue;
|
||||
}
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.'port-'.get_port_rrdindex($port).'-'.$queue.'-sros_'.$dir.'_qstat.rrd';
|
||||
$rrd_filenames[] = $rrd_filename;
|
||||
$rrd_list[$queue]['filename'] = $rrd_filename;
|
||||
$rrd_list[$queue]['descr'] = $label;
|
||||
$rrd_list[$queue]['ds'] = $ds;
|
||||
}
|
||||
|
||||
//print_r($rrd_list);
|
||||
|
||||
$colours = 'mixed';
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
|
33
html/includes/graphs/port/upkts.inc.php
Normal file
33
html/includes/graphs/port/upkts.inc.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$ds_in = "INUCASTPKTS";
|
||||
$ds_out = "OUTUCASTPKTS";
|
||||
|
||||
$colour_area_in = $config['colours']['graphs']['pkts']['in_area'];
|
||||
$colour_line_in = darken_color($colour_area_in);
|
||||
//$colour_line_in = $config['colours']['graphs']['pkts']['in_line'];
|
||||
$colour_area_out = $config['colours']['graphs']['pkts']['out_area'];
|
||||
$colour_line_out = $config['colours']['graphs']['pkts']['out_line'];
|
||||
|
||||
$colour_area_in_max = $config['colours']['graphs']['pkts']['in_max'];
|
||||
$colour_area_out_max = $config['colours']['graphs']['pkts']['out_max'];
|
||||
|
||||
$graph_max = 1;
|
||||
$unit_text = "Packets/s";
|
||||
|
||||
$args['nototal'] = 1; $print_total = 0; $nototal = 1;
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_duplex.inc.php");
|
||||
|
||||
// EOF
|
Reference in New Issue
Block a user