| Note: ExtendedWeblogicDiscovery pattern uses configuration file parsing approach only in Atrium Discovery 8.3 and later |
Overview
Atrium Discovery starting with 8.2 version has native built-in Weblogic extended J2EE Discovery mechanism based on JMX technology. All technical details are described in product documentation.
Starting from Atrium Discovery 8.3 there is an additional method which is used after and if the main enstended J2EE Discovery method fails. Usage of this method can be disabled in the Configuration Section of ExtendedWeblogicDiscovery module (it is turned on by default) via the Atrium Discovery pattern configuration UI.
This method is based on parsing of the Weblogic configuration file config.xml, the information about which is stored on the WebLogic Application Server SI by the core WebLogic Application Server pattern. Currently this method supports all version of WebLogic with two formats of config.xml files - WebLogic of version newer then 9.x and older.
Domain
ExtendedWeblogicDiscovery creates Domain Collection node with type set to "J2EEDomain" and domain_name set to the name of domain which is retrieved from config.xml by using the following XPath query:
- /domain/name
- /Domain/@Name (WebLogic of version 8.x and older)
J2EE Applications
The pattern parses out the list of deployed J2EE application from config.xml file with the help of the following Xpath query:
- /domain/app-deployment/name
- /Domain/Application/@Name (WebLogic of version 8.x and older)
Then the pattern checks each found application if it is deployed on current server in two steps:
- checking if the currently processed server's name is among other deployment targets obtained by the following Xpath query:
- /domain/app-deployment[name="<app>"]/target
- /Domain/Application[@Name="<app>"]/@StagedTargets - for WebLogic of version 8.x and older, is this node doesn't provide information, then the pattern will collect all targets of children WebAppComponent nodes using similar Xpath:
- /Domain/Application[@Name="<app>"]/WebAppComponent/@Targets
where app is the name of application being checked
- /Domain/Application[@Name="<app>"]/WebAppComponent/@Targets
- checking if this application is deployed on current server's cluster by firstly querying current server's cluster name with Xpath query and checking if this cluster name - if it was found - is among targets (which is the result of the previous query). The mentioned Xpath query for obtaining current server's cluster name is the following:
- /domain/server[name=<server_name>]/cluster
- /Domain/Server[@Name=<server_name>]/@Cluster - for WebLogic of version 8.x and older
where server_name is current server's name
For WebLogic of 9.x and newer versions if this application is verified to be deployed on current server, the pattern will model a Software Component with the correspondent name and the type set accordingly to the value found by the following Xpath Query (either "WAR" which will result in "J2EE WAR module" type or "EAR" which will result in "J2EE EAR module" type):
- //app-deployment[name="<app>"]/module-type
The same check for WebLogic 8.x and older is done by checking file-ending of Path atribute of Application for either ".ear" (J2EE EAR module) or ".war" (J2EE WAR module). For obtaining the path the following XPath query used:
- /Domain/Application[@Name="<app>"]/@Path
JDBC Resources
Weblogic 9.x and newer
The pattern parses out the list of available JDBC Resources from config.xml file with the help of the following Xpath query:
- /domain/jdbc-system-resource/name
Then for each found JDBC Resource the pattern makes a checks:
- the presence of the currently processed server's name in string which represents deployment targets obtained by the following Xpath query:
- /domain/jdbc-system-resource[name="<jdbc_resource>"]/target
where jdbc_resource is the name of JDBC Resource being checked
- and the same check for correspondent current server's cluster name found by the following Xpath query:
- /domain/server[name=<server_name>]/cluster
where server_name is current server's name
- /domain/server[name=<server_name>]/cluster
After confirming that this Resourse is available for currently processed server, the pattern will try to obtain the relative path to the file which contains so-called descriptor file - configuration file of this JDBC Resource (as such configurations are external) - with the help of the following Xpath query:
- /domain/jdbc-system-resource[name="<jdbc_resource>"]/descriptor-file-name
After successful obtaining of descriptor path it's absolute path is obtained from merging Domain config directory path with found relative path. Domain config directory path is found by deploying the following regex on config.xml absolute path (stored as attribute of Weblogic SI):
- ^(.*)[\\/]config\.xml$
The pattern then will try to read descriptor file and retrieve all necessary information from it - JDBC name using the following regular expression:
- <jndi-name>(.*?)</jndi-name>
and JDBC URL:
- <url>(.*?)</url>
Using this information (JNDI name and JDBC URL) the pattern will model Detail node with type set to "JDBCResource" and name based on found JDBC Resource name and different database parameters populated with data obtained from JDBC URL using the general ADDM JDBC URL parsing function.
Weblogic 8.x and older
For WebLogic 8.x and older version JDBC Resources in config.xml can be configured as transaction-enabled so the pattern tries two XPath queries:
- /Domain/JDBCDataSource/@Name
- /Domain/JDBCTxDataSource/@Name
To check each found JDBC DataStore is deployed on current Server the pattern makes the follwoing checks:
- for each found JDBC Resource the pattern makes one from two Xpaths queries (depends on the type of JDBC Resource which it gets from previous step - transaction-enabled or regular one):
- /Domain/JDBCDataSource[@Name="<jdbc_resource>"]/@Targets - for usual JDBC Resources
- /Domain/JDBCTxDataSource[@Name="<jdbc_resource>"]/@Targets - for transaction-enabled JDBC Resources
where jdbc_resource is the name of JDBC Resource being checked
- and the same check for related current server's cluster name found by the following Xpath query:
- /Domain/Server[@Name=<server_name>]/@Cluster - for WebLogic of version 8.x and older
where server_name is current server's name
- /Domain/Server[@Name=<server_name>]/@Cluster - for WebLogic of version 8.x and older
After previous check which confirms that processing JDBC Resource is deployed on current server the pattern will get JDNI name from DataSource node and JDBC URL from related JDBCConnectionPool node:
- JNDI name dependently on the type of DataSource is found by the one from following XPath queries:
- /Domain/JDBCDataSource[@Name="<jdbc_resource>"]/@JNDIName - for usual JDBC Resources
- /Domain/JDBCTxDataSource[@Name="<jdbc_resource>"]/@JNDIName - for transaction-enabled JDBC Resources
- To obtain JDBC URL firstly we need to get correspondent Pool name and then to parse from that Pool:
- The pattern obtains Pool name by using the following Xpath query (depends on type again):
- /Domain/JDBCDataSource[@Name="<jdbc_resource>"]/@PoolName - for usual JDBC Resources
- /Domain/JDBCTxDataSource[@Name="<jdbc_resource>"]/@PoolName - for transaction-enabled JDBC Resources
- Knowing Pool name the pattern looks for JDBC URL by employing the following XPath:
- /Domain/JDBCConnectionPool[@Name="<pool_name>"]/@URL
- The pattern obtains Pool name by using the following Xpath query (depends on type again):
Using this information (JNDI name and JDBC URL) the pattern will model Detail node with type set to "JDBCResource" and name based on found JDBC Resource name and different database parameters populated with data obtained from JDBC URL using the general ADDM JDBC URL parsing function.
Java Mail Resources
The list of Mail Resources (Mail Sessions in Weblogic terminology)is obtained from config.xml by using the following Xpath query:
- /domain/mail-session/name
Then the pattern verify each found Mail resource by checking:
- if the currently processed server's name is among other deployment targets obtained by the following Xpath query:
- /domain/mail-session[name="<mail_resource>"]/target
- /Domain/MailSession[@Name="<mail_resource>"]/@Targets - for WebLogic of version 8.x and older
where mail_session is the name of Mail Session being checked
- and the same check for current server's cluster name found by the following Xpath query:
- /domain/server[name=<server_name>]/cluster
- /Domain/Server[@Name=<server_name>]/@Cluster - for WebLogic of version 8.x and older
where server_name is current server's name
If this Resource's availability for current server is confirmed, the pattern will model a Detail with the correspondent name and the type set to "JavaMailResource":
