Forum Discussion
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com