Browse Source

Se añade entidad con descripción de interfaces.

Maxi Schvindt 7 years ago
parent
commit
77e1b78caa

+ 8 - 4
src/StatsBundle/Command/GenerateCrontabCommand.php

@@ -31,6 +31,9 @@ class GenerateCrontabCommand extends ContainerAwareCommand
     protected function execute(InputInterface $input, OutputInterface $output)
     {
 
+        $now = date("d-m-Y H:i:s");
+        $content = PHP_EOL . "# NO EDITAR este archivo, se autogenera con el comando stats:crontab:remote. Generado {$now}." . PHP_EOL;
+        
         $fileCrontab = $input->getOption('file-crontab');
         $pathApp = $input->getOption('path-app');
 
@@ -186,16 +189,17 @@ class GenerateCrontabCommand extends ContainerAwareCommand
 
                 $params = "--cmts-ip={$deviceIp} --cmts-community={$snmpCommunity} --cmts-snmp-library={$library} --cmts-device-id={$deviceId} --cmts-server-id={$serverId}";
                 
-                $commands[] = "*/{$timeScan} * * * * {$pathConsole} {$amqpRemote} {$routing_key} cmts:cm:scan {$params}";
-                $commands[] = "*/{$timeScan} * * * * {$pathConsole} {$amqpRemote} {$routing_key} cmts:interface:scan {$params}";
+                $commands[] = "*/{$timeScan} * * * * {$pathConsole} cmts:cm:scan {$params}";
+                $commands[] = "*/{$timeScan} * * * * {$pathConsole} cmts:interface:scan {$params}";
                 
                 $params .= " --save-historic={$saveHistoric}";
                 
-                $commands[] = "*/{$timeScan} * * * * {$pathConsole} {$amqpRemote} {$routing_key} cmts:interface:stats {$params}";
+                $commands[] = "*/{$timeScan} * * * * {$pathConsole} cmts:interface:stats {$params}";
+                $commands[] = "*/{$timeScan} * * * * {$pathConsole} cmts:interface:description {$params}";
                 
                 $params = "--cmts-device-id={$deviceId} --cmts-server-id={$serverId}";
 
-                $commands[] = "*/{$timeScan} * * * * {$pathConsole} {$amqpRemote} {$routing_key} stats:interface {$params}";
+                $commands[] = "*/{$timeScan} * * * * {$pathConsole} stats:interface {$params}";
                 
                 fwrite($handle, PHP_EOL.PHP_EOL."# CMTS {$description} ({$deviceIp})".PHP_EOL);
                 fwrite($handle, PHP_EOL);

+ 1 - 0
src/StatsBundle/Command/GenerateRemoteCrontabCommand.php

@@ -249,6 +249,7 @@ class GenerateRemoteCrontabCommand extends ContainerAwareCommand
                 }
                 
                 $commands[] = "*/{$timeScan} * * * * {$pathConsole} {$amqpRemote} {$routing_key} cmts:interface:stats {$params}";
+                $commands[] = "*/{$timeScan} * * * * {$pathConsole} {$amqpRemote} {$routing_key} cmts:interface:description {$params}";
                 
                 if ($amqp) {
                     $params .= " --args=--cmts-docs:{$docsVersion}";

+ 207 - 0
src/StatsBundle/Entity/CmtsInterfaceDescription.php

@@ -0,0 +1,207 @@
+<?php
+
+namespace StatsBundle\Entity;
+
+use Doctrine\ORM\Mapping as ORM;
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
+use ExtraDataBundle\Entity\Traits\ExtraDataTrait;
+use Symfony\Component\Validator\Constraints as Assert;
+
+/**
+ * @ORM\Table
+ * @ORM\Entity
+ * @UniqueEntity(fields={"server", "cmtsDeviceId", "index"}, message="errors.duplicate_key")
+ * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="unique_idx", columns={"server_id", "cmts_device_id", "index"})})
+ */
+class CmtsInterfaceDescription
+{
+
+    use ExtraDataTrait;
+
+    /**
+     * @var int
+     *
+     * @ORM\Column(name="id", type="integer")
+     * @ORM\Id
+     * @ORM\GeneratedValue(strategy="AUTO")
+     */
+    private $id;
+
+    /**
+     * @var int
+     *
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    private $cmtsDeviceId;
+
+    /**
+     * @ORM\ManyToOne(targetEntity="DeviceServer", fetch="EXTRA_LAZY")
+     */
+    protected $server;
+
+    /**
+     * @ORM\Column(type="datetime")
+     */
+    protected $updated;
+
+    /**
+     * @var int
+     *
+     * @ORM\Column(type="integer", nullable=false)
+     */
+    private $index;
+    
+    /**
+     * @var string
+     *
+     * @ORM\Column(type="string", length=250, nullable=true)
+     */
+    private $name;
+
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifType;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifMtu;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifSpeed;
+    
+    /**
+     * @ORM\Column(type="string", length=250, nullable=true)
+     */
+    public $ifPhysAddress;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifAdminStatus;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifOperStatus;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifLastChange;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifInOctets;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifInUcastPkts;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifInNUcastPkts;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifInDiscards;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifInErrors;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifInUnknownProtos;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifOutOctets;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifOutUcastPkts;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifOutNUcastPkts;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifOutDiscards;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifOutErrors;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifOutQLen;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $ifSpecific;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $docsIfSigQIncludesContention;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $docsIfSigQUnerroreds;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $docsIfSigQCorrecteds;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $docsIfSigQUncorrectables;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $docsIfSigQExtUnerroreds;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $docsIfSigQExtCorrecteds;
+    
+    /**
+     * @ORM\Column(type="integer", nullable=true)
+     */
+    public $docsIfSigQExtUncorrectables;
+    
+    /**
+     * @ORM\Column(type="decimal", precision=9, scale=6, nullable=true)
+     */
+    public $cer;
+    
+    
+
+
+    
+    
+    
+}