Forum Discussion
Joel_Newton
Jan 18, 2016Cirrus
This can also be done via the REST API:
Create your credential object
$username = "myusername"
$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
$f5device = "mydevicename"
$mycreds = New-Object System.Management.Automation.PSCredential ($username, $secpasswd)
Set the value of the failover page and query it
$FailoverPage = "https://$f5device/mgmt/tm/cm/failover-status"
$FailoverJSON = Invoke-RestMethod -Method Get -Uri $FailoverPage -Credential $mycreds
This is where the failover status is indicated
$FailoverJSON.entries.'https://localhost/mgmt/tm/cm/failover-status/0'.nestedStats.entries.status.description