mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user