专业化管理 > 站点维护 > 使用 Java Management Extensions (JMX) > 使用 MBean 监视 Windchill Directory Server
  
使用 MBean 监视 Windchill Directory Server
要使用 MBean 监视 Windchill Directory Server,必须首先连接到 Windchill Directory Server MBean。
必须使用远程连接与任何计算机 (即使是 Windchill Directory Server的本地计算机) 相连。在 JConsole 的 New Connection 窗口中,必须在 Remote Process 文本字段中指定 Windchill Directory Server JMX URL,并在 UsernamePassword 字段中包含安装 Windchill Directory Server时指定的用户名和密码 (默认情况下 cn=manager)。JMX URL 的格式与如下格式类似 (在一行中输入):
service:jmx:rmi:///jndi/rmi://localhost:1689/org.opends.server.protocols.jmx.client-unknown
如果您从远程系统连接,请将 localhost 替换为 Windchill Directory Server所在的主机名。
* 
如果您想使用本地连接连接到 Windchill Directory Server,可从本地进程列表中选取 Windchill Directory Server进程。但是,不建议使用本地连接 (不需要登录凭证),因为本地连接对 Windchill Directory Server MBean 只具有有限的访问权限。
对于 VisualVM,使用 File > Add JMX Connection 开启与 Windchill Directory Server的连接。在 Connection 字段中输入 JMX URL,然后选择 Use security credentials 启用 UsernamePassword 字段。
MBeans 选项卡上的 com.ptc 节点可获得 Windchill Directory Server MBean。
您看到的大多数 Windchill Directory Server MBean 与 Windchill 中的对应项类似。例如,使用 LogsDirViewer MBean 可以列出日志文件、查看日志文件以及将日志文件发送到支持。但是,这些日志文件是 Windchill Directory Server日志目录中的文件,而不是 Windchill 日志文件。有关 Windchill MBean 的说明,请参阅 Windchill MBean
特定于 Windchill Directory Server的两个 MBean 为 DSCollector 和 DSUtility:
使用 DSUtility 可以查看 Windchill Directory Server的基本信息、环境变量,也可以查看和设置系统属性。
使用 DSCollector 可以收集 Windchill Directory Server的特定信息,还可以将收集的信息发送到支持。collectLogs、collectMBeanDump、collectProperties 和 sendDirectory 操作使您可以为发送或收集指定一个目录。通常,需指定相对目录名称。路径相对于 <WindchillDS_dir>/server/utilities/SystemConfigurationCollector/gathered 目录,其中 <WindchillDS_dir>Windchill Directory Server的安装目录位置。
使用 MBean 发送信息或以电子邮件发送信息的注意事项
Windchill Directory Server不能访问 Windchill 属性文件,因此必须手动设置相应的值。例如,应先在 Emailer MBean 属性中设置 MailServer 和 MailServerPort,然后才能以电子邮件发送信息。同样,在将信息发送到支持之前,应先在 DSCollector MBean 属性中设置 SCN 值。
PTC 还建议您设置一个电子邮件地址列表,用于在检测到问题 (例如,内存不足) 时接收电子邮件。可使用 Emailer JMX-Administrators MBean 向此列表添加地址。
设置完 MailServer 主机和端口以及电子邮件地址列表后,使用 Loader MBean 保存操作保存更改。通过使用 Loader MBean 保存操作,已经设置的值在重新启动 Windchill Directory Server之后可继续使用。包含 Windchill Directory Server MBean 值和配置的文件的默认位置为 <WindchillDS_dir>/server/config/WDSMBeanConfig.xml,其中 <WindchillDS_dir>Windchill Directory Server的安装目录位置。
要在 Windchill Directory Server重新启动过程中保留 SCN 值,请将 wt.support.scn 环境变量设置成该 SCN 值。
另一种确定 JMX URL 的方法
连接到 Windchill Directory Server所需的 JMX URL 很容易输错。因此,为方便起见,“服务器状况”页面中会提供连接到 Windchill Directory Server所需的 JMX URL。从“站点” > “实用程序”中打开“服务器状况”页面并滚动到 Windchill Directory Server部分。您可以为 Windchill Directory Server复制 JMX URL 并将其粘贴到您的 JMX 客户端连接窗口。