You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2014-04-28 11:32:24

fledorze
Member
Registered: 2007-07-03
Posts: 69

Bugs in Shellcommands 1.6 under GLPI 0.86

It seems that two bugs cancel themselves in  front/massiveexec.php

......
   if ($plugin_shellcommands_shellcommands_id == "Ping") {
      $host = $item->getField('name');
      echo "<p><b>".$item->getField('name')."</b></p>";
     if ($itemtype != 'NetworkEquipement') {
....

It should be 'NetworkEquipment' instead 'NetworkEquipement'. That's why the code below is never executed :

 } else {
         $host = $item->getField('ip');
         $command = $path." ".$parameters." ".$host;
         $ouput[] = null;
         echo "<p><b>$plugin_shellcommands_shellcommands_id -> ".$host."</b>";
         exec($command, $ouput);
         $cmd = count($ouput);
         echo " <font color=blue>";
         for ($i = 0; $i < $cmd; $i++) {
            echo Toolbox::encodeInUtf8($ouput[$i])."<br>";
         }
         echo "</font>";
         echo "</p>".$command;
      }

Hopefully, because if you fix the item type text, this code does not work. I get :

Ping -> N/A
/bin/ping -c 4 N/A

because  $item->getField('ip') is not set, because, it suppose, there no more IP address in main table of network equipments, every IPs are managed in network ports.


GLPI 10.0.6 with GLPI Inventory 1.1.0 on Debian bullseye

Offline

Board footer

Powered by FluxBB