# WildFly Domain by JMX ## Overview For Zabbix version: 6.2 and higher Official JMX Template for WildFly Domain Controller. This template was tested on: - WildFly, version 22.6.0 ## Setup > See [Zabbix template operation](https://www.zabbix.com/documentation/6.2/manual/config/templates_out_of_the_box/jmx) for basic instructions. Metrics are collected by JMX. This template works with Domain Controller. 1. Enable and configure JMX access to WildFly. See documentation for [instructions](https://docs.wildfly.org/23/Admin_Guide.html#JMX). 2. Copy jboss-client.jar from `/(wildfly,EAP,Jboss,AS)/bin/client` in to directory `/usr/share/zabbix-java-gateway/lib` 3. Restart Zabbix Java gateway 4. Set the user name and password in host macros {$WILDFLY.USER} and {$WILDFLY.PASSWORD}. Depending on your server setup, you may need to specify a custom JMX scheme in macro {$WILDFLY.JMX.PROTOCOL} (default: remote+http) ## Zabbix configuration No specific Zabbix configuration is required. ### Macros used |Name|Description|Default| |----|-----------|-------| |{$WILDFLY.DEPLOYMENT.MATCHES} |
Filter of discoverable deployments
|`.*` | |{$WILDFLY.DEPLOYMENT.NOT_MATCHES} |Filter to exclude discovered deployments
|`CHANGE_IF_NEEDED` | |{$WILDFLY.JMX.PROTOCOL} |-
|`remote+http` | |{$WILDFLY.PASSWORD} |-
|`zabbix` | |{$WILDFLY.SERVER.MATCHES} |Filter of discoverable servers
|`.*` | |{$WILDFLY.SERVER.NOT_MATCHES} |Filter to exclude discovered servers
|`CHANGE_IF_NEEDED` | |{$WILDFLY.USER} |-
|`zabbix` | ## Template links There are no template links in this template. ## Discovery rules |Name|Description|Type|Key and additional info| |----|-----------|----|----| |Deployments discovery |Discovery deployments metrics.
|JMX |jmx.get[beans,"jboss.as.expr:deployment=*,server-group=*"]**Filter**:
AND- {#DEPLOYMENT} MATCHES_REGEX `{$WILDFLY.DEPLOYMENT.MATCHES}`
- {#DEPLOYMENT} NOT_MATCHES_REGEX `{$WILDFLY.DEPLOYMENT.NOT_MATCHES}`
| |Servers discovery |Discovery instances in domain.
|JMX |jmx.get[beans,"jboss.as:host=master,server-config=*"]**Filter**:
AND- {#SERVER} MATCHES_REGEX `{$WILDFLY.SERVER.MATCHES}`
- {#SERVER} NOT_MATCHES_REGEX `{$WILDFLY.SERVER.NOT_MATCHES}`
| ## Items collected |Group|Name|Description|Type|Key and additional info| |-----|----|-----------|----|---------------------| |WildFly |WildFly: Launch type |The manner in which the server process was launched. Either "DOMAIN" for a domain mode server launched by a Host Controller, "STANDALONE" for a standalone server launched from the command line, or "EMBEDDED" for a standalone server launched as an embedded part of an application running in the same virtual machine.
|JMX |jmx["jboss.as:management-root=server","launchType"]**Preprocessing**:
- DISCARD_UNCHANGED_HEARTBEAT: `3h`
| |WildFly |WildFly: Name |For standalone mode: The name of this server. If not set, defaults to the runtime value of InetAddress.getLocalHost().getHostName().
For domain mode: The name given to this domain
|JMX |jmx["jboss.as:management-root=server","name"]**Preprocessing**:
- DISCARD_UNCHANGED_HEARTBEAT: `3h`
| |WildFly |WildFly: Process type |The type of process represented by this root resource.
|JMX |jmx["jboss.as:management-root=server","processType"]**Preprocessing**:
- DISCARD_UNCHANGED_HEARTBEAT: `3h`
| |WildFly |WildFly: Version |The version of the WildFly Core based product release
|JMX |jmx["jboss.as:management-root=server","productVersion"]**Preprocessing**:
- DISCARD_UNCHANGED_HEARTBEAT: `3h`
| |WildFly |WildFly: Uptime |WildFly server uptime.
|JMX |jmx["java.lang:type=Runtime","Uptime"]**Preprocessing**:
- MULTIPLIER: `0.001`
| |WildFly |WildFly deployment [{#DEPLOYMENT}]: Enabled |Boolean indicating whether the deployment content is currently deployed in the runtime (or should be deployed in the runtime the next time the server starts.)
|JMX |jmx["{#JMXOBJ}",enabled]**Preprocessing**:
- BOOL_TO_DECIMAL
- DISCARD_UNCHANGED_HEARTBEAT: `3h`
| |WildFly |WildFly deployment [{#DEPLOYMENT}]: Managed |Indicates if the deployment is managed (aka uses the ContentRepository).
|JMX |jmx["{#JMXOBJ}",managed]**Preprocessing**:
- BOOL_TO_DECIMAL
- DISCARD_UNCHANGED_HEARTBEAT: `3h`
| |WildFly |WildFly domain: Server {#SERVER}: Autostart |Whether or not this server should be started when the Host Controller starts.
|JMX |jmx["{#JMXOBJ}",autoStart]**Preprocessing**:
- BOOL_TO_DECIMAL
- DISCARD_UNCHANGED_HEARTBEAT: `3h`
| |WildFly |WildFly domain: Server {#SERVER}: Status |The current status of the server.
|JMX |jmx["{#JMXOBJ}",status]**Preprocessing**:
- DISCARD_UNCHANGED_HEARTBEAT: `3h`
| |WildFly |WildFly domain: Server {#SERVER}: Server group |The name of a server group from the domain model.
|JMX |jmx["{#JMXOBJ}",group]**Preprocessing**:
- DISCARD_UNCHANGED_HEARTBEAT: `3h`
| ## Triggers |Name|Description|Expression|Severity|Dependencies and additional info| |----|-----------|----|----|----| |WildFly: Version has changed |WildFly version has changed. Ack to close.
|`last(/WildFly Domain by JMX/jmx["jboss.as:management-root=server","productVersion"],#1)<>last(/WildFly Domain by JMX/jmx["jboss.as:management-root=server","productVersion"],#2) and length(last(/WildFly Domain by JMX/jmx["jboss.as:management-root=server","productVersion"]))>0` |INFO |Manual close: YES
| |WildFly: has been restarted |Uptime is less than 10 minutes
|`last(/WildFly Domain by JMX/jmx["java.lang:type=Runtime","Uptime"])<10m` |INFO |Manual close: YES
| |WildFly domain: Server {#SERVER}: Server status has changed |Server status has changed. Ack to close.
|`last(/WildFly Domain by JMX/jmx["{#JMXOBJ}",status],#1)<>last(/WildFly Domain by JMX/jmx["{#JMXOBJ}",status],#2) and length(last(/WildFly Domain by JMX/jmx["{#JMXOBJ}",status]))>0` |WARNING |Manual close: YES
| |WildFly domain: Server {#SERVER}: Server group has changed |Server group has changed. Ack to close.
|`last(/WildFly Domain by JMX/jmx["{#JMXOBJ}",group],#1)<>last(/WildFly Domain by JMX/jmx["{#JMXOBJ}",group],#2) and length(last(/WildFly Domain by JMX/jmx["{#JMXOBJ}",group]))>0` |INFO |Manual close: YES
| ## Feedback Please report any issues with the template at https://support.zabbix.com You can also provide feedback, discuss the template or ask for help with it at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback).