# system.device.getDeviceHostname?

**URL:** <https://forum.inductiveautomation.com/t/system-device-getdevicehostname/12460>\
**Category:** Ignition\
**Created:** [December 12, 2016, 11:09pm UTC](https://forum.inductiveautomation.com/t/system-device-getdevicehostname/12460 "2016-12-12T23:09:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JMcguigan](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JMcguigan](https://forum.inductiveautomation.com/u/JMcguigan)\
**Post date:** [December 12, 2016, 11:09pm UTC](https://forum.inductiveautomation.com/t/system-device-getdevicehostname/12460/1 "2016-12-12T23:09:53Z")

</div>

I am looking for a way to get a list of the IP addresses of devices configured on the gateway. I know I can use system.device.listDevices to get the gateway connection status of each device which returns a dataset of the device names, enabled status’, connection status’, and driver names. And I know there is system.device.setDeviceHostname which would allow setting the IP address of a given device from scripting.

I am looking for something like a system.device.getDeviceHostname, which as far as I can tell does not exist. Is there any way to get this information from the scripting environment?

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [December 13, 2016, 12:41am UTC](https://forum.inductiveautomation.com/t/system-device-getdevicehostname/12460/2 "2016-12-13T00:41:58Z")

</div>

If you browse to your device with the OPC Browser you will see that it contains a Diagnostics folder. Within the Diagnostics folder is a tag that contains the hostname. You can drag this tag into the Tag Browser and then read the value in your script with the system.tag.read() function.

---

<div class="post-metadata">

**Author:** ![JMcguigan](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JMcguigan](https://forum.inductiveautomation.com/u/JMcguigan)\
**Post date:** [December 16, 2016, 4:39pm UTC](https://forum.inductiveautomation.com/t/system-device-getdevicehostname/12460/3 "2016-12-16T16:39:29Z")

</div>

That worked out great.

Thanks for the suggestion Greg!
