Create health monitor using iControl API
I'm trying to create a health monitor for my pool using iControl API. I was able to create a monitor template using the code below but I cannot figure out how to set 'Send String' and 'Receive String' properties.
Also, I don't understand what is the purpose of passing the common attributes. The below code just create a health monitor and doesn't assign it to the specified node.
$template = New-Object -TypeName iControl.LocalLBMonitorMonitorTemplate $template.template_name = $templateName $template.template_type = [iControl.LocalLBMonitorTemplateType]::TTYPE_HTTP
$templateAttributes = New-Object -TypeName iControl.LocalLBMonitorCommonAttributes $templateAttributes.parent_template = "http" $templateAttributes.dest_ipport = New-Object -TypeName iControl.LocalLBMonitorIPPort $templateAttributes.dest_ipport.address_type = [iControl.LocalLBAddressType]:: ATYPE_EXPLICIT_ADDRESS_EXPLICIT_PORT $templateAttributes.dest_ipport.ipport = Get-Node -address "10.10.10.10" -port "80"
(Get-F5.iControl).LocalLBMonitor.create_template((, $template), (, $templateAttributes))