Browse Source

Agregue info cuando se ignora un device

Luciano Andrade 7 years ago
parent
commit
615bfd01e2
1 changed files with 9 additions and 4 deletions
  1. 9 4
      src/StatsBundle/Command/GenerateRemoteCrontabCommand.php

+ 9 - 4
src/StatsBundle/Command/GenerateRemoteCrontabCommand.php

@@ -95,14 +95,19 @@ class GenerateRemoteCrontabCommand extends ContainerAwareCommand
                 $commands = array();
                 $data = $device->jsonExtraData();
 
-                if ($data['executeSnmp'] == 0)
+                if ($data['executeSnmp'] == 0){
+		    $content .= PHP_EOL . PHP_EOL . "# Device {$deviceId} skiped, executeSnmp is 0" . PHP_EOL;
                     continue;
-
-                if (!in_array($data['mark'], $oltMarks))
+		}
+                if (!in_array($data['mark'], $oltMarks)){
+		    $content .= PHP_EOL . PHP_EOL . "# Device {$deviceId} skiped, mark is not one of " . implode(", ", $oltMarks). PHP_EOL;
                     continue;
+		}
 
-                if (!in_array($data['library'], $oltLibraries))
+                if (!in_array($data['library'], $oltLibraries)){
+		    $content .= PHP_EOL . PHP_EOL . "# Device {$deviceId} skiped, library is not one of " . implode(", ", $oltLibraries). PHP_EOL;
                     continue;
+		}
 
                 $oltName = $data['name'];
                 $mark = strtolower($data['mark']);