|
@@ -49,6 +49,7 @@ class FiberhomeOnuTemperatureCommand extends BaseCommand
|
|
|
|
|
|
$flag = "olt_onus_temperature_d_{$oltDeviceId}_s_{$oltServerId}.lock";
|
|
|
$key_olt_scan = "olt_scan_d_{$oltDeviceId}_s_{$oltServerId}";
|
|
|
+ $key_onu_temperature = "onu_temperature_d_{$oltDeviceId}_s_{$oltServerId}";
|
|
|
|
|
|
/* Control de bloqueo */
|
|
|
if($this->lock($flag)) {return;}
|
|
@@ -57,6 +58,7 @@ class FiberhomeOnuTemperatureCommand extends BaseCommand
|
|
|
$library = "use".$oltSnmpLibrary;
|
|
|
|
|
|
$dataCached = $this->getData($key_olt_scan, true);
|
|
|
+ $temperatureCached = array(); //$this->getData($key_onu_temperature, true);
|
|
|
|
|
|
if(empty($dataCached)) {
|
|
|
$this->output->writeln("Se requiere {$key_olt_scan}.");
|
|
@@ -72,14 +74,18 @@ class FiberhomeOnuTemperatureCommand extends BaseCommand
|
|
|
foreach($temperature as $index => $temp) {
|
|
|
if(isset($dataCached[$index])) {
|
|
|
$value = 0.01 * $temp;
|
|
|
- $sn = $dataCached[$index]['serialNumber'];
|
|
|
+ $sn = strtolower($dataCached[$index]['serialNumber']);
|
|
|
$k = $metric.strtolower($sn);
|
|
|
//print_r("$line - $index - $k - $value".PHP_EOL);
|
|
|
$sendData[$k] = "{$value}|g";
|
|
|
$line++;
|
|
|
+
|
|
|
+ $temperatureCached[$sn] = $value;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ $this->setData($key_onu_temperature, $temperatureCached, true);
|
|
|
+
|
|
|
if($sendData) {
|
|
|
$t_start_script = microtime(true);
|
|
|
$statsdService = $this->getContainer()->get('statsd');
|