Removed broken POE graphing code (#10188)

* remove broken POE graphing code

* remove broken POE graphing code

* add missing iosxe condition
This commit is contained in:
PipoCanaja
2019-05-29 20:37:00 +02:00
committed by Tony Murray
parent ea45fd9d42
commit ccb6e2e614
2 changed files with 1 additions and 25 deletions

View File

@@ -351,7 +351,7 @@ if ($device['xdsl_count'] > '0') {
if ($config['enable_ports_poe']) {
// Code by OS device
if ($device['os'] == 'ios') {
if ($device['os'] == 'ios' || $device['os'] == 'iosxe') {
echo 'cpeExtPsePortEntry';
$port_stats_poe = snmpwalk_cache_oid($device, 'cpeExtPsePortEntry', array(), 'CISCO-POWER-ETHERNET-EXT-MIB');
$port_ent_to_if = snmpwalk_cache_oid($device, 'portIfIndex', array(), 'CISCO-STACK-MIB');
@@ -394,10 +394,6 @@ if ($config['enable_ports_poe']) {
[$group_id, $if_id] = explode(".", $key);
$port_stats[$if_id] = array_merge($port_stats[$if_id], $value);
}
} else {
//Any other device, generic polling
$port_stats = snmpwalk_cache_oid($device, 'pethPsePortEntry', $port_stats, 'POWER-ETHERNET-MIB');
$port_stats = snmpwalk_cache_oid($device, 'cpeExtPsePortEntry', $port_stats, 'CISCO-POWER-ETHERNET-EXT-MIB');
}
}

View File

@@ -59,24 +59,4 @@ if (($device['os'] == 'vrp')) {
data_update($device, 'poe', $tags, $fields);
echo 'PoE(IOS) ';
}//end if
} else {
//This is the legacy code, to be tested against devices. This code looks terribly broken. There is
//most probably no device that can show anything out of this ...
if ($this_port['dot3StatsIndex'] && $port['ifType'] == 'ethernetCsmacd') {
$upd = "$polled:".$port['cpeExtPsePortPwrAllocated'].':'.$port['cpeExtPsePortPwrAvailable'].':'.
$port['cpeExtPsePortPwrConsumption'].':'.$port['cpeExtPsePortMaxPwrDrawn'];
$fields = array(
'PortPwrAllocated' => $port['cpeExtPsePortPwrAllocated'],
'PortPwrAvailable' => $port['cpeExtPsePortPwrAvailable'],
'PortConsumption' => $port['cpeExtPsePortPwrConsumption'],
'PortMaxPwrDrawn' => $port['cpeExtPsePortMaxPwrDrawn'],
);
$tags = compact('ifName', 'rrd_name', 'rrd_def');
data_update($device, 'poe', $tags, $fields);
echo 'PoE(generic) ';
}//end if
}