# \[feature-14304\]Making system.util.retarget() Failover Aware

**URL:** <https://forum.inductiveautomation.com/t/feature-14304-making-system-util-retarget-failover-aware/26109>\
**Category:** Ignition\
**Created:** [June 26, 2019, 4:12pm UTC](https://forum.inductiveautomation.com/t/feature-14304-making-system-util-retarget-failover-aware/26109 "2019-06-26T16:12:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![namesdontmatter](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@namesdontmatter](https://forum.inductiveautomation.com/u/namesdontmatter)\
**Post date:** [June 26, 2019, 4:12pm UTC](https://forum.inductiveautomation.com/t/feature-14304-making-system-util-retarget-failover-aware/26109/1 "2019-06-26T16:12:21Z")

</div>

What would be the best way to have system.util.retarget() check if the IP address is up before retargetting, and then if the server is on its failover, then retarget to the failover server instead?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 26, 2019, 4:22pm UTC](https://forum.inductiveautomation.com/t/feature-14304-making-system-util-retarget-failover-aware/26109/2 "2019-06-26T16:22:18Z")

</div>

httpGet `http://address:port/system/gwinfo` (if 7.9 or earlier, `http://address:port/main/system/gwinfo`) and parse the response info for the redundancy information/backup addresses.

---

<div class="post-metadata">

**Author:** ![namesdontmatter](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@namesdontmatter](https://forum.inductiveautomation.com/u/namesdontmatter)\
**Post date:** [June 26, 2019, 4:48pm UTC](https://forum.inductiveautomation.com/t/feature-14304-making-system-util-retarget-failover-aware/26109/3 "2019-06-26T16:48:10Z")

</div>

Would something simple like this work?

```auto
primaryurl = "http://10.XX.XX.XX:8088/main/"

secondaryurl = "http://10.XX.XX.XX:8088/main/"

try:

system.util.retarget("Main", primaryurl)

except:

system.util.retarget("Main", secondaryurl)

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 26, 2019, 4:49pm UTC](https://forum.inductiveautomation.com/t/feature-14304-making-system-util-retarget-failover-aware/26109/4 "2019-06-26T16:49:54Z")

</div>

Retarget won’t throw an exception back, I’m pretty confident - it will kick off the mechanism to retarget, then leave the client in a broken state. You’ll have to proactively check that the client is there. Normally our backup/failover is transparent, but retargetting has no way to know that it needs to ask for backup addresses. I can add a feature request to see if maybe we could extend `retarget` to allow a list of addresses, which will be attempted in order.

---

<div class="post-metadata">

**Author:** ![namesdontmatter](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@namesdontmatter](https://forum.inductiveautomation.com/u/namesdontmatter)\
**Post date:** [June 26, 2019, 4:52pm UTC](https://forum.inductiveautomation.com/t/feature-14304-making-system-util-retarget-failover-aware/26109/5 "2019-06-26T16:52:22Z")

</div>

That sounds like a better approach. httpGet should throw an exception.
