As you probably know, you can monitor the favicon.ico on your UAG with a load balancer to determine if a UAG is up or down (or in quiesce mode). You can also utilize PowerShell’s Invoke-WebRequest commandlet to not only monitor for the UAG health, but also send an email alert via a SMTP server if a UAG is considered unhealthy or in quiesce mode. Just set the top variables as required! Setting this up as a scheduled task allows for automated monitoring and alerts of your UAG appliances.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
##### VARIABLES #####
$uaglist = "UAG1","UAG2","UAG3"
$smtpserver = "SMTP FQDN HERE"
$fromemail = "UAG Alerts <[email protected]>"
$emaillist = "[email protected]"
$emailsubject = "UAG Monitor Alert"
$emailbody = "appears to be unhealthy or in quiesce mode!"

#### END VARIABLES ####

foreach ($uag in $uaglist)
{
try
    {
    Invoke-WebRequest -UseBasicParsing $uag/favicon.ico
    }
Catch
    {
    Write-Host "$uag is down! Sending email alert..."
    Send-MailMessage -from $fromemail -to $emaillist -Subject $emailsubject -Body "$uag $emailbody" -SmtpServer $smtpserver
    }
}