Forum Discussion

Sridhar_111831's avatar
Sridhar_111831
Icon for Nimbostratus rankNimbostratus
Mar 06, 2014

Unable to make LocalLB.VirtualServer get_default_pool_name work

All,

 

New to icontrol and php - pardon my knowledge. Writing a php to get VS , Pool Name and Status of VS. Im able to pull the status of VS and VS Name. However, the pool name would not load and comes up blank. I also see the error - Trying to get property of non-object in /var/www/html/learn/test.php

 

Any advise?

 

Code -

 

$vs_list=$client->get_list();
   sort($vs_list);
   $vsstatus=$client->get_object_status($vs_list);
   $poollist=$client->get_default_pool_name($vs_list);

     .............................

      foreach ($vs_list as $index=>$vs)
      {
         $pool_name=$poollist[$index]->pool_name;
         $availability_status=$vsstatus[$index]->availability_status;
         $img = getgif($availability_status);
        echo "";
        echo "$vs";
        echo "$pool_name";
        echo "";
        echo "";
      }

-Sridhar

 

1 Reply

  • Hi!

    Hi!

    Never used php, but in powershell I've done it about the same as your example above:

    $virtualserverlist = $f5.LocalLBVirtualServer.get_list()
    $virtualserverdefaultpoollist = $f5.LocalLBVirtualServer.get_default_pool_name($virtualserverlist)
    

    The default pool would be blank if there is no default pool too (pools can be chosen purely via iRules or HTTP classes).

    /Patrik