|
@@ -2,6 +2,8 @@
|
|
# bin/console cmts:cm:stats --cmts-device-id=14 --cmts-server-id=1 --cm-ip=10.42.0.27 --cm-mac=00237406d524 --cm-community=public
|
|
# bin/console cmts:cm:stats --cmts-device-id=14 --cmts-server-id=1 --cm-ip=10.42.0.27 --cm-mac=00237406d524 --cm-community=public
|
|
# http://200.50.168.115/Provisioning/admin/cablemodem/00237406d524
|
|
# http://200.50.168.115/Provisioning/admin/cablemodem/00237406d524
|
|
|
|
|
|
|
|
+# bin/console cmts:cm:stats --cmts-device-id=14 --cmts-server-id=1 --cm-ip=10.42.0.27 --cm-mac=0011e3039a4a --cm-community=public
|
|
|
|
+
|
|
namespace CmtsBundle\Command;
|
|
namespace CmtsBundle\Command;
|
|
|
|
|
|
use BaseStatsBundle\Command\BaseCmCommand;
|
|
use BaseStatsBundle\Command\BaseCmCommand;
|
|
@@ -46,13 +48,27 @@ class CmtsCmStatsCommand extends BaseCmCommand
|
|
$inicio = microtime(true);
|
|
$inicio = microtime(true);
|
|
|
|
|
|
$SNMP = new SNMP($this->cmIp, $this->cmCommunity);
|
|
$SNMP = new SNMP($this->cmIp, $this->cmCommunity);
|
|
- $SNMP->setTimeout(5000000); // 5 seconds of timeout
|
|
|
|
|
|
+ $SNMP->setTimeout(2500000); // 2.5 seconds of timeout
|
|
$SNMP->setRetry(1); // 1 query per metric
|
|
$SNMP->setRetry(1); // 1 query per metric
|
|
$library = "use".$this->cmSnmpLibrary;
|
|
$library = "use".$this->cmSnmpLibrary;
|
|
$this->apiSNMP = $SNMP->$library();
|
|
$this->apiSNMP = $SNMP->$library();
|
|
|
|
|
|
|
|
+ $uptime = $this->getSNMP("sysUpTimeInstance","cmUptime");
|
|
|
|
+ if(!$uptime) $SNMP->setTimeout(1000000); // 1 seconds of timeout
|
|
|
|
+
|
|
$txPower = $this->getSNMP("docsIfCmStatusTxPower","cmTxPower");
|
|
$txPower = $this->getSNMP("docsIfCmStatusTxPower","cmTxPower");
|
|
|
|
+ if($txPower) $SNMP->setTimeout(2500000);
|
|
|
|
+
|
|
$rxPower = $this->getSNMP("docsIfDownChannelPower","cmRxPower");
|
|
$rxPower = $this->getSNMP("docsIfDownChannelPower","cmRxPower");
|
|
|
|
+
|
|
|
|
+ if(!$txPower && !$rxPower) {
|
|
|
|
+ $this->removeLock($this->flag);
|
|
|
|
+ $fin = microtime(true);
|
|
|
|
+ $time = $fin - $inicio;
|
|
|
|
+ $this->output->writeln("CM no responde uptime, tx y rx => cortamos! Tiempo: $time segundos");
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
$signal = $this->getSNMP("docsIfSigQSignalNoise","cmSignal");
|
|
$signal = $this->getSNMP("docsIfSigQSignalNoise","cmSignal");
|
|
$microreflection = $this->getSNMP("docsIfSigQMicroreflections","cmMicroreflection");
|
|
$microreflection = $this->getSNMP("docsIfSigQMicroreflections","cmMicroreflection");
|
|
$unerroreds = $this->getSNMP("docsIfSigQUnerroreds","cmUnerroreds");
|
|
$unerroreds = $this->getSNMP("docsIfSigQUnerroreds","cmUnerroreds");
|
|
@@ -81,6 +97,11 @@ class CmtsCmStatsCommand extends BaseCmCommand
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if($uptime) {
|
|
|
|
+ foreach($uptime as $oid => $value) {
|
|
|
|
+ $data['uptime'] = $value;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
$this->hset($key_cm_stats, $this->cmMac, $data, true);
|
|
$this->hset($key_cm_stats, $this->cmMac, $data, true);
|
|
|
|
|
|
@@ -92,7 +113,7 @@ class CmtsCmStatsCommand extends BaseCmCommand
|
|
$statsdService->send($sendData);
|
|
$statsdService->send($sendData);
|
|
$t_end_script = microtime(true);
|
|
$t_end_script = microtime(true);
|
|
$time = $t_end_script - $t_start_script;
|
|
$time = $t_end_script - $t_start_script;
|
|
- print_r("Tiempo de envío al StatsD: {$time} ms / Cantidad: ".count($sendData).PHP_EOL);
|
|
|
|
|
|
+ $this->output->writeln("Tiempo de envío al StatsD: {$time} ms / Cantidad: ".count($sendData));
|
|
}
|
|
}
|
|
|
|
|
|
/* End Of Blockout */
|
|
/* End Of Blockout */
|