This product can be discovered by any edition of BMC Discovery. Download our free Community Edition to try it out, or [see what else it can discover] !
Extended Discovery pattern which allows to model J2EE Applications, JDBS Resources and Java Mail Resources for JBoss Application Server or WildFly SI is available for this product.
Starting from version 8.0 JBoss Application Server becomes WildFly. JBoss.tplpre pattern was updated for September TKU to support this change.
Starting from September TKU onward we differentiate between JBoss EAP versions and JBoss AS versions in particular. For this purposes we've added platform_version attribute to the JBoss Application Server (WildFly) SI for the cases when it is a part of Enterprise Platform.
JBoss (pronounced Jay Boss) Application Server or WildFly(since v.8.0) is an open source Java EE-based application server implemented in Java.
Because it is Java based, JBoss Application Server can be run on any platform that has a working Java Virtual Machine implementation, including Windows, most flavours of Unix and Linux, though those platforms that do not use the standard Sun JVM implementation may experience issues.
Other JBoss related projects include Hibernate, Tomcat, JBoss ESB, jBPM, JBoss Rules (formerly Drools), JBoss Cache, JGroups, JBoss Portal, SEAM, JBoss Transactions, JBoss Messaging and are marketed under the JBoss Enterprise Middleware Suite (JEMS) brand.
|Product Component||OS Type||Versioning||Pattern Depth|
|Application Server||Unix||Active, Path, Package||Instance-based or Grouped (data dependent)|
The pattern has been created in a manner that allows it to support Windows, Linux and Unix platforms from the same module, a Software Instance is created for each unique server running on a host.
There are two possible triggers:
Note that the java process can have any name. It is usually called java.exe but can also be called jboss.exe. Because of this the trigger only checks the process arguments, not the process command name
The following components/processes are identified using the simple identity mappings.
|regex '(?i)\bjava(?:\.exe)?$'||regex "org\.jboss\.(?:Main|as\.(?:standalone|server))"|
|regex '\bjava(?:\.\S+)$'||regex "org\.jboss\.(?:Main|as\.(?:standalone|server))"|
|regex '(?i)\bjava(?:\.exe)?$'||regex "org\.jboss\.(?:Main|as\.(?:standalone|server))"|
|Red Hat JBoss Application Server Host Controller||regex '(?i)\bjava(?:\.exe)?$'||regex 'org\.jboss\.as\.host-controller'|
Version information for the product is currently collected using one of three possible methods.
The methods are tried in an order of precedence based on likely success and/or accuracy of the information that can be gathered. Once a result is obtained, the methods lower in precedence are not attempted. In order of precedence the methods are:
JAVA_HOME environment variable should be set for Unix systems prior to running versioning active command and active command for edition extraction. The regular expression used for extracting JAVA_HOME for Unix systems is as follows:
Active Command (file) and Active Versioning methods depend on the pattern successfully obtaining the installation path of the JBoss Application Server (WildFly).
The installation path is obtained as follows:
If the trigger process arguments contain quotes, the regular expressions attempted are: (?i)"-Djboss\.home\.dir=(\w:[\\/][^"]+)"
If the trigger process arguments do not contain quotes the regular expression used is: (?i)-Djboss\.home\.dir=(\w:.+?)\sor
If the trigger process arguments contain quotes the regular expression used is: '-Djboss\.home\.dir="(.+?)"
If the trigger process arguments do not contain quotes the regular expression used is: -Djboss\.home\.dir=(/\S+)
If the above fails, a similar regular expression (possibly for older versions of the product) is used: -Djboss\.home\.url=file:(/\S+)
The pattern first parses the trigger process arguments to pull out the classpath using the following regular expressions:
If the classpath is within quotes (contains spaces in the paths): (?i)-(?:cp|classpath)\s+"(.+?)"
If the classpath is not within quotes: (?i)-(?:cp|classpath)\s+(\S+)\s
If the classpath is within quotes (contains spaces in the paths): -(?:cp|classpath)\s+"(.+?)"
If the classpath is not within quotes: -(?:cp|classpath)\s+(\S+)\s
The classpath has also the path separator characters normalized for the platform type
The pattern then parses the classpath section by section (sections are separated by ':' on UNIX platforms and ';' on the Windows platform) to obtain the installation path using the following regular expressions:
If the installation path still isn't obtained the pattern will attempt to parse it from trigger process arguments using the following regular expressions:
(?ix)\b(?:cp|classpath) \s "? (?:[^";]*?;)* (\w:\\.*?jboss[^;"]*?) \\(?:bin|lib)\\\w+\.jar
If the installation path is retrieved, the pattern gets line from the file named jar-versions.xml using the following command:
grep "jboss-main.jar" "<installation_path>/jar-versions.xml"
findstr /C:"jboss-main.jar" "<installation_path>\\jar-versions.xml"
In case the line is successfully read, and depending on the output pattern tries to extract version or platform_version by parsing it with the following regular expression:
This method disabled by default since it (run.sh -V) could cause jboss crashes or core dumps when jboss is running in debug mode
This method (if enabled in pattern configuration) also requires that the installation path has been determined.
For versions of JBoss AS starting from 7.0 the pattern also needs to determine the mode which server was started in from trigger process arguments. Using all this information the shell or batch file that instigated the instance is ran with a -V argument, which results in the version number being returned.
For JBoss Application Server prior to 7.x.x the Version Command results in a shell script being run in the bin directory that the main run.jar file is being run from, for newer releases of program shell or batch file name is equal to mode in which it was started.
The pattern extracts the active platform_version using following regular expression :
And if the command output matches regex "JBoss(?: Application Server)?(?: AS)?\s+\d+" then pattern extracts full version by means of regex:
This is needed only for JBoss AS of 7.0.0 or newer.
The pattern obtains the mode under which server was started from trigger process' argument list by matching:
If we are able to acquire the installation path and mode if needed then the pattern will attempt to run one of the following version commands:
The regular expression for the JBoss EAP platform_version: "JBoss(?: Application Server)?(?: AS)? EAP\s+(\d+(?:\.\d)*)"
The regular expression for the full_version :
If the Active Version Command does not return any version information then we parse the process arguments against a regex to see if it contains some version information specific to the installation.
As the JBoss application server command is actually a Java VM instance there is no point applying a regex to the commands path, in this case we apply a regex to the arguments to see if there is a version number that can be used.
The regular expressions used to extract JBoss EAP platform_version:
The regular expressions used to extract full_version :
The result of this regex is then parsed against a function that converts all underscores and hyphens to periods - to ensure that the version number for this product is consistent throughout the environment.The Regex looks for the word "jboss" somewhere in the classpath and following that a string of digits separated by either underscores, hyphens or periods - this results in a accurate version number that can catch a number of different formats without being open to erroneous inputs.
The version number returned using this method is dependent on the deployment pattern used to install the product, usually it will be to two levels, i.e. x.x, but we have seen a few instances where the depth can is three levels, i.e. x.x.x.
Using a sample command line argument of "/opt/jboss-3.2.6/bin/run.jar" and the above Regex, the version output would be "3.2.6".
If the Active or Path Versioning techniques do not return any version information then we check the installed packages to see if we can extract version information from one of them using the regex, (?i)jboss or (?i)wildfly\d+
As there is only one package specified in the query then the version number will be assigned if that package exists on the host.
A Jboss package is not registered as standard and identification has been successful on a case-by-case basis, it is dependent on the environment setup.
Package querying is the lowest preference way in which versioning can be achieved - as such the JBoss has been added, despite it not always being present, as a last resort if the other two methods fail.
The main risk of package versioning is that if more than one version of JBoss Application Server (WildFly) is installed then the version information may not be mapped to the correct instance that has been identified.
In case 2 packages are installed pattern will take the highest version of the package.
If previous versioning approaches failed and we were able to get path to boot.log file pattern tries to run one of the following commands:
Valid for Unix platforms and WildFly installation.
This versioning approach will be used as the last one, in case previous didn't get any data for the product.
Pattern will use base_dir path in addition to the default path to the MANIFEST.MF file.
The following command will be executed:
To retrieve product version from command output the following regex will be used:
Starting from version 6.0 of Jboss edition can be obtained by running the following command:
This command exists only for Enterprise Edition. Edition is set to Enterprise if command result has subword "JBoss EAP".
If edition was not set based on command output, pattern checks the following file:
If it's content matches 'JBoss\s+Enterprise', edition will be set to Enterprise.
If edition was not set by previous two methods pattern checks if appclient.sh exists by obtaining information about the following files:
Edition can be obtained from the log directory
Regex to obtain log directory from process arguments:
Command to obtain Edition:
For Windows hosts:
For Unix hosts:
If pattern fails to obtain both files and obtaining edition from log file fails - assume there is an access problem, edition cannot be defined
If Product version < 6.0
Edition can be obtained from <installation path>\readme.html file, by parsing its content with a the following regexs:
If edition was not obtained, the pattern checks whether installation path has subword 'EnterprisePlatform' or 'EAP'. if subword is found set edition to Enterprise. For all other cases edition will be set to empty string.
If version was not obtained pattern uses all of the described methods to get edition information.
If neither run.bat or mode.bat is found, it indicates a permission problem rather than the absence of the files.
For JBoss of version 7.0.0 or newer server name can be retrieved only if server was started in domain mode. The value can be parsed using one of the following regular expressions against trigger process's arguments:
For older versions of JBoss the pattern tries in order two following regular expressions against trigger process's arguments:
Note that in last regex the value which is parsed more correctly should be called profile name.
On the UNIX platform, the server base is discovered from the trigger process' command line arguments via use of one of the following regular expressions:
On the UNIX platform, the server home is discovered from the trigger process' command line arguments via use of one of the following regular expressions:
If mode "standalone" then pattern extracts this multicast_socket attribute from standalone-ha.xml or standalone-full-ha.xml files else from domain.xml file.
Pattern will use xpaths to extract multicast-address and port infomation:
JBoss Application Server or WildFly is run independently from a folder, it is only dependent on a valid java virtual machine being installed on the system and referenced correctly in the PATH or JAVA_HOME environment variables.
It is usually started by the running of a shell script or batch file called run.sh or run.bat (depending on Operating System), when ran this script starts the Java VM and passes all the relevant variables to it to start the JBoss Application Server or WildFly - depending on the version.
By default JBoss can be run once on each host, with further installation in separate directories and some changes being made to the configuration file you can run two or more instances of JBoss relatively easily.
One pattern has been created with the JBoss Application Server(WildFly) and JBoss Application Server (daemon) or WildFly(daemon) as its trigger processes. The pattern triggers only where the process cmd matches a java executable (java or java.exe) followed by one of the JBoss arguments:
There is a configuration option for this product which allows to enable active versioning method.
To enable this option user just needs to set "True" to active_versioning_enabled variable.
Although the pattern in general produces instance-based Software Instance based primarily on installation path the approaches in particular are all different for older and newer versions of JBoss and for latter it also depends on mode of server.
This approach is only for JBoss AS version 7.0 or newer started in 'standalone' mode.
If installation path was successfully discovered then the key is based on it and host's key, else the pattern uses key group based on trigger process's argument list.
This approach is only for JBoss AS version 7.0 or newer started in 'domain' mode.
If installation path and server name were successfully discovered then the key is based on them and host's key, else if only installation path was found the pattern uses key group based on it, or alternatively based on classpath. In other cases the pattern doesn't set key letting BMC Discovery manage found instances automatically.
This approach is only for JBoss AS version older than 7.0.
If installation path and/or server name were successfully discovered the pattern creates the key based on them and host's key, else it creates key group based on either the installation path (if obtained) or parsed from process's arguments java classpath.
Starting from version 8.3, Atrium Discovery is able to perform extended (J2EE) JBoss Application Server discovery via additional patterns . The approach used by these patterns is based on analyzing different configuration files of JBoss Application Server or WildFly.
Under normal circumstances the Application Server SI creates a client server link to the Host Controller on the same host (the Application Server is the client). However, sometimes there isn't a Host Controller on the host because the Host Controller acts as Domain Controller . In this situation the Application Server creates a client server link to such Host Controller which is identified as Domain Controller by having domain_controller attribute set to TRUE.
The Host Controller SI creates a client server link to the Domain Controller. It finds the domain controller by parsing the trigger process arguments. If that fails it parses the file <installation root>/domain/configuration/host.xml
So an installation might look like the following
For BMC Discovery 11.0 and later JBoss Server Groups are modelled as a cluster. Every time a Red Hat JBoss Application Server or WildFly SI is created the pattern created searches the host.xml for details of the group it belongs to. If it finds this group information it links it to the relevant JBoss Server Group Cluster.
App Server's Software Components are contained within Red Hat JBoss Server Groups.
The pattern also creates a management relationship between the JBoss Cluster and the Host Controller which serves as Domain Controller:
Note that legacy versions of BMC Discovery (10.2 and earlier) model JBoss Server Groups as software instances that have client server links to various application servers (the Server Group is the server). These models will be upgraded to a full cluster model when you upgrade to a modern version of BMC Discovery.
For Standalone mode if the instances are clustered, JBoss Standalone Cluster will be created. Every time a Red Hat JBoss Application Server or WildFly SI is created and it has standalone mode the pattern created searches for multicast_socket attribute and create Red Hat JBoss Standalone Cluster. After that it will search for the Red Hat JBoss Application Server or WildFly SIs with the identical multicast_socket attribute and add it to the cluster.
App Server's Software Components are contained within Red Hat JBoss Standalone Cluster.
SME feedback would be appreciated in identifying any other possible commands or files that could be used to version an instance of the product.
Further information on known packages and their reliability would help improve the overall scope and depth of versioning for this product.
The pattern has been tested against Live installations of the product on Linux and Windows.