Forum Discussion
Powershell Node Health Monitor
We are working on our first Powershell script to deploy our applications to LTM's. We have been able to create nodes, but we use a specific node level health monitor. We have not been able to figure out how when we create the node to also apply this specific monitor at the same time. Below is the code we are using to add our nodes.
Joe
(Get-F5.iControl).LocalLBNodeAddress.create( (,$newnode), (,0) )
2 Replies
- JRahm
Admin
should use nodeaddressv2 if on v11+, nodeaddress is deprecated beginning in v11.
You need to use the set_monitor_rule method after the node is created, the create method doesn't support setting the monitor in the same call.
- spencero_196690
Nimbostratus
See https://devcentral.f5.com/questions/set-existing-monitor-on-existing-node-in-powershell-f5-big-ip
Write-Host "Adding F5 Health Checks $HealthMonitors" $MonitorRule = New-Object -TypeName iControl.LocalLBMonitorRule $MonitorRule.type = "MONITOR_RULE_TYPE_SINGLE" $MonitorRule.monitor_templates = $HealthMonitors (Get-F5.iControl).LocalLBNodeAddressV2.set_monitor_rule(@($VMIP), $HealthMonitors)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com