python脚本获取weblogic信息

请问怎么使用python脚本获取到weblogic的端口、版本号、安装目录、域名称和该节点IP

在确保连接到WebLogic服务器,并使用相应的用户名和密码的前提下

from wlstmodule import WLST

wls = WLST("t3://<host>:<port>")
wls.connect("<username>", "<password>")

# 获取端口
listen_port = wls.getListenPort()
print("Listen Port: ", listen_port)

# 获取版本号
version = wls.getVersion()
print("Version: ", version)

# 获取安装目录
install_dir = wls.getInstallDir()
print("Installation Directory: ", install_dir)

# 获取域名称
domain_name = wls.getDomainName()
print("Domain Name: ", domain_name)

# 获取节点IP
node_manager_ip = wls.getNodeManagerIp()
print("Node Manager IP: ", node_manager_ip)

wls.disconnect()