Is there a way to read the Zoo server IP with Python?

I have a scenario where I have scripts to run at all 3 of our locations, but they need to be unique to each location. Each of our locations has it’s own Zoo server handing out the Rhino licenses. I tried to look at the different drives mapped at each location to determine where the script is being run, but drives often don’t connect after a reboot. So that is unreliable. It does work well if the drives feel like connecting, but as you can see here, it’s hit and miss:

image

So I thought maybe if I could read the IP address (or server name would work too) of where the licenses are being handed out, then I could get my separation of locations.

Is this possible?

Thanks,

Dan

Not sure if this one was missed, or what I’m asking isn’t possible.

Basically, I want to determine the IP address or computer name of the server that contains the Zoo via a script.

Is this possible?

Thanks,

Dan

Hi @DanBayn,

RhinoCommon does not provide anything like this. You could probably write something. But it seems like there should be an easier way to detect the location of the system. Maybe?

import System
print(System.Environment.GetEnvironmentVariable('LOGONSERVER'))

– Dale

Thanks Dale. I’ll see what I can do with this.

Hi @dale,

That didn’t work, probably because we have a number of servers (it was returning the wrong one), but I did find a different solution that seems to be working well so far:

import socket
identity = socket.getfqdn()

This will return the user and domain name. Since all of our facilities have their own unique domain names it’s easy to separate locations. I will just do something like this with the results:

if "avgauge" in identity:
    do something
else:
   do something different

Thanks for your help. Although it wasn’t exactly the solution I needed, it did get me thinking in a different direction.

Dan