mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-02 00:32:09 +02:00
reworking poe polling a bit, but still unpolished or even unfinished
git-svn-id: http://www.observium.org/svn/observer/trunk@1633 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Executable
+43
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
$cpe_oids = array('cpeExtPsePortEnable', 'cpeExtPsePortDiscoverMode', 'cpeExtPsePortDeviceDetected', 'cpeExtPsePortIeeePd',
|
||||
'cpeExtPsePortAdditionalStatus', 'cpeExtPsePortPwrMax', 'cpeExtPsePortPwrAllocated', 'cpeExtPsePortPwrAvailable', 'cpeExtPsePortPwrConsumption',
|
||||
'cpeExtPsePortMaxPwrDrawn', 'cpeExtPsePortEntPhyIndex', 'cpeExtPsePortEntPhyIndex', 'cpeExtPsePortPolicingCapable', 'cpeExtPsePortPolicingEnable',
|
||||
'cpeExtPsePortPolicingAction', 'cpeExtPsePortPwrManAlloc');
|
||||
|
||||
$peth_oids = array('pethPsePortAdminEnable', 'pethPsePortPowerPairsControlAbility', 'pethPsePortPowerPairs', 'pethPsePortDetectionStatus',
|
||||
'pethPsePortPowerPriority', 'pethPsePortMPSAbsentCounter', 'pethPsePortType', 'pethPsePortPowerClassifications', 'pethPsePortInvalidSignatureCounter',
|
||||
'pethPsePortPowerDeniedCounter', 'pethPsePortOverLoadCounter', 'pethPsePortShortCounter', 'pethMainPseConsumptionPower');
|
||||
|
||||
$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");
|
||||
|
||||
if($port_stats[$device['device_id']][$port['ifIndex']] && $port['ifType'] == "ethernetCsmacd"
|
||||
&& isset($port_stats[$device['device_id']][$port['ifIndex']]['dot3StatsIndex']))
|
||||
{ // Check to make sure Port data is cached.
|
||||
|
||||
$this_port = &$port_stats[$device['device_id']][$port['ifIndex']];
|
||||
|
||||
$rrdfile = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("port-".$port['ifIndex']."-poe.rrd");
|
||||
|
||||
if(!file_exists($rrdfile))
|
||||
{
|
||||
$rrd_create = $config['rrdtool'] . " create $rrdfile ";
|
||||
$rrd_create .= "RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MAX:0.5:1:600 \
|
||||
RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797";
|
||||
|
||||
# FIXME CISCOSPECIFIC
|
||||
$rrd_create .= " DS:PortPwrAllocated:GAUGE:600:0:U";
|
||||
$rrd_create .= " DS:PortPwrAvailable:GAUGE:600:0:U";
|
||||
$rrd_create .= " DS:PortConsumption:DERIVE:600:0:U";
|
||||
$rrd_create .= " DS:PortMaxPwrDrawn:GAUGE:600:0:U ";
|
||||
|
||||
shell_exec($rrd_create);*/
|
||||
}
|
||||
|
||||
$upd = "$polled:".$port['cpeExtPsePortPwrAllocated'].":".$port['cpeExtPsePortPwrAvailable'].":".$port['cpeExtPsePortPwrConsumption'].":".$port['cpeExtPsePortMaxPwrDrawn'];
|
||||
$ret = rrdtool_update("$rrdfile", $upd);
|
||||
|
||||
echo("PoE ");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user