获取远程计算机上的远程 Web 逻辑服务器的状态



我们的项目在安装了远程机器的web逻辑服务器(10.3.6)上运行,我们需要使用一些自动脚本从本地台式计算机/笔记本电脑检查该服务器和相关(节点管理器,管理服务器,数据源)的状态,然后在自动生成的电子邮件中发送该报告。虽然可以在网络逻辑中启用监视或通知,但我们需要自定义报告。第二个要求是将 Web 逻辑服务器的域日志和我们的应用程序日志重定向到其他机器,以将它们作为实时日志进行跟踪,也就是说,如果我们的应用程序用户在应用程序中执行某些操作,那么这些日志需要重定向到另一台机器,用户可以将其作为实时日志查看。

我对 web(-logic) 服务器很陌生,所以我想知道我们的要求是否可以实现?

您可以使用新的 REST API 或旧的 JMX API 来自动监视服务器 (https://docs.oracle.com/middleware/1213/wls/NOTES/whatsnew.htm#NOTES353)。

就重定向日志而言,我在WebLogic中使用logstash(http://logstash.net/)有很好的经验。

您可以编写 WLST 脚本来监视服务器状态,如下所示:

connect("username","password","t3://localhost:8001")
# First enable the Administration Port. This is Not a requirement.
edit()
startEdit()
cmo.setAdministrationPortEnabled(1)
activate(block="true")
# check the state of the server
state("myserver")
# now move the server from RUNNING state to ADMIN
suspend("myserver", block="true")
# check the state
state("myserver")
# now resume the server to RUNNING state
resume("myserver",block="true")
# check the state
state("myserver")
# now take a thread dump of the server
threadDump("./dumps/threadDumpAdminServer.txt")
# finally shutdown the server
shutdown(block="true")

至于你的第二个问题。为什么不编辑Servers -> <server name> -> Logging设置以将文件输出到远程服务器可以看到的共享区域?

最新更新