Problem this snippet solves:
This is a single PHP page which, when opened first shows a form in which the user enters the username, password and address, hit Submit and the script logs in to the device via iControl and shows virtual servers, pools, pool members and nodes along with state and connection numbers, etc.
Many thanks to the various contributors that I have stolen borrowed this from, especially Getting Started with iControl and PHP
iControl-PHP WAMP Server
Attached is a WAMP server with this file included - based on Uniform Server. To use this, download the zip file and extract to a relevant directory. - Click on Start.exe which creates a System Tray icon (blue with a white 1). - Left click on this and go to “Start UniServer (Apache MySQL)” at the top. - Then navigate to http://localhost and use the form. (Note that you can install this as a service by right-clicking on the icon and going to “Install and Run All Services”.
To stop the server, left-click on the icon and go to “Stop UniServer (Apache MySQL)”. To remove the System Tray icon, left-click and go to Exit
Code :
";
echo "<link rel="stylesheet" type="text/css" href="https://community.f5.com/t5/css/style.css" media="screen">";
echo "<link rel="icon" type="image/png" href="https://community.f5.com/t5/images/favicon.ico">";
$sn = $_SERVER['SCRIPT_NAME'];
echo "
";?> "; echo “”; echo "
LTM Device View
“; if ($message = “SOAP-ERROR: Parsing WSDL: Couldn’t load from 'https://”.$username.”:“.$password.”@“.$address.”/iControl/iControlPortal.cgi?WSDL=LocalLB.Pool’") { echo "
Error: There is an issue with connecting to this device
It could be because of "; echo “an issue with routing to the device, or with the username/password.”; echo "
- \n
- Check the IP address, username and password entries are correct"; echo "
- Check connectivity to the device using ping"; echo "
- Check that there are no firewalls in the way, or that they allow HTTPS on port 443"; echo "
- Check that the device has a functional license\n
"; echo “Home Page”; } else { echo "
Error: $message"; echo "
Home Page"; } } } if ($_SERVER[‘REQUEST_METHOD’] == ‘GET’) { echo “”; echo “”; echo “”; echo "
LTM Device View
"; echo “”; echo "
| Username: | |
|---|---|
| Password: | |
| Host IP address or name: | |
"; } ?>

