浏览代码

Se suman métricas al mongo, consumo de cm y estado de cm.

Maxi Schvindt 7 年之前
父节点
当前提交
b9e52a8a7d
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 0 2
      Command/CmtsCmScanCommand.php
  2. 5 3
      Command/CmtsInterfaceStatsCommand.php

+ 0 - 2
Command/CmtsCmScanCommand.php

@@ -46,8 +46,6 @@ class CmtsCmScanCommand extends BaseCmtsCommand
 
         $dataCached = array();
         $countCms = 0;
-
-        
         
         $macs = $this->getSNMP("docsIfCmtsCmStatusMacAddress","cmMac");
         $ips = $this->getSNMP("docsIfCmtsCmStatusIpAddress","cmIp");

+ 5 - 3
Command/CmtsInterfaceStatsCommand.php

@@ -57,7 +57,7 @@ class CmtsInterfaceStatsCommand extends BaseCmtsCommand
         
         
         $_utilization = $this->getSNMP("docsIfCmtsChannelUtilization","cmtsIfUtilization");
-        $utilization = array();
+        $ifStatsCached = $sendData = $utilization = array();
 
         foreach($_utilization as $compIndex => $value) {
             $params = explode(".",$compIndex);
@@ -78,6 +78,7 @@ class CmtsInterfaceStatsCommand extends BaseCmtsCommand
         
         $cmCached = $this->getData($key_cm_scan, true);
         $states = array();
+        
         if(empty($cmCached)) {
             $this->output->writeln("Se requiere {$key_cm_scan} para obtener cantidad de CM por Interface.");
         } else {
@@ -91,11 +92,12 @@ class CmtsInterfaceStatsCommand extends BaseCmtsCommand
 
                 $states[$up][$state]++;
                 $states[$down][$state]++;
+
+                $mac = strtolower($value['mac']);
+                $sendData["cm_status_{$mac}"] = "{$state}|g";
             }
         }
 
-        $ifStatsCached = $sendData = array();
-
         $subId = $this->d_s;
         $metrics = array("utilization" => "{$subId}_if_utilization_", "microreflection" => "{$subId}_if_microreflection_", "signal" => "{$subId}_if_signal_", "states" => "{$subId}_if_state_");
         $countIfs = 0;