mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove redundant code from port-{adsl,etherlike,poe} polling submodules.
$this_port already gets defined within include/polling/ports.inc.php so there's no need to redefine it again in each submodule. Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
This commit is contained in:
@@ -39,10 +39,7 @@
|
|||||||
// adslAturPerfESs.1 = 0 seconds
|
// adslAturPerfESs.1 = 0 seconds
|
||||||
// adslAturPerfValidIntervals.1 = 0
|
// adslAturPerfValidIntervals.1 = 0
|
||||||
// adslAturPerfInvalidIntervals.1 = 0
|
// adslAturPerfInvalidIntervals.1 = 0
|
||||||
if (isset($port_stats[$ifIndex]['adslLineCoding'])) {
|
if (isset($this_port['adslLineCoding'])) {
|
||||||
// Check to make sure Port data is cached.
|
|
||||||
$this_port = &$port_stats[$ifIndex];
|
|
||||||
|
|
||||||
$rrdfile = get_port_rrdfile_path ($device['hostname'], $port_id, 'adsl');
|
$rrdfile = get_port_rrdfile_path ($device['hostname'], $port_id, 'adsl');
|
||||||
|
|
||||||
$rrd_create = ' --step 300';
|
$rrd_create = ' --step 300';
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($port_stats[$ifIndex] &&
|
if ($this_port['dot3StatsIndex'] and $port['ifType'] == 'ethernetCsmacd') {
|
||||||
$port['ifType'] == 'ethernetCsmacd' &&
|
|
||||||
isset($port_stats[$ifIndex]['dot3StatsIndex'])) {
|
|
||||||
// Check to make sure Port data is cached.
|
|
||||||
$this_port = &$port_stats[$ifIndex];
|
|
||||||
|
|
||||||
// TODO: remove legacy check?
|
// TODO: remove legacy check?
|
||||||
$old_rrdfile = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename('etherlike-'.$port['ifIndex'].'.rrd');
|
$old_rrdfile = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename('etherlike-'.$port['ifIndex'].'.rrd');
|
||||||
$rrd_file = get_port_rrdfile_path ($device['hostname'], $port_id, 'dot3');
|
$rrd_file = get_port_rrdfile_path ($device['hostname'], $port_id, 'dot3');
|
||||||
|
|||||||
@@ -35,12 +35,7 @@ $peth_oids = array(
|
|||||||
'pethMainPseConsumptionPower',
|
'pethMainPseConsumptionPower',
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($port_stats[$ifIndex]
|
if ($this_port['dot3StatsIndex'] && $port['ifType'] == 'ethernetCsmacd') {
|
||||||
&& $port['ifType'] == 'ethernetCsmacd'
|
|
||||||
&& isset($port_stats[$ifIndex]['dot3StatsIndex'])) {
|
|
||||||
// Check to make sure Port data is cached.
|
|
||||||
$this_port = &$port_stats[$ifIndex];
|
|
||||||
|
|
||||||
$rrdfile = get_port_rrdfile_path ($device['hostname'], $port_id, 'poe');
|
$rrdfile = get_port_rrdfile_path ($device['hostname'], $port_id, 'poe');
|
||||||
if (!file_exists($rrdfile)) {
|
if (!file_exists($rrdfile)) {
|
||||||
$rrd_create .= $config['rrd_rra'];
|
$rrd_create .= $config['rrd_rra'];
|
||||||
|
|||||||
Reference in New Issue
Block a user