# Powershell Node Health Monitor

**URL:** <https://community.f5.com/t/powershell-node-health-monitor/1658>\
**Category:** Technical Forums\
**Tags:** sap\
**Created:** [August 21, 2013, 6:08pm UTC](https://community.f5.com/t/powershell-node-health-monitor/1658 "2013-08-21T18:08:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Curl\_105786](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@Joe\_Curl\_105786](https://community.f5.com/u/Joe_Curl_105786)\
**Post date:** [August 21, 2013, 6:08pm UTC](https://community.f5.com/t/powershell-node-health-monitor/1658/1 "2013-08-21T18:08:45Z")

</div>

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) )

---

<div class="post-metadata">

**Author:** ![JRahm](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/jrahm/32/3327_2.png) [@JRahm](https://community.f5.com/u/JRahm)\
**Post date:** [August 21, 2013, 9:15pm UTC](https://community.f5.com/t/powershell-node-health-monitor/1658/2 "2013-08-21T21:15:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![spencero\_196690](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@spencero\_196690](https://community.f5.com/u/spencero_196690)\
**Post date:** [November 15, 2016, 6:55pm UTC](https://community.f5.com/t/powershell-node-health-monitor/1658/3 "2016-11-15T18:55:39Z")

</div>

See [DevCentral - An F5 Technical Community](https://devcentral.f5.com/questions/set-existing-monitor-on-existing-node-in-powershell-f5-big-ip)

```tcl
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)

```
