|
@@ -158,7 +158,7 @@ class HuaweiService
|
|
->setVoltage($voltage)
|
|
->setVoltage($voltage)
|
|
->setCatvRxPower($catvRxPower)
|
|
->setCatvRxPower($catvRxPower)
|
|
->setStatus($status)
|
|
->setStatus($status)
|
|
- ->setConsupmitionBranwidth($inOctets, $outOctets, $timeStart, $totalIn, $totalOut, $totalConsIn, $totalConsOut, $subId);
|
|
|
|
|
|
+ ->setConsupmitionBranwidth($inOctets, $outOctets, $timeStart, $totalIn, $totalOut, $totalConsIn, $totalConsOut);
|
|
}
|
|
}
|
|
|
|
|
|
foreach ($stats as $metric => $data) {
|
|
foreach ($stats as $metric => $data) {
|
|
@@ -280,10 +280,11 @@ class HuaweiService
|
|
return $this;
|
|
return $this;
|
|
}
|
|
}
|
|
|
|
|
|
- public function searchInformationsAboutOltAndSave($keyOltScanPons, $keyPonStats, $subId, $saveHistoric){
|
|
|
|
|
|
+ public function searchInformationsAboutOltAndSave($keyOltScanPons, $keyPonStats, $keyOltPonBanwidth, $subId, $saveHistoric){
|
|
$startCmd = microtime(true);
|
|
$startCmd = microtime(true);
|
|
|
|
|
|
$oltScanPonsCached = $this->redisHelper->getData($keyOltScanPons, true);
|
|
$oltScanPonsCached = $this->redisHelper->getData($keyOltScanPons, true);
|
|
|
|
+ $bandwidthCached = $this->redisHelper->getData($keyOltPonBanwidth, true);
|
|
if(!empty($oltScanPonsCached)){
|
|
if(!empty($oltScanPonsCached)){
|
|
//return [PONINDEX.ONUID] => value
|
|
//return [PONINDEX.ONUID] => value
|
|
$rxPower = $this->snmpService->getSNMP($this->snmpLibrary, "oltPonRxOpticalPower","ponRxPower", $this->output);
|
|
$rxPower = $this->snmpService->getSNMP($this->snmpLibrary, "oltPonRxOpticalPower","ponRxPower", $this->output);
|
|
@@ -292,11 +293,14 @@ class HuaweiService
|
|
$temperature = $this->snmpService->getSNMP($this->snmpLibrary, "oltPonOpticalTemperature","ponTemperature", $this->output);
|
|
$temperature = $this->snmpService->getSNMP($this->snmpLibrary, "oltPonOpticalTemperature","ponTemperature", $this->output);
|
|
$voltage = $this->snmpService->getSNMP($this->snmpLibrary, "oltPonOpticalVltage","ponVoltage", $this->output);
|
|
$voltage = $this->snmpService->getSNMP($this->snmpLibrary, "oltPonOpticalVltage","ponVoltage", $this->output);
|
|
$biasCurrent = $this->snmpService->getSNMP($this->snmpLibrary, "oltPonOpticalCurrent","ponBiasCurrent", $this->output);
|
|
$biasCurrent = $this->snmpService->getSNMP($this->snmpLibrary, "oltPonOpticalCurrent","ponBiasCurrent", $this->output);
|
|
|
|
+ $inOctets = $this->snmpService->getSNMP($this->snmpLibrary, "ifInOctets","portInOctets", $this->output);
|
|
|
|
+ $outOctets = $this->snmpService->getSNMP($this->snmpLibrary, "ifOutOctets","portOutOctets", $this->output);
|
|
|
|
|
|
$ponStatsCached = [];
|
|
$ponStatsCached = [];
|
|
$sendData = [];
|
|
$sendData = [];
|
|
-
|
|
|
|
$huaweiOltService = new HuaweiOltService($sendData);
|
|
$huaweiOltService = new HuaweiOltService($sendData);
|
|
|
|
+ $totalConsOut = $totalConsIn = $totalIn = $totalOut = 0;
|
|
|
|
+ $timeStart = time();
|
|
|
|
|
|
foreach ($oltScanPonsCached as $index => $pon){
|
|
foreach ($oltScanPonsCached as $index => $pon){
|
|
$ponPort = str_replace ('/','.',$pon['ponPort']);
|
|
$ponPort = str_replace ('/','.',$pon['ponPort']);
|
|
@@ -310,7 +314,8 @@ class HuaweiService
|
|
->setVoltageOrTxPower($txPower, $subId, "txPower", "_pon_tx_")
|
|
->setVoltageOrTxPower($txPower, $subId, "txPower", "_pon_tx_")
|
|
->setVoltageOrTxPower($voltage, $subId, "voltage", "_pon_voltage_")
|
|
->setVoltageOrTxPower($voltage, $subId, "voltage", "_pon_voltage_")
|
|
->setTemperatureOrBiasCurrent($temperature, $subId, "temperature", "_pon_temperature_")
|
|
->setTemperatureOrBiasCurrent($temperature, $subId, "temperature", "_pon_temperature_")
|
|
- ->setTemperatureOrBiasCurrent($biasCurrent, $subId, "biasCurrent", "_pon_biascurrent_");
|
|
|
|
|
|
+ ->setTemperatureOrBiasCurrent($biasCurrent, $subId, "biasCurrent", "_pon_biascurrent_")
|
|
|
|
+ ->setConsupmitionBranwidth($inOctets, $outOctets, $bandwidthCached, $timeStart, $totalIn, $totalOut, $totalConsOut, $totalConsOut, $subId);
|
|
|
|
|
|
$ponStatsCached[$index] = $stats;
|
|
$ponStatsCached[$index] = $stats;
|
|
}
|
|
}
|
|
@@ -326,6 +331,10 @@ class HuaweiService
|
|
$this->redisHelper->setData($keyPonStats, $ponStatsCached, true);
|
|
$this->redisHelper->setData($keyPonStats, $ponStatsCached, true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if($bandwidthCached) {
|
|
|
|
+ $this->redisHelper->setData($keyOltPonBanwidth, $bandwidthCached, true);
|
|
|
|
+ }
|
|
|
|
+
|
|
if($sendData && $saveHistoric) {
|
|
if($sendData && $saveHistoric) {
|
|
$timeStartScript = microtime(true);
|
|
$timeStartScript = microtime(true);
|
|
(new StatsDService())->send($sendData);
|
|
(new StatsDService())->send($sendData);
|