Get System Name in Client

What’s the best way to get the system name from the client? At the moment I’m doing an RPC request to the gateway and looking it up in the SystemPropertiesRecord from the internal DB.

I assume you mean “Gateway Name”? I am interested as well. I have used [System]Client/Network/GatewayAddress tag before, but that is not very reliable and can change over time in our environment.

Other way is scripting (I rely on this), but again, address not name and changes based on scope…

try:
	gateway = system.util.getGatewayAddress().lower()
except AttributeError:
	gateway = system.net.getHostName().lower()
1 Like

na this would be the system name under the gateway settings page. It doesn’t always quite match the computers host name.

@KathyApplebaum mentioned to me at ICC that a script function for this is in the works! Hopefully 7.9.5.

1 Like

Put the following in a function

from com.inductiveautomation.ignition.gateway import SRContext
context = SRContext.get()
return context.getSystemProperties().getSystemName()

Put this into an expression tag

runScript("the.script.without.parentheses",0)
1 Like

Thanks for the reminder to check in to that. A system tag for the Gateway name has indeed been added to 7.9.5. :+1:

1 Like