Example #1
0
            $memcache->set($key, $active_lb, 0, 7200);
        }
        $key = "f5-pool-list";
        $pool_list = $memcache->get($key);
        if ($pool_list === false) {
            $client = new SoapClient("https://" . $active_lb . $wsdl_pool_suffix, array('location' => "https://" . $active_lb . $location_suffix, 'login' => $username, 'password' => $password));
            /* Get a list of all pools */
            $pool_list = $client->get_list();
            $memcache->set($key, $pool_list, 0, 28800);
        }
    }
} else {
    $active_lb = f5_active_server($loadbalancers, $username, $password);
    $client = new SoapClient("https://" . $active_lb . $wsdl_pool_suffix, array('location' => "https://" . $active_lb . $location_suffix, 'login' => $username, 'password' => $password));
    /* Get a list of all pools */
    $pool_list = $client->get_list();
}
/* Loop through the instances array */
foreach ($pool_list as $key => $value) {
    if (isset($_GET['pool_name']) && $_GET['pool_name'] == $value) {
        echo "<option value=\"" . $value . "\" selected>" . $value . "</option>\n";
    } else {
        echo "<option value=\"" . $value . "\">" . $value . "</option>\n";
    }
}
print '</select></form> Active Server: ' . $active_lb . "<p>";
if (isset($_GET['pool_name'])) {
    if (!in_array($_GET['pool_name'], $pool_list)) {
        print "<font color=red>You have supplied an invalid pool name. Exiting...</font>";
        exit(1);
    }