# WildFly Server by JMX ## Overview Official JMX Template for WildFly server. ## Requirements Zabbix version: 7.0 and higher. ## Tested versions This template has been tested on: - WildFly 22.6.0 ## Configuration > Zabbix should be configured according to the instructions in the [Templates out of the box](https://www.zabbix.com/documentation/7.0/manual/config/templates_out_of_the_box) section. ## Setup Metrics are collected by JMX. This template works with standalone and domain instances. 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) ### Macros used |Name|Description|Default| |----|-----------|-------| |{$WILDFLY.USER}||`zabbix`| |{$WILDFLY.PASSWORD}||`zabbix`| |{$WILDFLY.JMX.PROTOCOL}||`remote+http`| |{$WILDFLY.DEPLOYMENT.MATCHES}|
Filter of discoverable deployments
|`.*`| |{$WILDFLY.DEPLOYMENT.NOT_MATCHES}|Filter to exclude discovered deployments
|`CHANGE_IF_NEEDED`| |{$WILDFLY.CONN.USAGE.WARN.MAX}|The maximum connection usage percent for trigger expression.
|`80`| |{$WILDFLY.CONN.WAIT.MAX.WARN}|The maximum number of waiting connections for trigger expression.
|`300`| ### Items |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |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 agent|jmx["jboss.as:management-root=server","launchType"]**Preprocessing**
Discard unchanged with heartbeat: `3h`
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 agent|jmx["jboss.as:management-root=server","name"]**Preprocessing**
Discard unchanged with heartbeat: `3h`
The type of process represented by this root resource.
|JMX agent|jmx["jboss.as:management-root=server","processType"]**Preprocessing**
Discard unchanged with heartbeat: `3h`
The current persistent configuration state, one of starting, ok, reload-required, restart-required, stopping or stopped.
|JMX agent|jmx["jboss.as:management-root=server","runtimeConfigurationState"]**Preprocessing**
Discard unchanged with heartbeat: `3h`
The current state of the server controller; either STARTING, RUNNING, RESTART_REQUIRED, RELOAD_REQUIRED or STOPPING.
|JMX agent|jmx["jboss.as:management-root=server","serverState"]**Preprocessing**
Discard unchanged with heartbeat: `3h`
The version of the WildFly Core based product release.
|JMX agent|jmx["jboss.as:management-root=server","productVersion"]**Preprocessing**
Discard unchanged with heartbeat: `3h`
WildFly server uptime.
|JMX agent|jmx["java.lang:type=Runtime","Uptime"]**Preprocessing**
Custom multiplier: `0.001`
The total number of transactions (top-level and nested) created per second.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfTransactions"]**Preprocessing**
The number of aborted (i.e. rolledback) transactions per second.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfAbortedTransactions"]**Preprocessing**
The number of transactions that have been rolled back by application request. This includes those that timeout, since the timeout behavior is considered an attribute of the application configuration.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfApplicationRollbacks"]**Preprocessing**
The number of committed transactions.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfCommittedTransactions"]**Preprocessing**
The number of transactions which have terminated with heuristic outcomes.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfHeuristics"]**Preprocessing**
The number of transactions that have begun but not yet terminated.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfInflightTransactions"]| |WildFly: Transactions: Nested, rate|The total number of nested (sub) transactions created.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfNestedTransactions"]**Preprocessing**
The number of transactions that rolled back due to resource (participant) failure.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfResourceRollbacks"]**Preprocessing**
The number of transactions that have been rolled back due to internal system errors.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfSystemRollbacks"]**Preprocessing**
The number of transactions that have rolled back due to timeout.
|JMX agent|jmx["jboss.as:subsystem=transactions","numberOfTimedOutTransactions"]**Preprocessing**
WildFly version has changed. Acknowledge to close the problem manually.
|`last(/WildFly Server by JMX/jmx["jboss.as:management-root=server","productVersion"],#1)<>last(/WildFly Server by JMX/jmx["jboss.as:management-root=server","productVersion"],#2) and length(last(/WildFly Server by JMX/jmx["jboss.as:management-root=server","productVersion"]))>0`|Info|**Manual close**: Yes| |WildFly: Host has been restarted|Uptime is less than 10 minutes.
|`last(/WildFly Server by JMX/jmx["java.lang:type=Runtime","Uptime"])<10m`|Info|**Manual close**: Yes| |WildFly: Failed to fetch info data|Zabbix has not received data for items for the last 15 minutes
|`nodata(/WildFly Server by JMX/jmx["java.lang:type=Runtime","Uptime"],15m)=1`|Warning|| ### LLD rule Deployments discovery |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |Deployments discovery|Discovery deployments metrics.
|JMX agent|jmx.get[beans,"jboss.as.expr:deployment=*"]| ### Item prototypes for Deployments discovery |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |WildFly deployment [{#DEPLOYMENT}]: Status|The current runtime status of a deployment.
Possible status modes are OK, FAILED, and STOPPED.
FAILED indicates a dependency is missing or a service could not start.
STOPPED indicates that the deployment was not enabled or was manually stopped.
|JMX agent|jmx["{#JMXOBJ}",status]**Preprocessing**
Discard unchanged with heartbeat: `3h`
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 agent|jmx["{#JMXOBJ}",enabled]**Preprocessing**
Discard unchanged with heartbeat: `3h`
Indicates if the deployment is managed (aka uses the ContentRepository).
|JMX agent|jmx["{#JMXOBJ}",managed]**Preprocessing**
Discard unchanged with heartbeat: `3h`
Indicates if the deployment is managed (aka uses the ContentRepository).
|JMX agent|jmx["{#JMXOBJ}",persistent]**Preprocessing**
Discard unchanged with heartbeat: `3h`
Indicates if the deployment is managed (aka uses the ContentRepository).
|JMX agent|jmx["{#JMXOBJ}",enabledTime]**Preprocessing**
Custom multiplier: `0.001`
Discard unchanged with heartbeat: `3h`
Deployment status has changed. Acknowledge to close the problem manually.
|`last(/WildFly Server by JMX/jmx["{#JMXOBJ}",status],#1)<>last(/WildFly Server by JMX/jmx["{#JMXOBJ}",status],#2) and length(last(/WildFly Server by JMX/jmx["{#JMXOBJ}",status]))>0`|Warning|**Manual close**: Yes| ### LLD rule JDBC metrics discovery |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |JDBC metrics discovery||JMX agent|jmx.get[beans,"jboss.as:subsystem=datasources,data-source=*,statistics=jdbc"]| ### Item prototypes for JDBC metrics discovery |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |WildFly {#JMX_DATA_SOURCE}: Cache access, rate|The number of times that the statement cache was accessed per second.
|JMX agent|jmx["{#JMXOBJ}",PreparedStatementCacheAccessCount]**Preprocessing**
The number of statements added to the statement cache per second.
|JMX agent|jmx["{#JMXOBJ}",PreparedStatementCacheAddCount]**Preprocessing**
The number of prepared and callable statements currently cached in the statement cache.
|JMX agent|jmx["{#JMXOBJ}",PreparedStatementCacheCurrentSize]| |WildFly {#JMX_DATA_SOURCE}: Cache delete, rate|The number of statements discarded from the cache per second.
|JMX agent|jmx["{#JMXOBJ}",PreparedStatementCacheDeleteCount]**Preprocessing**
The number of times that statements from the cache were used per second.
|JMX agent|jmx["{#JMXOBJ}",PreparedStatementCacheHitCount]**Preprocessing**
The number of times that a statement request could not be satisfied with a statement from the cache per second.
|JMX agent|jmx["{#JMXOBJ}",PreparedStatementCacheMissCount]**Preprocessing**
Define whether runtime statistics are enabled or not.
|JMX agent|jmx["{#JMXOBJ}",statisticsEnabled, "JDBC"]**Preprocessing**
Discard unchanged with heartbeat: `3h`
The number of open connections.
|JMX agent|jmx["{#JMXOBJ}",ActiveCount]| |WildFly {#JMX_DATA_SOURCE}: Connections: Available|The available count.
|JMX agent|jmx["{#JMXOBJ}",AvailableCount]| |WildFly {#JMX_DATA_SOURCE}: Blocking time, avg|Average Blocking Time for pool.
|JMX agent|jmx["{#JMXOBJ}",AverageBlockingTime]| |WildFly {#JMX_DATA_SOURCE}: Connections: Creating time, avg|The average time spent creating a physical connection.
|JMX agent|jmx["{#JMXOBJ}",AverageCreationTime]| |WildFly {#JMX_DATA_SOURCE}: Connections: Get time, avg|The average time spent obtaining a physical connection.
|JMX agent|jmx["{#JMXOBJ}",AverageGetTime]| |WildFly {#JMX_DATA_SOURCE}: Connections: Pool time, avg|The average time for a physical connection spent in the pool.
|JMX agent|jmx["{#JMXOBJ}",AveragePoolTime]| |WildFly {#JMX_DATA_SOURCE}: Connections: Usage time, avg|The average time spent using a physical connection
|JMX agent|jmx["{#JMXOBJ}",AverageUsageTime]| |WildFly {#JMX_DATA_SOURCE}: Connections: Blocking failure, rate|The number of failures trying to obtain a physical connection per second.
|JMX agent|jmx["{#JMXOBJ}",BlockingFailureCount]**Preprocessing**
The created per second
|JMX agent|jmx["{#JMXOBJ}",CreatedCount]**Preprocessing**
The destroyed count.
|JMX agent|jmx["{#JMXOBJ}",DestroyedCount]**Preprocessing**
The number of physical connections currently idle.
|JMX agent|jmx["{#JMXOBJ}",IdleCount]| |WildFly {#JMX_DATA_SOURCE}: Connections: In use|The number of physical connections currently in use.
|JMX agent|jmx["{#JMXOBJ}",InUseCount]| |WildFly {#JMX_DATA_SOURCE}: Connections: Used, max|The maximum number of connections used.
|JMX agent|jmx["{#JMXOBJ}",MaxUsedCount]| |WildFly {#JMX_DATA_SOURCE}: Statistics enabled|Define whether runtime statistics are enabled or not.
|JMX agent|jmx["{#JMXOBJ}",statisticsEnabled]**Preprocessing**
Discard unchanged with heartbeat: `3h`
The timed out connections per second.
|JMX agent|jmx["{#JMXOBJ}",TimedOut]**Preprocessing**
The number of requests that had to wait to obtain a physical connection.
|JMX agent|jmx["{#JMXOBJ}",WaitCount]| |WildFly {#JMX_DATA_SOURCE}: XA: Commit time, avg|The average time for a XAResource commit invocation.
|JMX agent|jmx["{#JMXOBJ}",XACommitAverageTime]| |WildFly {#JMX_DATA_SOURCE}: XA: Commit, rate|The number of XAResource commit invocations per second.
|JMX agent|jmx["{#JMXOBJ}",XACommitCount]**Preprocessing**
The average time for a XAResource end invocation.
|JMX agent|jmx["{#JMXOBJ}",XAEndAverageTime]| |WildFly {#JMX_DATA_SOURCE}: XA: End, rate|The number of XAResource end invocations per second.
|JMX agent|jmx["{#JMXOBJ}",XAEndCount]**Preprocessing**
The average time for a XAResource forget invocation.
|JMX agent|jmx["{#JMXOBJ}",XAForgetAverageTime]| |WildFly {#JMX_DATA_SOURCE}: XA: Forget, rate|The number of XAResource forget invocations per second.
|JMX agent|jmx["{#JMXOBJ}",XAForgetCount]**Preprocessing**
The average time for a XAResource prepare invocation.
|JMX agent|jmx["{#JMXOBJ}",XAPrepareAverageTime]| |WildFly {#JMX_DATA_SOURCE}: XA: Prepare, rate|The number of XAResource prepare invocations per second.
|JMX agent|jmx["{#JMXOBJ}",XAPrepareCount]**Preprocessing**
The average time for a XAResource recover invocation.
|JMX agent|jmx["{#JMXOBJ}",XARecoverAverageTime]| |WildFly {#JMX_DATA_SOURCE}: XA: Recover, rate|The number of XAResource recover invocations per second.
|JMX agent|jmx["{#JMXOBJ}",XARecoverCount]**Preprocessing**
The average time for a XAResource rollback invocation.
|JMX agent|jmx["{#JMXOBJ}",XARollbackAverageTime]| |WildFly {#JMX_DATA_SOURCE}: XA: Rollback, rate|The number of XAResource rollback invocations per second.
|JMX agent|jmx["{#JMXOBJ}",XARollbackCount]**Preprocessing**
The average time for a XAResource start invocation.
|JMX agent|jmx["{#JMXOBJ}",XAStartAverageTime]| |WildFly {#JMX_DATA_SOURCE}: XA: Start rate|The number of XAResource start invocations per second.
|JMX agent|jmx["{#JMXOBJ}",XAStartCount]**Preprocessing**
Zabbix has not received data for items for the last 15 minutes
|`last(/WildFly Server by JMX/jmx["{#JMXOBJ}",statisticsEnabled])=0`|Info|| |WildFly {#JMX_DATA_SOURCE}: There are timeout connections||`last(/WildFly Server by JMX/jmx["{#JMXOBJ}",TimedOut])>0`|Warning|| |WildFly {#JMX_DATA_SOURCE}: Too many waiting connections||`min(/WildFly Server by JMX/jmx["{#JMXOBJ}",WaitCount],5m)>{$WILDFLY.CONN.WAIT.MAX.WARN}`|Warning|| ### LLD rule Undertow metrics discovery |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |Undertow metrics discovery||JMX agent|jmx.get[beans,"jboss.as:subsystem=undertow,server=*,http-listener=*"]| ### Item prototypes for Undertow metrics discovery |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |WildFly listener {#HTTP_LISTENER}: Errors, rate|The number of 500 responses that have been sent by this listener per second.
|JMX agent|jmx["{#JMXOBJ}",errorCount]**Preprocessing**
The number of requests this listener has served per second.
|JMX agent|jmx["{#JMXOBJ}",requestCount]**Preprocessing**
The number of bytes that have been sent out on this listener per second.
|JMX agent|jmx["{#JMXOBJ}",bytesSent]**Preprocessing**
The number of bytes that have been received by this listener per second.
|JMX agent|jmx["{#JMXOBJ}",bytesReceived]**Preprocessing**