Java

Available solutions




This template is for Zabbix version: 6.0
Also available for: 5.4 5.0 4.0

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/generic_java_jmx?at=release/6.0

Generic Java JMX

Overview

For Zabbix version: 6.0 and higher
Official JMX Template from Zabbix distribution. Could be useful for many Java Applications (JMX).

Setup

Refer to the vendor documentation.

Zabbix configuration

No specific Zabbix configuration is required.

Macros used

Name Description Default
{$JMX.CPU.LOAD.MAX}

A threshold in percent for CPU utilization trigger.

85
{$JMX.CPU.LOAD.TIME}

The time during which the CPU utilization may exceed the threshold.

5m
{$JMX.FILE.DESCRIPTORS.MAX}

A threshold in percent for file descriptors count trigger.

85
{$JMX.FILE.DESCRIPTORS.TIME}

The time during which the file descriptors count may exceed the threshold.

3m
{$JMX.HEAP.MEM.USAGE.MAX}

A threshold in percent for Heap memory utilization trigger.

85
{$JMX.HEAP.MEM.USAGE.TIME}

The time during which the Heap memory utilization may exceed the threshold.

10m
{$JMX.MEM.POOL.NAME.MATCHES}

This macro used in memory pool discovery as a filter.

Old Gen|G1|Perm Gen|Code Cache|Tenured Gen
{$JMX.MP.USAGE.MAX}

A threshold in percent for memory pools utilization trigger. Use a context to change the threshold for a specific pool.

85
{$JMX.MP.USAGE.TIME}

The time during which the memory pools utilization may exceed the threshold.

10m
{$JMX.NONHEAP.MEM.USAGE.MAX}

A threshold in percent for Non-heap memory utilization trigger.

85
{$JMX.NONHEAP.MEM.USAGE.TIME}

The time during which the Non-heap memory utilization may exceed the threshold.

10m
{$JMX.PASSWORD}

JMX password.

``
{$JMX.USER}

JMX username.

``

Template links

There are no template links in this template.

Discovery rules

Name Description Type Key and additional info
Garbage collector discovery

Garbage collectors metrics discovery.

JMX jmx.discovery["beans","java.lang:name=*,type=GarbageCollector"]
Memory pool discovery

Memory pools metrics discovery.

JMX jmx.discovery["beans","java.lang:name=*,type=MemoryPool"]

Filter:

- {#JMXNAME} MATCHES_REGEX {$JMX.MEM.POOL.NAME.MATCHES}

Items collected

Group Name Description Type Key and additional info
JMX ClassLoading: Loaded class count

Displays number of classes that are currently loaded in the Java virtual machine.

JMX jmx["java.lang:type=ClassLoading","LoadedClassCount"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX ClassLoading: Total loaded class count

Displays the total number of classes that have been loaded since the Java virtual machine has started execution.

JMX jmx["java.lang:type=ClassLoading","TotalLoadedClassCount"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX ClassLoading: Unloaded class count

Displays the total number of classes that have been loaded since the Java virtual machine has started execution.

JMX jmx["java.lang:type=ClassLoading","UnloadedClassCount"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Compilation: Name of the current JIT compiler

Displays the total number of classes unloaded since the Java virtual machine has started execution.

JMX jmx["java.lang:type=Compilation","Name"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 30m

JMX Compilation: Accumulated time spent

Displays the approximate accumulated elapsed time spent in compilation, in seconds.

JMX jmx["java.lang:type=Compilation","TotalCompilationTime"]

Preprocessing:

- MULTIPLIER: 0.001

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Memory: Heap memory committed

Current heap memory allocated. This amount of memory is guaranteed for the Java virtual machine to use.

JMX jmx["java.lang:type=Memory","HeapMemoryUsage.committed"]
JMX Memory: Heap memory maximum size

Maximum amount of heap that can be used for memory management. This amount of memory is not guaranteed to be available if it is greater than the amount of committed memory. The Java virtual machine may fail to allocate memory even if the amount of used memory does not exceed this maximum size.

JMX jmx["java.lang:type=Memory","HeapMemoryUsage.max"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Memory: Heap memory used

Current memory usage outside the heap.

JMX jmx["java.lang:type=Memory","HeapMemoryUsage.used"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Memory: Non-Heap memory committed

Current memory allocated outside the heap. This amount of memory is guaranteed for the Java virtual machine to use.

JMX jmx["java.lang:type=Memory","NonHeapMemoryUsage.committed"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Memory: Non-Heap memory maximum size

Maximum amount of non-heap memory that can be used for memory management. This amount of memory is not guaranteed to be available if it is greater than the amount of committed memory. The Java virtual machine may fail to allocate memory even if the amount of used memory does not exceed this maximum size.

JMX jmx["java.lang:type=Memory","NonHeapMemoryUsage.max"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Memory: Non-Heap memory used

Current memory usage outside the heap

JMX jmx["java.lang:type=Memory","NonHeapMemoryUsage.used"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Memory: Object pending finalization count

The approximate number of objects for which finalization is pending.

JMX jmx["java.lang:type=Memory","ObjectPendingFinalizationCount"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX OperatingSystem: File descriptors maximum count

This is the number of file descriptors we can have opened in the same process, as determined by the operating system. You can never have more file descriptors than this number.

JMX jmx["java.lang:type=OperatingSystem","MaxFileDescriptorCount"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX OperatingSystem: File descriptors opened

This is the number of opened file descriptors at the moment, if this reaches the MaxFileDescriptorCount, the application will throw an IOException: Too many open files. This could mean you are opening file descriptors and never closing them.

JMX jmx["java.lang:type=OperatingSystem","OpenFileDescriptorCount"]
JMX OperatingSystem: Process CPU Load

ProcessCpuLoad represents the CPU load in this process.

JMX jmx["java.lang:type=OperatingSystem","ProcessCpuLoad"]

Preprocessing:

- MULTIPLIER: 100

JMX Runtime: JVM uptime

-

JMX jmx["java.lang:type=Runtime","Uptime"]

Preprocessing:

- MULTIPLIER: 0.001

JMX Runtime: JVM name

-

JMX jmx["java.lang:type=Runtime","VmName"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 30m

JMX Runtime: JVM version

-

JMX jmx["java.lang:type=Runtime","VmVersion"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 30m

JMX Threading: Daemon thread count

Number of daemon threads running.

JMX jmx["java.lang:type=Threading","DaemonThreadCount"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Threading: Peak thread count

Maximum number of threads being executed at the same time since the JVM was started or the peak was reset.

JMX jmx["java.lang:type=Threading","PeakThreadCount"]
JMX Threading: Thread count

The number of threads running at the current moment.

JMX jmx["java.lang:type=Threading","ThreadCount"]
JMX Threading: Total started thread count

The number of threads started since the JVM was launched.

JMX jmx["java.lang:type=Threading","TotalStartedThreadCount"]
JMX GarbageCollector: {#JMXNAME} number of collections per second

Displays the total number of collections that have occurred per second.

JMX jmx["java.lang:name={#JMXNAME},type=GarbageCollector","CollectionCount"]

Preprocessing:

- CHANGE_PER_SECOND

JMX GarbageCollector: {#JMXNAME} accumulated time spent in collection

Displays the approximate accumulated collection elapsed time, in seconds.

JMX jmx["java.lang:name={#JMXNAME},type=GarbageCollector","CollectionTime"]

Preprocessing:

- MULTIPLIER: 0.001

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Memory pool: {#JMXNAME} committed

Current memory allocated.

JMX jmx["java.lang:name={#JMXNAME},type=MemoryPool","Usage.committed"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Memory pool: {#JMXNAME} maximum size

Maximum amount of memory that can be used for memory management. This amount of memory is not guaranteed to be available if it is greater than the amount of committed memory. The Java virtual machine may fail to allocate memory even if the amount of used memory does not exceed this maximum size.

JMX jmx["java.lang:name={#JMXNAME},type=MemoryPool","Usage.max"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

JMX Memory pool: {#JMXNAME} used

Current memory usage.

JMX jmx["java.lang:name={#JMXNAME},type=MemoryPool","Usage.used"]

Triggers

Name Description Expression Severity Dependencies and additional info
Compilation: {HOST.NAME} uses suboptimal JIT compiler

-

find(/Generic Java JMX/jmx["java.lang:type=Compilation","Name"],,"like","Client")=1 INFO

Manual close: YES

Memory: Heap memory usage is high

-

min(/Generic Java JMX/jmx["java.lang:type=Memory","HeapMemoryUsage.used"],{$JMX.HEAP.MEM.USAGE.TIME})>(last(/Generic Java JMX/jmx["java.lang:type=Memory","HeapMemoryUsage.max"])*{$JMX.HEAP.MEM.USAGE.MAX}/100) and last(/Generic Java JMX/jmx["java.lang:type=Memory","HeapMemoryUsage.max"])>0 WARNING
Memory: Non-Heap memory usage is high

-

min(/Generic Java JMX/jmx["java.lang:type=Memory","NonHeapMemoryUsage.used"],{$JMX.NONHEAP.MEM.USAGE.TIME})>(last(/Generic Java JMX/jmx["java.lang:type=Memory","NonHeapMemoryUsage.max"])*{$JMX.NONHEAP.MEM.USAGE.MAX}/100) and last(/Generic Java JMX/jmx["java.lang:type=Memory","NonHeapMemoryUsage.max"])>0 WARNING
OperatingSystem: Opened file descriptor count is high

-

min(/Generic Java JMX/jmx["java.lang:type=OperatingSystem","OpenFileDescriptorCount"],{$JMX.FILE.DESCRIPTORS.TIME})>(last(/Generic Java JMX/jmx["java.lang:type=OperatingSystem","MaxFileDescriptorCount"])*{$JMX.FILE.DESCRIPTORS.MAX}/100) WARNING
OperatingSystem: Process CPU Load is high

-

min(/Generic Java JMX/jmx["java.lang:type=OperatingSystem","ProcessCpuLoad"],{$JMX.CPU.LOAD.TIME})>{$JMX.CPU.LOAD.MAX} AVERAGE
Runtime: JVM is not reachable

-

nodata(/Generic Java JMX/jmx["java.lang:type=Runtime","Uptime"],5m)=1 AVERAGE

Manual close: YES

Runtime: {HOST.NAME} runs suboptimal VM type

-

find(/Generic Java JMX/jmx["java.lang:type=Runtime","VmName"],,"like","Server")<>1 INFO

Manual close: YES

Memory pool: {#JMXNAME} memory usage is high

-

min(/Generic Java JMX/jmx["java.lang:name={#JMXNAME},type=MemoryPool","Usage.used"],{$JMX.MP.USAGE.TIME:"{#JMXNAME}"})>(last(/Generic Java JMX/jmx["java.lang:name={#JMXNAME},type=MemoryPool","Usage.max"])*{$JMX.MP.USAGE.MAX:"{#JMXNAME}"}/100) and last(/Generic Java JMX/jmx["java.lang:name={#JMXNAME},type=MemoryPool","Usage.max"])>0 WARNING

Feedback

Please report any issues with the template at https://support.zabbix.com

Articles and documentation

+ Propose new article

Didn't find integration you need?