启用wsadmin控制台帮助

时间:2014-04-11 16:43:57

标签: websphere-7 wsadmin

我启用了Websphere中的“日志命令辅助命令”选项>控制台偏好。 文档说明如下: 指定是否将所有命令帮助wsadmin数据记录到文件中。此文件保存到$ {LOG_ROOT} / server / commandAssistanceJythonCommands_user name.log: server是控制台运行的服务器进程,例如server1或adminagent。 server是控制台运行的服务器进程,例如dmgr,server1,adminagent或jobmgr。 用户名是管理控制台用户名。 使用管理代理管理配置文件时,命令帮助日志将放在管理代理管理的配置文件的位置。 $ {LOG_ROOT}变量定义配置文件位置。

我无法找到LOG_ROOT的默认值。

1 个答案:

答案 0 :(得分:0)

LOG_ROOT的实际值取决于其他变量的值。变量在AdminConsole中定义 - >环境 - > WebSphere变量。因为变量存在于不同的范围(单元,节点,集群,服务器),所以找到实际值可能有点棘手。最终的解决方案是使用wsadmin和AdminOperations.expandVariable操作。

对于ND环境:

adminOperations = AdminControl.queryNames('WebSphere:*,type=AdminOperations,process=dmgr').splitlines()[0]
print AdminControl.invoke(adminOperations, 'expandVariable', ['${LOG_ROOT}/commandAssistance_ssdimmanuel.log'])

对于独立的WAS(假设服务器名称为' server1'):

adminOperations = AdminControl.queryNames('WebSphere:*,type=AdminOperations,process=server1').splitlines()[0]
print AdminControl.invoke(adminOperations, 'expandVariable', ['${LOG_ROOT}/commandAssistance_ssdimmanuel.log'])

广告模式

使用WDR库(http://wdr.github.io/WDR/),您只需一行即可完成:

对于ND:

print getMBean1(type='AdminOperations', process='dmgr').expandVariable('${LOG_ROOT}/commandAssistance_ssdimmanuel.log')

对于独立的WAS:

print getMBean1(type='AdminOperations', process='server1').expandVariable('${LOG_ROOT}/commandAssistance_ssdimmanuel.log')
相关问题