VOOZH about

URL: https://www.zabbix.com/integrations/docker

⇱ Docker monitoring and integration with Zabbix


Propose integration

Docker

Docker is a set of platform as a service products that uses OS-level virtualization to deliver software in packages called containers.

Available solutions




This template is for Zabbix version: 7.4

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

Docker by Zabbix agent 2

Overview

The template to monitor Docker engine by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template Docker by Zabbix agent 2 — collects metrics by polling zabbix-agent2.

Requirements

Zabbix version: 7.4 and higher.

Tested versions

This template has been tested on:

  • Docker 23.0.3

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

Setup and configure Zabbix agent 2 compiled with the Docker monitoring plugin. The user by which the Zabbix agent 2 is running should have access permissions to the Docker socket.

Test availability: zabbix_get -s docker-host -k docker.info

Macros used

Name Description Default
{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

Filter of discoverable containers.

.*
{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Filter to exclude discovered containers.

CHANGE_IF_NEEDED
{$DOCKER.LLD.FILTER.IMAGE.MATCHES}

Filter of discoverable images.

.*
{$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Filter to exclude discovered images.

CHANGE_IF_NEEDED

Items

Name Description Type Key and additional info
Ping Zabbix agent docker.ping

Preprocessing

  • Discard unchanged with heartbeat: 10m

Get info Zabbix agent docker.info
Get containers Zabbix agent docker.containers
Get images Zabbix agent docker.images
Get data_usage Zabbix agent docker.data_usage
Containers total

Total number of containers on this host.

Dependent item docker.containers.total

Preprocessing

  • JSON Path: $.Containers

Containers running

Total number of containers running on this host.

Dependent item docker.containers.running

Preprocessing

  • JSON Path: $.ContainersRunning

Containers stopped

Total number of containers stopped on this host.

Dependent item docker.containers.stopped

Preprocessing

  • JSON Path: $.ContainersStopped

Containers paused

Total number of containers paused on this host.

Dependent item docker.containers.paused

Preprocessing

  • JSON Path: $.ContainersPaused

Images total

Number of images with intermediate image layers.

Dependent item docker.images.total

Preprocessing

  • JSON Path: $.Images

Storage driver

Docker storage driver.

https://docs.docker.com/storage/storagedriver/

Dependent item docker.driver

Preprocessing

  • JSON Path: $.Driver

  • Discard unchanged with heartbeat: 1d

Memory limit enabled Dependent item docker.mem_limit.enabled

Preprocessing

  • JSON Path: $.MemoryLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Swap limit enabled Dependent item docker.swap_limit.enabled

Preprocessing

  • JSON Path: $.SwapLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Kernel memory enabled Dependent item docker.kernel_mem.enabled

Preprocessing

  • JSON Path: $.KernelMemory

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Kernel memory TCP enabled Dependent item docker.kernel_mem_tcp.enabled

Preprocessing

  • JSON Path: $.KernelMemoryTCP

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU CFS Period enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_period.enabled

Preprocessing

  • JSON Path: $.CpuCfsPeriod

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU CFS Quota enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_quota.enabled

Preprocessing

  • JSON Path: $.CpuCfsQuota

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU Shares enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_shares.enabled

Preprocessing

  • JSON Path: $.CPUShares

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU Set enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_set.enabled

Preprocessing

  • JSON Path: $.CPUSet

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Pids limit enabled Dependent item docker.pids_limit.enabled

Preprocessing

  • JSON Path: $.PidsLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

IPv4 Forwarding enabled Dependent item docker.ipv4_forwarding.enabled

Preprocessing

  • JSON Path: $.IPv4Forwarding

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Debug enabled Dependent item docker.debug.enabled

Preprocessing

  • JSON Path: $.Debug

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Nfd

Number of used File Descriptors.

Dependent item docker.nfd

Preprocessing

  • JSON Path: $.NFd

OomKill disabled Dependent item docker.oomkill.disabled

Preprocessing

  • JSON Path: $.OomKillDisable

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Goroutines

Number of goroutines.

Dependent item docker.goroutines

Preprocessing

  • JSON Path: $.NGoroutines

Logging driver Dependent item docker.logging_driver

Preprocessing

  • JSON Path: $.LoggingDriver

  • Discard unchanged with heartbeat: 1d

Cgroup driver Dependent item docker.cgroup_driver

Preprocessing

  • JSON Path: $.CgroupDriver

  • Discard unchanged with heartbeat: 1d

NEvents listener Dependent item docker.nevents_listener

Preprocessing

  • JSON Path: $.NEventsListener

Kernel version Dependent item docker.kernel_version

Preprocessing

  • JSON Path: $.KernelVersion

  • Discard unchanged with heartbeat: 1d

Operating system Dependent item docker.operating_system

Preprocessing

  • JSON Path: $.OperatingSystem

  • Discard unchanged with heartbeat: 1d

OS type Dependent item docker.os_type

Preprocessing

  • JSON Path: $.OSType

  • Discard unchanged with heartbeat: 1d

Architecture Dependent item docker.architecture

Preprocessing

  • JSON Path: $.Architecture

  • Discard unchanged with heartbeat: 1d

NCPU Dependent item docker.ncpu

Preprocessing

  • JSON Path: $.NCPU

Memory total Dependent item docker.mem.total

Preprocessing

  • JSON Path: $.MemTotal

Docker root dir Dependent item docker.root_dir

Preprocessing

  • JSON Path: $.DockerRootDir

  • Discard unchanged with heartbeat: 1d

Name Dependent item docker.name

Preprocessing

  • JSON Path: $.Name

Server version Dependent item docker.server_version

Preprocessing

  • JSON Path: $.ServerVersion

  • Discard unchanged with heartbeat: 1d

Default runtime Dependent item docker.default_runtime

Preprocessing

  • JSON Path: $.DefaultRuntime

  • Discard unchanged with heartbeat: 1d

Live restore enabled Dependent item docker.live_restore.enabled

Preprocessing

  • JSON Path: $.LiveRestoreEnabled

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Layers size Dependent item docker.layers_size

Preprocessing

  • JSON Path: $.LayersSize

Images size Dependent item docker.images_size

Preprocessing

  • JSON Path: $.Images[*].Size.sum()

Containers size Dependent item docker.containers_size

Preprocessing

  • JSON Path: $.Containers[*].SizeRw.sum()

Volumes size Dependent item docker.volumes_size

Preprocessing

  • JSON Path: $.Volumes[*].UsageData.Size.sum()

Images available

Number of top-level images.

Dependent item docker.images.top_level

Preprocessing

  • JSON Path: $.length()

Triggers

Name Description Expression Severity Dependencies and additional info
Docker: Service is down last(/Docker by Zabbix agent 2/docker.ping)=0 Average Manual close: Yes
Docker: Failed to fetch info data

Zabbix has not received data for items for the last 30 minutes.

nodata(/Docker by Zabbix agent 2/docker.name,30m)=1 Warning Manual close: Yes
Depends on:
  • Docker: Service is down
Docker: Version has changed

Docker version has changed. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.server_version,#1)<>last(/Docker by Zabbix agent 2/docker.server_version,#2) and length(last(/Docker by Zabbix agent 2/docker.server_version))>0 Info Manual close: Yes

LLD rule Images discovery

Name Description Type Key and additional info
Images discovery

Discovery of images metrics.

Zabbix agent docker.images.discovery

Item prototypes for Images discovery

Name Description Type Key and additional info
Image {#NAME}: Created Dependent item docker.image.created["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Created.first()

  • Discard unchanged with heartbeat: 1d

Image {#NAME}: Size Dependent item docker.image.size["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Size.first()

LLD rule Containers discovery

Name Description Type Key and additional info
Containers discovery

Discovery of containers metrics.

Parameter:

true - Returns all containers

false - Returns only running containers

Zabbix agent docker.containers.discovery[false]

Item prototypes for Containers discovery

Name Description Type Key and additional info
Container {#NAME}: Get stats

Gets container stats based on resource usage.

Zabbix agent docker.container_stats["{#NAME}"]
Container {#NAME}: Memory usage active

Calculates the active memory usage of the container.

Calculated docker.container_stats.memory.usage_active["{#NAME}"]
Container {#NAME}: Memory usage inactive

Gets the inactive memory usage of the container.

Dependent item docker.container_stats.memory.usage_inactive["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.stats.inactive_file

Container {#NAME}: CPU total usage per second Dependent item docker.container_stats.cpu_usage.total.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.total_usage

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU percent usage Dependent item docker.container_stats.cpu_pct_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.percent_usage

Container {#NAME}: CPU kernelmode usage per second Dependent item docker.container_stats.cpu_usage.kernel.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_kernelmode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU usermode usage per second Dependent item docker.container_stats.cpu_usage.user.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_usermode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: Online CPUs Dependent item docker.container_stats.online_cpus["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.online_cpus

Container {#NAME}: Throttling periods

Number of periods with throttling active.

Dependent item docker.container_stats.cpu_usage.throttling_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.periods

Container {#NAME}: Throttled periods

Number of periods when the container hits its throttling limit.

Dependent item docker.container_stats.cpu_usage.throttled_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_periods

Container {#NAME}: Throttled time

Aggregate time the container was throttled for in nanoseconds.

Dependent item docker.container_stats.cpu_usage.throttled_time["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_time

  • Custom multiplier: 1.0E-9

Container {#NAME}: Memory usage total

Gets the total memory usage (inactive, active) from the container.

Dependent item docker.container_stats.memory.usage_total["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.usage

Container {#NAME}: Memory maximum usage Dependent item docker.container_stats.memory.max_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.max_usage

Container {#NAME}: Memory commit bytes Dependent item docker.container_stats.memory.commit_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitbytes

Container {#NAME}: Memory commit peak bytes Dependent item docker.container_stats.memory.commit_peak_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitpeakbytes

Container {#NAME}: Memory private working set Dependent item docker.container_stats.memory.private_working_set["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.privateworkingset

Container {#NAME}: Current PIDs count

Current number of PIDs the container has created.

Dependent item docker.container_stats.pids_stats.current["{#NAME}"]

Preprocessing

  • JSON Path: $.pids_stats.current

Container {#NAME}: Networks bytes received per second Dependent item docker.networks.rx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets received per second Dependent item docker.networks.rx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors received per second Dependent item docker.networks.rx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks incoming packets dropped per second Dependent item docker.networks.rx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks bytes sent per second Dependent item docker.networks.tx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets sent per second Dependent item docker.networks.tx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors sent per second Dependent item docker.networks.tx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks outgoing packets dropped per second Dependent item docker.networks.tx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Get info

Returns low-level information about a container.

Zabbix agent docker.container_info["{#NAME}",full]
Container {#NAME}: Created Dependent item docker.container_info.created["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Image Dependent item docker.container_info.image["{#NAME}"]

Preprocessing

  • JSON Path: $[?(@.Names[0] == "{#NAME}")].Image.first()

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Restart count Dependent item docker.container_info.restart_count["{#NAME}"]

Preprocessing

  • JSON Path: $.RestartCount

Container {#NAME}: Status Dependent item docker.container_info.state.status["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Status

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Health status

Container's HEALTHCHECK.

Dependent item docker.container_info.state.health["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • In range: 1 -> 4

    ⛔️Custom on fail: Set value to: 4

Container {#NAME}: Health failing streak Dependent item docker.container_info.state.health.failing["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Health.FailingStreak

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Running Dependent item docker.container_info.state.running["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Running

  • Boolean to decimal
Container {#NAME}: Paused Dependent item docker.container_info.state.paused["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Paused

  • Boolean to decimal
Container {#NAME}: Restarting Dependent item docker.container_info.state.restarting["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Restarting

  • Boolean to decimal
Container {#NAME}: OOMKilled Dependent item docker.container_info.state.oomkilled["{#NAME}"]

Preprocessing

  • JSON Path: $.State.OOMKilled

  • Boolean to decimal
Container {#NAME}: Dead Dependent item docker.container_info.state.dead["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Dead

  • Boolean to decimal
Container {#NAME}: Pid Dependent item docker.container_info.state.pid["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Pid

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Exit code Dependent item docker.container_info.state.exitcode["{#NAME}"]

Preprocessing

  • JSON Path: $.State.ExitCode

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Error Dependent item docker.container_info.state.error["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Error

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Started at Dependent item docker.container_info.started["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Finished at

Time at which the container last terminated.

Dependent item docker.container_info.finished["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Trigger prototypes for Containers discovery

Name Description Expression Severity Dependencies and additional info
Docker: Container {#NAME}: Health state container is unhealthy

Container health state is unhealthy.

count(/Docker by Zabbix agent 2/docker.container_info.state.health["{#NAME}"],2m,,2)>=2 High
Docker: Container {#NAME}: Container has been stopped with error code last(/Docker by Zabbix agent 2/docker.container_info.state.exitcode["{#NAME}"])>0 and last(/Docker by Zabbix agent 2/docker.container_info.state.running["{#NAME}"])=0 Average Manual close: Yes
Docker: Container {#NAME}: An error has occurred in the container

Container {#NAME} has an error. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#1)<>last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#2) and length(last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"]))>0 Warning 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 at ZABBIX forums

This template is for Zabbix version: 7.2

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

Docker by Zabbix agent 2

Overview

The template to monitor Docker engine by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template Docker by Zabbix agent 2 — collects metrics by polling zabbix-agent2.

Requirements

Zabbix version: 7.2 and higher.

Tested versions

This template has been tested on:

  • Docker 23.0.3

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

Setup and configure Zabbix agent 2 compiled with the Docker monitoring plugin. The user by which the Zabbix agent 2 is running should have access permissions to the Docker socket.

Test availability: zabbix_get -s docker-host -k docker.info

Macros used

Name Description Default
{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

Filter of discoverable containers.

.*
{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Filter to exclude discovered containers.

CHANGE_IF_NEEDED
{$DOCKER.LLD.FILTER.IMAGE.MATCHES}

Filter of discoverable images.

.*
{$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Filter to exclude discovered images.

CHANGE_IF_NEEDED

Items

Name Description Type Key and additional info
Ping Zabbix agent docker.ping

Preprocessing

  • Discard unchanged with heartbeat: 10m

Get info Zabbix agent docker.info
Get containers Zabbix agent docker.containers
Get images Zabbix agent docker.images
Get data_usage Zabbix agent docker.data_usage
Containers total

Total number of containers on this host.

Dependent item docker.containers.total

Preprocessing

  • JSON Path: $.Containers

Containers running

Total number of containers running on this host.

Dependent item docker.containers.running

Preprocessing

  • JSON Path: $.ContainersRunning

Containers stopped

Total number of containers stopped on this host.

Dependent item docker.containers.stopped

Preprocessing

  • JSON Path: $.ContainersStopped

Containers paused

Total number of containers paused on this host.

Dependent item docker.containers.paused

Preprocessing

  • JSON Path: $.ContainersPaused

Images total

Number of images with intermediate image layers.

Dependent item docker.images.total

Preprocessing

  • JSON Path: $.Images

Storage driver

Docker storage driver.

https://docs.docker.com/storage/storagedriver/

Dependent item docker.driver

Preprocessing

  • JSON Path: $.Driver

  • Discard unchanged with heartbeat: 1d

Memory limit enabled Dependent item docker.mem_limit.enabled

Preprocessing

  • JSON Path: $.MemoryLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Swap limit enabled Dependent item docker.swap_limit.enabled

Preprocessing

  • JSON Path: $.SwapLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Kernel memory enabled Dependent item docker.kernel_mem.enabled

Preprocessing

  • JSON Path: $.KernelMemory

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Kernel memory TCP enabled Dependent item docker.kernel_mem_tcp.enabled

Preprocessing

  • JSON Path: $.KernelMemoryTCP

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU CFS Period enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_period.enabled

Preprocessing

  • JSON Path: $.CpuCfsPeriod

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU CFS Quota enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_quota.enabled

Preprocessing

  • JSON Path: $.CpuCfsQuota

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU Shares enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_shares.enabled

Preprocessing

  • JSON Path: $.CPUShares

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU Set enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_set.enabled

Preprocessing

  • JSON Path: $.CPUSet

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Pids limit enabled Dependent item docker.pids_limit.enabled

Preprocessing

  • JSON Path: $.PidsLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

IPv4 Forwarding enabled Dependent item docker.ipv4_forwarding.enabled

Preprocessing

  • JSON Path: $.IPv4Forwarding

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Debug enabled Dependent item docker.debug.enabled

Preprocessing

  • JSON Path: $.Debug

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Nfd

Number of used File Descriptors.

Dependent item docker.nfd

Preprocessing

  • JSON Path: $.NFd

OomKill disabled Dependent item docker.oomkill.disabled

Preprocessing

  • JSON Path: $.OomKillDisable

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Goroutines

Number of goroutines.

Dependent item docker.goroutines

Preprocessing

  • JSON Path: $.NGoroutines

Logging driver Dependent item docker.logging_driver

Preprocessing

  • JSON Path: $.LoggingDriver

  • Discard unchanged with heartbeat: 1d

Cgroup driver Dependent item docker.cgroup_driver

Preprocessing

  • JSON Path: $.CgroupDriver

  • Discard unchanged with heartbeat: 1d

NEvents listener Dependent item docker.nevents_listener

Preprocessing

  • JSON Path: $.NEventsListener

Kernel version Dependent item docker.kernel_version

Preprocessing

  • JSON Path: $.KernelVersion

  • Discard unchanged with heartbeat: 1d

Operating system Dependent item docker.operating_system

Preprocessing

  • JSON Path: $.OperatingSystem

  • Discard unchanged with heartbeat: 1d

OS type Dependent item docker.os_type

Preprocessing

  • JSON Path: $.OSType

  • Discard unchanged with heartbeat: 1d

Architecture Dependent item docker.architecture

Preprocessing

  • JSON Path: $.Architecture

  • Discard unchanged with heartbeat: 1d

NCPU Dependent item docker.ncpu

Preprocessing

  • JSON Path: $.NCPU

Memory total Dependent item docker.mem.total

Preprocessing

  • JSON Path: $.MemTotal

Docker root dir Dependent item docker.root_dir

Preprocessing

  • JSON Path: $.DockerRootDir

  • Discard unchanged with heartbeat: 1d

Name Dependent item docker.name

Preprocessing

  • JSON Path: $.Name

Server version Dependent item docker.server_version

Preprocessing

  • JSON Path: $.ServerVersion

  • Discard unchanged with heartbeat: 1d

Default runtime Dependent item docker.default_runtime

Preprocessing

  • JSON Path: $.DefaultRuntime

  • Discard unchanged with heartbeat: 1d

Live restore enabled Dependent item docker.live_restore.enabled

Preprocessing

  • JSON Path: $.LiveRestoreEnabled

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Layers size Dependent item docker.layers_size

Preprocessing

  • JSON Path: $.LayersSize

Images size Dependent item docker.images_size

Preprocessing

  • JSON Path: $.Images[*].Size.sum()

Containers size Dependent item docker.containers_size

Preprocessing

  • JSON Path: $.Containers[*].SizeRw.sum()

Volumes size Dependent item docker.volumes_size

Preprocessing

  • JSON Path: $.Volumes[*].UsageData.Size.sum()

Images available

Number of top-level images.

Dependent item docker.images.top_level

Preprocessing

  • JSON Path: $.length()

Triggers

Name Description Expression Severity Dependencies and additional info
Docker: Service is down last(/Docker by Zabbix agent 2/docker.ping)=0 Average Manual close: Yes
Docker: Failed to fetch info data

Zabbix has not received data for items for the last 30 minutes.

nodata(/Docker by Zabbix agent 2/docker.name,30m)=1 Warning Manual close: Yes
Depends on:
  • Docker: Service is down
Docker: Version has changed

Docker version has changed. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.server_version,#1)<>last(/Docker by Zabbix agent 2/docker.server_version,#2) and length(last(/Docker by Zabbix agent 2/docker.server_version))>0 Info Manual close: Yes

LLD rule Images discovery

Name Description Type Key and additional info
Images discovery

Discovery of images metrics.

Zabbix agent docker.images.discovery

Item prototypes for Images discovery

Name Description Type Key and additional info
Image {#NAME}: Created Dependent item docker.image.created["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Created.first()

  • Discard unchanged with heartbeat: 1d

Image {#NAME}: Size Dependent item docker.image.size["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Size.first()

LLD rule Containers discovery

Name Description Type Key and additional info
Containers discovery

Discovery of containers metrics.

Parameter:

true - Returns all containers

false - Returns only running containers

Zabbix agent docker.containers.discovery[false]

Item prototypes for Containers discovery

Name Description Type Key and additional info
Container {#NAME}: Get stats

Get container stats based on resource usage.

Zabbix agent docker.container_stats["{#NAME}"]
Container {#NAME}: CPU total usage per second Dependent item docker.container_stats.cpu_usage.total.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.total_usage

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU percent usage Dependent item docker.container_stats.cpu_pct_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.percent_usage

Container {#NAME}: CPU kernelmode usage per second Dependent item docker.container_stats.cpu_usage.kernel.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_kernelmode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU usermode usage per second Dependent item docker.container_stats.cpu_usage.user.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_usermode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: Online CPUs Dependent item docker.container_stats.online_cpus["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.online_cpus

Container {#NAME}: Throttling periods

Number of periods with throttling active.

Dependent item docker.container_stats.cpu_usage.throttling_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.periods

Container {#NAME}: Throttled periods

Number of periods when the container hits its throttling limit.

Dependent item docker.container_stats.cpu_usage.throttled_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_periods

Container {#NAME}: Throttled time

Aggregate time the container was throttled for in nanoseconds.

Dependent item docker.container_stats.cpu_usage.throttled_time["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_time

  • Custom multiplier: 1.0E-9

Container {#NAME}: Memory usage Dependent item docker.container_stats.memory.usage["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.usage

Container {#NAME}: Memory maximum usage Dependent item docker.container_stats.memory.max_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.max_usage

Container {#NAME}: Memory commit bytes Dependent item docker.container_stats.memory.commit_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitbytes

Container {#NAME}: Memory commit peak bytes Dependent item docker.container_stats.memory.commit_peak_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitpeakbytes

Container {#NAME}: Memory private working set Dependent item docker.container_stats.memory.private_working_set["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.privateworkingset

Container {#NAME}: Current PIDs count

Current number of PIDs the container has created.

Dependent item docker.container_stats.pids_stats.current["{#NAME}"]

Preprocessing

  • JSON Path: $.pids_stats.current

Container {#NAME}: Networks bytes received per second Dependent item docker.networks.rx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets received per second Dependent item docker.networks.rx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors received per second Dependent item docker.networks.rx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks incoming packets dropped per second Dependent item docker.networks.rx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks bytes sent per second Dependent item docker.networks.tx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets sent per second Dependent item docker.networks.tx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors sent per second Dependent item docker.networks.tx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks outgoing packets dropped per second Dependent item docker.networks.tx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Get info

Return low-level information about a container.

Zabbix agent docker.container_info["{#NAME}",full]
Container {#NAME}: Created Dependent item docker.container_info.created["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Image Dependent item docker.container_info.image["{#NAME}"]

Preprocessing

  • JSON Path: $[?(@.Names[0] == "{#NAME}")].Image.first()

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Restart count Dependent item docker.container_info.restart_count["{#NAME}"]

Preprocessing

  • JSON Path: $.RestartCount

Container {#NAME}: Status Dependent item docker.container_info.state.status["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Status

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Health status

Container's HEALTHCHECK.

Dependent item docker.container_info.state.health["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • In range: 1 -> 4

    ⛔️Custom on fail: Set value to: 4

Container {#NAME}: Health failing streak Dependent item docker.container_info.state.health.failing["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Health.FailingStreak

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Running Dependent item docker.container_info.state.running["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Running

  • Boolean to decimal
Container {#NAME}: Paused Dependent item docker.container_info.state.paused["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Paused

  • Boolean to decimal
Container {#NAME}: Restarting Dependent item docker.container_info.state.restarting["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Restarting

  • Boolean to decimal
Container {#NAME}: OOMKilled Dependent item docker.container_info.state.oomkilled["{#NAME}"]

Preprocessing

  • JSON Path: $.State.OOMKilled

  • Boolean to decimal
Container {#NAME}: Dead Dependent item docker.container_info.state.dead["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Dead

  • Boolean to decimal
Container {#NAME}: Pid Dependent item docker.container_info.state.pid["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Pid

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Exit code Dependent item docker.container_info.state.exitcode["{#NAME}"]

Preprocessing

  • JSON Path: $.State.ExitCode

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Error Dependent item docker.container_info.state.error["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Error

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Started at Dependent item docker.container_info.started["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Finished at

Time at which the container last terminated.

Dependent item docker.container_info.finished["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Trigger prototypes for Containers discovery

Name Description Expression Severity Dependencies and additional info
Docker: Container {#NAME}: Health state container is unhealthy

Container health state is unhealthy.

count(/Docker by Zabbix agent 2/docker.container_info.state.health["{#NAME}"],2m,,2)>=2 High
Docker: Container {#NAME}: Container has been stopped with error code last(/Docker by Zabbix agent 2/docker.container_info.state.exitcode["{#NAME}"])>0 and last(/Docker by Zabbix agent 2/docker.container_info.state.running["{#NAME}"])=0 Average Manual close: Yes
Docker: Container {#NAME}: An error has occurred in the container

Container {#NAME} has an error. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#1)<>last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#2) and length(last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"]))>0 Warning 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 at ZABBIX forums

This template is for Zabbix version: 7.0

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

Docker by Zabbix agent 2

Overview

The template to monitor Docker engine by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template Docker by Zabbix agent 2 — collects metrics by polling zabbix-agent2.

Requirements

Zabbix version: 7.0 and higher.

Tested versions

This template has been tested on:

  • Docker 23.0.3

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

Setup and configure Zabbix agent 2 compiled with the Docker monitoring plugin. The user by which the Zabbix agent 2 is running should have access permissions to the Docker socket.

Test availability: zabbix_get -s docker-host -k docker.info

Macros used

Name Description Default
{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

Filter of discoverable containers.

.*
{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Filter to exclude discovered containers.

CHANGE_IF_NEEDED
{$DOCKER.LLD.FILTER.IMAGE.MATCHES}

Filter of discoverable images.

.*
{$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Filter to exclude discovered images.

CHANGE_IF_NEEDED

Items

Name Description Type Key and additional info
Ping Zabbix agent docker.ping

Preprocessing

  • Discard unchanged with heartbeat: 10m

Get info Zabbix agent docker.info
Get containers Zabbix agent docker.containers
Get images Zabbix agent docker.images
Get data_usage Zabbix agent docker.data_usage
Containers total

Total number of containers on this host.

Dependent item docker.containers.total

Preprocessing

  • JSON Path: $.Containers

Containers running

Total number of containers running on this host.

Dependent item docker.containers.running

Preprocessing

  • JSON Path: $.ContainersRunning

Containers stopped

Total number of containers stopped on this host.

Dependent item docker.containers.stopped

Preprocessing

  • JSON Path: $.ContainersStopped

Containers paused

Total number of containers paused on this host.

Dependent item docker.containers.paused

Preprocessing

  • JSON Path: $.ContainersPaused

Images total

Number of images with intermediate image layers.

Dependent item docker.images.total

Preprocessing

  • JSON Path: $.Images

Storage driver

Docker storage driver.

https://docs.docker.com/storage/storagedriver/

Dependent item docker.driver

Preprocessing

  • JSON Path: $.Driver

  • Discard unchanged with heartbeat: 1d

Memory limit enabled Dependent item docker.mem_limit.enabled

Preprocessing

  • JSON Path: $.MemoryLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Swap limit enabled Dependent item docker.swap_limit.enabled

Preprocessing

  • JSON Path: $.SwapLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Kernel memory enabled Dependent item docker.kernel_mem.enabled

Preprocessing

  • JSON Path: $.KernelMemory

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Kernel memory TCP enabled Dependent item docker.kernel_mem_tcp.enabled

Preprocessing

  • JSON Path: $.KernelMemoryTCP

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU CFS Period enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_period.enabled

Preprocessing

  • JSON Path: $.CpuCfsPeriod

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU CFS Quota enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_quota.enabled

Preprocessing

  • JSON Path: $.CpuCfsQuota

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU Shares enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_shares.enabled

Preprocessing

  • JSON Path: $.CPUShares

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

CPU Set enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_set.enabled

Preprocessing

  • JSON Path: $.CPUSet

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Pids limit enabled Dependent item docker.pids_limit.enabled

Preprocessing

  • JSON Path: $.PidsLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

IPv4 Forwarding enabled Dependent item docker.ipv4_forwarding.enabled

Preprocessing

  • JSON Path: $.IPv4Forwarding

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Debug enabled Dependent item docker.debug.enabled

Preprocessing

  • JSON Path: $.Debug

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Nfd

Number of used File Descriptors.

Dependent item docker.nfd

Preprocessing

  • JSON Path: $.NFd

OomKill disabled Dependent item docker.oomkill.disabled

Preprocessing

  • JSON Path: $.OomKillDisable

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Goroutines

Number of goroutines.

Dependent item docker.goroutines

Preprocessing

  • JSON Path: $.NGoroutines

Logging driver Dependent item docker.logging_driver

Preprocessing

  • JSON Path: $.LoggingDriver

  • Discard unchanged with heartbeat: 1d

Cgroup driver Dependent item docker.cgroup_driver

Preprocessing

  • JSON Path: $.CgroupDriver

  • Discard unchanged with heartbeat: 1d

NEvents listener Dependent item docker.nevents_listener

Preprocessing

  • JSON Path: $.NEventsListener

Kernel version Dependent item docker.kernel_version

Preprocessing

  • JSON Path: $.KernelVersion

  • Discard unchanged with heartbeat: 1d

Operating system Dependent item docker.operating_system

Preprocessing

  • JSON Path: $.OperatingSystem

  • Discard unchanged with heartbeat: 1d

OS type Dependent item docker.os_type

Preprocessing

  • JSON Path: $.OSType

  • Discard unchanged with heartbeat: 1d

Architecture Dependent item docker.architecture

Preprocessing

  • JSON Path: $.Architecture

  • Discard unchanged with heartbeat: 1d

NCPU Dependent item docker.ncpu

Preprocessing

  • JSON Path: $.NCPU

Memory total Dependent item docker.mem.total

Preprocessing

  • JSON Path: $.MemTotal

Docker root dir Dependent item docker.root_dir

Preprocessing

  • JSON Path: $.DockerRootDir

  • Discard unchanged with heartbeat: 1d

Name Dependent item docker.name

Preprocessing

  • JSON Path: $.Name

Server version Dependent item docker.server_version

Preprocessing

  • JSON Path: $.ServerVersion

  • Discard unchanged with heartbeat: 1d

Default runtime Dependent item docker.default_runtime

Preprocessing

  • JSON Path: $.DefaultRuntime

  • Discard unchanged with heartbeat: 1d

Live restore enabled Dependent item docker.live_restore.enabled

Preprocessing

  • JSON Path: $.LiveRestoreEnabled

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Layers size Dependent item docker.layers_size

Preprocessing

  • JSON Path: $.LayersSize

Images size Dependent item docker.images_size

Preprocessing

  • JSON Path: $.Images[*].Size.sum()

Containers size Dependent item docker.containers_size

Preprocessing

  • JSON Path: $.Containers[*].SizeRw.sum()

Volumes size Dependent item docker.volumes_size

Preprocessing

  • JSON Path: $.Volumes[*].UsageData.Size.sum()

Images available

Number of top-level images.

Dependent item docker.images.top_level

Preprocessing

  • JSON Path: $.length()

Triggers

Name Description Expression Severity Dependencies and additional info
Docker: Service is down last(/Docker by Zabbix agent 2/docker.ping)=0 Average Manual close: Yes
Docker: Failed to fetch info data

Zabbix has not received data for items for the last 30 minutes.

nodata(/Docker by Zabbix agent 2/docker.name,30m)=1 Warning Manual close: Yes
Depends on:
  • Docker: Service is down
Docker: Version has changed

Docker version has changed. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.server_version,#1)<>last(/Docker by Zabbix agent 2/docker.server_version,#2) and length(last(/Docker by Zabbix agent 2/docker.server_version))>0 Info Manual close: Yes

LLD rule Images discovery

Name Description Type Key and additional info
Images discovery

Discovery of images metrics.

Zabbix agent docker.images.discovery

Item prototypes for Images discovery

Name Description Type Key and additional info
Image {#NAME}: Created Dependent item docker.image.created["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Created.first()

  • Discard unchanged with heartbeat: 1d

Image {#NAME}: Size Dependent item docker.image.size["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Size.first()

LLD rule Containers discovery

Name Description Type Key and additional info
Containers discovery

Discovery of containers metrics.

Parameter:

true - Returns all containers

false - Returns only running containers

Zabbix agent docker.containers.discovery[false]

Item prototypes for Containers discovery

Name Description Type Key and additional info
Container {#NAME}: Get stats

Gets container stats based on resource usage.

Zabbix agent docker.container_stats["{#NAME}"]
Container {#NAME}: Memory usage active

Calculates the active memory usage of the container.

Calculated docker.container_stats.memory.usage_active["{#NAME}"]
Container {#NAME}: Memory usage inactive

Gets the inactive memory usage of the container.

Dependent item docker.container_stats.memory.usage_inactive["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.stats.inactive_file

Container {#NAME}: CPU total usage per second Dependent item docker.container_stats.cpu_usage.total.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.total_usage

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU percent usage Dependent item docker.container_stats.cpu_pct_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.percent_usage

Container {#NAME}: CPU kernelmode usage per second Dependent item docker.container_stats.cpu_usage.kernel.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_kernelmode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU usermode usage per second Dependent item docker.container_stats.cpu_usage.user.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_usermode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: Online CPUs Dependent item docker.container_stats.online_cpus["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.online_cpus

Container {#NAME}: Throttling periods

Number of periods with throttling active.

Dependent item docker.container_stats.cpu_usage.throttling_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.periods

Container {#NAME}: Throttled periods

Number of periods when the container hits its throttling limit.

Dependent item docker.container_stats.cpu_usage.throttled_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_periods

Container {#NAME}: Throttled time

Aggregate time the container was throttled for in nanoseconds.

Dependent item docker.container_stats.cpu_usage.throttled_time["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_time

  • Custom multiplier: 1.0E-9

Container {#NAME}: Memory usage total

Gets the total memory usage (inactive, active) from the container.

Dependent item docker.container_stats.memory.usage_total["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.usage

Container {#NAME}: Memory maximum usage Dependent item docker.container_stats.memory.max_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.max_usage

Container {#NAME}: Memory commit bytes Dependent item docker.container_stats.memory.commit_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitbytes

Container {#NAME}: Memory commit peak bytes Dependent item docker.container_stats.memory.commit_peak_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitpeakbytes

Container {#NAME}: Memory private working set Dependent item docker.container_stats.memory.private_working_set["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.privateworkingset

Container {#NAME}: Current PIDs count

Current number of PIDs the container has created.

Dependent item docker.container_stats.pids_stats.current["{#NAME}"]

Preprocessing

  • JSON Path: $.pids_stats.current

Container {#NAME}: Networks bytes received per second Dependent item docker.networks.rx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets received per second Dependent item docker.networks.rx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors received per second Dependent item docker.networks.rx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks incoming packets dropped per second Dependent item docker.networks.rx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks bytes sent per second Dependent item docker.networks.tx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets sent per second Dependent item docker.networks.tx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors sent per second Dependent item docker.networks.tx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks outgoing packets dropped per second Dependent item docker.networks.tx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Get info

Returns low-level information about a container.

Zabbix agent docker.container_info["{#NAME}",full]
Container {#NAME}: Created Dependent item docker.container_info.created["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Image Dependent item docker.container_info.image["{#NAME}"]

Preprocessing

  • JSON Path: $[?(@.Names[0] == "{#NAME}")].Image.first()

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Restart count Dependent item docker.container_info.restart_count["{#NAME}"]

Preprocessing

  • JSON Path: $.RestartCount

Container {#NAME}: Status Dependent item docker.container_info.state.status["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Status

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Health status

Container's HEALTHCHECK.

Dependent item docker.container_info.state.health["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • In range: 1 -> 4

    ⛔️Custom on fail: Set value to: 4

Container {#NAME}: Health failing streak Dependent item docker.container_info.state.health.failing["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Health.FailingStreak

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Running Dependent item docker.container_info.state.running["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Running

  • Boolean to decimal
Container {#NAME}: Paused Dependent item docker.container_info.state.paused["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Paused

  • Boolean to decimal
Container {#NAME}: Restarting Dependent item docker.container_info.state.restarting["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Restarting

  • Boolean to decimal
Container {#NAME}: OOMKilled Dependent item docker.container_info.state.oomkilled["{#NAME}"]

Preprocessing

  • JSON Path: $.State.OOMKilled

  • Boolean to decimal
Container {#NAME}: Dead Dependent item docker.container_info.state.dead["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Dead

  • Boolean to decimal
Container {#NAME}: Pid Dependent item docker.container_info.state.pid["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Pid

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Exit code Dependent item docker.container_info.state.exitcode["{#NAME}"]

Preprocessing

  • JSON Path: $.State.ExitCode

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Error Dependent item docker.container_info.state.error["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Error

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Started at Dependent item docker.container_info.started["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Finished at

Time at which the container last terminated.

Dependent item docker.container_info.finished["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Trigger prototypes for Containers discovery

Name Description Expression Severity Dependencies and additional info
Docker: Container {#NAME}: Health state container is unhealthy

Container health state is unhealthy.

count(/Docker by Zabbix agent 2/docker.container_info.state.health["{#NAME}"],2m,,2)>=2 High
Docker: Container {#NAME}: Container has been stopped with error code last(/Docker by Zabbix agent 2/docker.container_info.state.exitcode["{#NAME}"])>0 and last(/Docker by Zabbix agent 2/docker.container_info.state.running["{#NAME}"])=0 Average Manual close: Yes
Docker: Container {#NAME}: An error has occurred in the container

Container {#NAME} has an error. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#1)<>last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#2) and length(last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"]))>0 Warning 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 at ZABBIX forums

This template is for Zabbix version: 6.4

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

Docker by Zabbix agent 2

Overview

The template to monitor Docker engine by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template Docker by Zabbix agent 2 — collects metrics by polling zabbix-agent2.

Requirements

Zabbix version: 6.4 and higher.

Tested versions

This template has been tested on:

  • Docker 23.0.3

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

Setup and configure Zabbix agent 2 compiled with the Docker monitoring plugin. The user by which the Zabbix agent 2 is running should have access permissions to the Docker socket.

Test availability: zabbix_get -s docker-host -k docker.info

Macros used

Name Description Default
{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

Filter of discoverable containers.

.*
{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Filter to exclude discovered containers.

CHANGE_IF_NEEDED
{$DOCKER.LLD.FILTER.IMAGE.MATCHES}

Filter of discoverable images.

.*
{$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Filter to exclude discovered images.

CHANGE_IF_NEEDED

Items

Name Description Type Key and additional info
Docker: Ping Zabbix agent docker.ping

Preprocessing

  • Discard unchanged with heartbeat: 10m

Docker: Get info Zabbix agent docker.info
Docker: Get containers Zabbix agent docker.containers
Docker: Get images Zabbix agent docker.images
Docker: Get data_usage Zabbix agent docker.data_usage
Docker: Containers total

Total number of containers on this host.

Dependent item docker.containers.total

Preprocessing

  • JSON Path: $.Containers

Docker: Containers running

Total number of containers running on this host.

Dependent item docker.containers.running

Preprocessing

  • JSON Path: $.ContainersRunning

Docker: Containers stopped

Total number of containers stopped on this host.

Dependent item docker.containers.stopped

Preprocessing

  • JSON Path: $.ContainersStopped

Docker: Containers paused

Total number of containers paused on this host.

Dependent item docker.containers.paused

Preprocessing

  • JSON Path: $.ContainersPaused

Docker: Images total

Number of images with intermediate image layers.

Dependent item docker.images.total

Preprocessing

  • JSON Path: $.Images

Docker: Storage driver

Docker storage driver.

https://docs.docker.com/storage/storagedriver/

Dependent item docker.driver

Preprocessing

  • JSON Path: $.Driver

  • Discard unchanged with heartbeat: 1d

Docker: Memory limit enabled Dependent item docker.mem_limit.enabled

Preprocessing

  • JSON Path: $.MemoryLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Swap limit enabled Dependent item docker.swap_limit.enabled

Preprocessing

  • JSON Path: $.SwapLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Kernel memory enabled Dependent item docker.kernel_mem.enabled

Preprocessing

  • JSON Path: $.KernelMemory

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Kernel memory TCP enabled Dependent item docker.kernel_mem_tcp.enabled

Preprocessing

  • JSON Path: $.KernelMemoryTCP

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: CPU CFS Period enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_period.enabled

Preprocessing

  • JSON Path: $.CpuCfsPeriod

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: CPU CFS Quota enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_quota.enabled

Preprocessing

  • JSON Path: $.CpuCfsQuota

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: CPU Shares enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_shares.enabled

Preprocessing

  • JSON Path: $.CPUShares

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: CPU Set enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_set.enabled

Preprocessing

  • JSON Path: $.CPUSet

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Pids limit enabled Dependent item docker.pids_limit.enabled

Preprocessing

  • JSON Path: $.PidsLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: IPv4 Forwarding enabled Dependent item docker.ipv4_forwarding.enabled

Preprocessing

  • JSON Path: $.IPv4Forwarding

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Debug enabled Dependent item docker.debug.enabled

Preprocessing

  • JSON Path: $.Debug

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Nfd

Number of used File Descriptors.

Dependent item docker.nfd

Preprocessing

  • JSON Path: $.NFd

Docker: OomKill disabled Dependent item docker.oomkill.disabled

Preprocessing

  • JSON Path: $.OomKillDisable

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Goroutines

Number of goroutines.

Dependent item docker.goroutines

Preprocessing

  • JSON Path: $.NGoroutines

Docker: Logging driver Dependent item docker.logging_driver

Preprocessing

  • JSON Path: $.LoggingDriver

  • Discard unchanged with heartbeat: 1d

Docker: Cgroup driver Dependent item docker.cgroup_driver

Preprocessing

  • JSON Path: $.CgroupDriver

  • Discard unchanged with heartbeat: 1d

Docker: NEvents listener Dependent item docker.nevents_listener

Preprocessing

  • JSON Path: $.NEventsListener

Docker: Kernel version Dependent item docker.kernel_version

Preprocessing

  • JSON Path: $.KernelVersion

  • Discard unchanged with heartbeat: 1d

Docker: Operating system Dependent item docker.operating_system

Preprocessing

  • JSON Path: $.OperatingSystem

  • Discard unchanged with heartbeat: 1d

Docker: OS type Dependent item docker.os_type

Preprocessing

  • JSON Path: $.OSType

  • Discard unchanged with heartbeat: 1d

Docker: Architecture Dependent item docker.architecture

Preprocessing

  • JSON Path: $.Architecture

  • Discard unchanged with heartbeat: 1d

Docker: NCPU Dependent item docker.ncpu

Preprocessing

  • JSON Path: $.NCPU

Docker: Memory total Dependent item docker.mem.total

Preprocessing

  • JSON Path: $.MemTotal

Docker: Docker root dir Dependent item docker.root_dir

Preprocessing

  • JSON Path: $.DockerRootDir

  • Discard unchanged with heartbeat: 1d

Docker: Name Dependent item docker.name

Preprocessing

  • JSON Path: $.Name

Docker: Server version Dependent item docker.server_version

Preprocessing

  • JSON Path: $.ServerVersion

  • Discard unchanged with heartbeat: 1d

Docker: Default runtime Dependent item docker.default_runtime

Preprocessing

  • JSON Path: $.DefaultRuntime

  • Discard unchanged with heartbeat: 1d

Docker: Live restore enabled Dependent item docker.live_restore.enabled

Preprocessing

  • JSON Path: $.LiveRestoreEnabled

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Layers size Dependent item docker.layers_size

Preprocessing

  • JSON Path: $.LayersSize

Docker: Images size Dependent item docker.images_size

Preprocessing

  • JSON Path: $.Images[*].Size.sum()

Docker: Containers size Dependent item docker.containers_size

Preprocessing

  • JSON Path: $.Containers[*].SizeRw.sum()

Docker: Volumes size Dependent item docker.volumes_size

Preprocessing

  • JSON Path: $.Volumes[*].UsageData.Size.sum()

Docker: Images available

Number of top-level images.

Dependent item docker.images.top_level

Preprocessing

  • JSON Path: $.length()

Triggers

Name Description Expression Severity Dependencies and additional info
Docker: Service is down last(/Docker by Zabbix agent 2/docker.ping)=0 Average Manual close: Yes
Docker: Failed to fetch info data

Zabbix has not received data for items for the last 30 minutes.

nodata(/Docker by Zabbix agent 2/docker.name,30m)=1 Warning Manual close: Yes
Depends on:
  • Docker: Service is down
Docker: Version has changed

Docker version has changed. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.server_version,#1)<>last(/Docker by Zabbix agent 2/docker.server_version,#2) and length(last(/Docker by Zabbix agent 2/docker.server_version))>0 Info Manual close: Yes

LLD rule Images discovery

Name Description Type Key and additional info
Images discovery

Discovery of images metrics.

Zabbix agent docker.images.discovery

Item prototypes for Images discovery

Name Description Type Key and additional info
Image {#NAME}: Created Dependent item docker.image.created["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Created.first()

  • Discard unchanged with heartbeat: 1d

Image {#NAME}: Size Dependent item docker.image.size["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Size.first()

LLD rule Containers discovery

Name Description Type Key and additional info
Containers discovery

Discovery of containers metrics.

Parameter:

true - Returns all containers

false - Returns only running containers

Zabbix agent docker.containers.discovery[false]

Item prototypes for Containers discovery

Name Description Type Key and additional info
Container {#NAME}: Get stats

Get container stats based on resource usage.

Zabbix agent docker.container_stats["{#NAME}"]
Container {#NAME}: CPU total usage per second Dependent item docker.container_stats.cpu_usage.total.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.total_usage

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU percent usage Dependent item docker.container_stats.cpu_pct_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.percent_usage

Container {#NAME}: CPU kernelmode usage per second Dependent item docker.container_stats.cpu_usage.kernel.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_kernelmode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU usermode usage per second Dependent item docker.container_stats.cpu_usage.user.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_usermode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: Online CPUs Dependent item docker.container_stats.online_cpus["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.online_cpus

Container {#NAME}: Throttling periods

Number of periods with throttling active.

Dependent item docker.container_stats.cpu_usage.throttling_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.periods

Container {#NAME}: Throttled periods

Number of periods when the container hits its throttling limit.

Dependent item docker.container_stats.cpu_usage.throttled_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_periods

Container {#NAME}: Throttled time

Aggregate time the container was throttled for in nanoseconds.

Dependent item docker.container_stats.cpu_usage.throttled_time["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_time

  • Custom multiplier: 1.0E-9

Container {#NAME}: Memory usage Dependent item docker.container_stats.memory.usage["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.usage

Container {#NAME}: Memory maximum usage Dependent item docker.container_stats.memory.max_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.max_usage

Container {#NAME}: Memory commit bytes Dependent item docker.container_stats.memory.commit_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitbytes

Container {#NAME}: Memory commit peak bytes Dependent item docker.container_stats.memory.commit_peak_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitpeakbytes

Container {#NAME}: Memory private working set Dependent item docker.container_stats.memory.private_working_set["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.privateworkingset

Container {#NAME}: Current PIDs count

Current number of PIDs the container has created.

Dependent item docker.container_stats.pids_stats.current["{#NAME}"]

Preprocessing

  • JSON Path: $.pids_stats.current

Container {#NAME}: Networks bytes received per second Dependent item docker.networks.rx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets received per second Dependent item docker.networks.rx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors received per second Dependent item docker.networks.rx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks incoming packets dropped per second Dependent item docker.networks.rx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks bytes sent per second Dependent item docker.networks.tx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets sent per second Dependent item docker.networks.tx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors sent per second Dependent item docker.networks.tx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks outgoing packets dropped per second Dependent item docker.networks.tx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Get info

Return low-level information about a container.

Zabbix agent docker.container_info["{#NAME}",full]
Container {#NAME}: Created Dependent item docker.container_info.created["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Image Dependent item docker.container_info.image["{#NAME}"]

Preprocessing

  • JSON Path: $[?(@.Names[0] == "{#NAME}")].Image.first()

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Restart count Dependent item docker.container_info.restart_count["{#NAME}"]

Preprocessing

  • JSON Path: $.RestartCount

Container {#NAME}: Status Dependent item docker.container_info.state.status["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Status

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Health status

Container's HEALTHCHECK.

Dependent item docker.container_info.state.health["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • In range: 1 -> 4

    ⛔️Custom on fail: Set value to: 4

Container {#NAME}: Health failing streak Dependent item docker.container_info.state.health.failing["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Health.FailingStreak

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Running Dependent item docker.container_info.state.running["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Running

  • Boolean to decimal
Container {#NAME}: Paused Dependent item docker.container_info.state.paused["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Paused

  • Boolean to decimal
Container {#NAME}: Restarting Dependent item docker.container_info.state.restarting["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Restarting

  • Boolean to decimal
Container {#NAME}: OOMKilled Dependent item docker.container_info.state.oomkilled["{#NAME}"]

Preprocessing

  • JSON Path: $.State.OOMKilled

  • Boolean to decimal
Container {#NAME}: Dead Dependent item docker.container_info.state.dead["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Dead

  • Boolean to decimal
Container {#NAME}: Pid Dependent item docker.container_info.state.pid["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Pid

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Exit code Dependent item docker.container_info.state.exitcode["{#NAME}"]

Preprocessing

  • JSON Path: $.State.ExitCode

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Error Dependent item docker.container_info.state.error["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Error

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Started at Dependent item docker.container_info.started["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Finished at

Time at which the container last terminated.

Dependent item docker.container_info.finished["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Trigger prototypes for Containers discovery

Name Description Expression Severity Dependencies and additional info
Container {#NAME}: Health state container is unhealthy

Container health state is unhealthy.

count(/Docker by Zabbix agent 2/docker.container_info.state.health["{#NAME}"],2m,,2)>=2 High
Container {#NAME}: Container has been stopped with error code last(/Docker by Zabbix agent 2/docker.container_info.state.exitcode["{#NAME}"])>0 and last(/Docker by Zabbix agent 2/docker.container_info.state.running["{#NAME}"])=0 Average Manual close: Yes
Container {#NAME}: An error has occurred in the container

Container {#NAME} has an error. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#1)<>last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#2) and length(last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"]))>0 Warning 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 at ZABBIX forums

This template is for Zabbix version: 6.2

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

Docker by Zabbix agent 2

Overview

For Zabbix version: 6.2 and higher
The template to monitor Docker engine by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template Docker by Zabbix agent 2 — collects metrics by polling zabbix-agent2.

This template was tested on:

  • Docker, version 19.03.5

Setup

See Zabbix template operation for basic instructions.

Setup and configure zabbix-agent2 compiled with the Docker monitoring plugin.

Test availability: zabbix_get -s docker-host -k docker.info

Zabbix configuration

No specific Zabbix configuration is required.

Macros used

Name Description Default
{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

Filter of discoverable containers

.*
{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Filter to exclude discovered containers

CHANGE_IF_NEEDED
{$DOCKER.LLD.FILTER.IMAGE.MATCHES}

Filter of discoverable images

.*
{$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Filter to exclude discovered images

CHANGE_IF_NEEDED

Template links

There are no template links in this template.

Discovery rules

Name Description Type Key and additional info
Containers discovery

Discovery for containers metrics

Parameter:

true - Returns all containers

false - Returns only running containers

ZABBIX_PASSIVE docker.containers.discovery[false]

Filter:

AND

- {#NAME} MATCHES_REGEX {$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

- {#NAME} NOT_MATCHES_REGEX {$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Images discovery

Discovery for images metrics

ZABBIX_PASSIVE docker.images.discovery

Filter:

AND

- {#NAME} MATCHES_REGEX {$DOCKER.LLD.FILTER.IMAGE.MATCHES}

- {#NAME} NOT_MATCHES_REGEX {$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Items collected

Group Name Description Type Key and additional info
Docker Docker: Ping ZABBIX_PASSIVE docker.ping

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

Docker Docker: Containers total

Total number of containers on this host

DEPENDENT docker.containers.total

Preprocessing:

- JSONPATH: $.Containers

Docker Docker: Containers running

Total number of containers running on this host

DEPENDENT docker.containers.running

Preprocessing:

- JSONPATH: $.ContainersRunning

Docker Docker: Containers stopped

Total number of containers stopped on this host

DEPENDENT docker.containers.stopped

Preprocessing:

- JSONPATH: $.ContainersStopped

Docker Docker: Containers paused

Total number of containers paused on this host

DEPENDENT docker.containers.paused

Preprocessing:

- JSONPATH: $.ContainersPaused

Docker Docker: Images total

Number of images with intermediate image layers

DEPENDENT docker.images.total

Preprocessing:

- JSONPATH: $.Images

Docker Docker: Storage driver

Docker storage driver

https://docs.docker.com/storage/storagedriver/

DEPENDENT docker.driver

Preprocessing:

- JSONPATH: $.Driver

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Memory limit enabled

-

DEPENDENT docker.mem_limit.enabled

Preprocessing:

- JSONPATH: $.MemoryLimit

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Swap limit enabled

-

DEPENDENT docker.swap_limit.enabled

Preprocessing:

- JSONPATH: $.SwapLimit

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Kernel memory enabled

-

DEPENDENT docker.kernel_mem.enabled

Preprocessing:

- JSONPATH: $.KernelMemory

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Kernel memory TCP enabled

-

DEPENDENT docker.kernel_mem_tcp.enabled

Preprocessing:

- JSONPATH: $.KernelMemoryTCP

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU CFS Period enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_cfs_period.enabled

Preprocessing:

- JSONPATH: $.CpuCfsPeriod

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU CFS Quota enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_cfs_quota.enabled

Preprocessing:

- JSONPATH: $.CpuCfsQuota

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU Shares enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_shares.enabled

Preprocessing:

- JSONPATH: $.CPUShares

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU Set enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_set.enabled

Preprocessing:

- JSONPATH: $.CPUSet

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Pids limit enabled

-

DEPENDENT docker.pids_limit.enabled

Preprocessing:

- JSONPATH: $.PidsLimit

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: IPv4 Forwarding enabled

-

DEPENDENT docker.ipv4_forwarding.enabled

Preprocessing:

- JSONPATH: $.IPv4Forwarding

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Debug enabled

-

DEPENDENT docker.debug.enabled

Preprocessing:

- JSONPATH: $.Debug

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Nfd

Number of used File Descriptors

DEPENDENT docker.nfd

Preprocessing:

- JSONPATH: $.NFd

Docker Docker: OomKill disabled

-

DEPENDENT docker.oomkill.disabled

Preprocessing:

- JSONPATH: $.OomKillDisable

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Goroutines

Number of goroutines

DEPENDENT docker.goroutines

Preprocessing:

- JSONPATH: $.NGoroutines

Docker Docker: Logging driver

-

DEPENDENT docker.logging_driver

Preprocessing:

- JSONPATH: $.LoggingDriver

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Cgroup driver

-

DEPENDENT docker.cgroup_driver

Preprocessing:

- JSONPATH: $.CgroupDriver

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: NEvents listener

-

DEPENDENT docker.nevents_listener

Preprocessing:

- JSONPATH: $.NEventsListener

Docker Docker: Kernel version

-

DEPENDENT docker.kernel_version

Preprocessing:

- JSONPATH: $.KernelVersion

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Operating system

-

DEPENDENT docker.operating_system

Preprocessing:

- JSONPATH: $.OperatingSystem

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: OS type

-

DEPENDENT docker.os_type

Preprocessing:

- JSONPATH: $.OSType

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Architecture

-

DEPENDENT docker.architecture

Preprocessing:

- JSONPATH: $.Architecture

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: NCPU

-

DEPENDENT docker.ncpu

Preprocessing:

- JSONPATH: $.NCPU

Docker Docker: Memory total

-

DEPENDENT docker.mem.total

Preprocessing:

- JSONPATH: $.MemTotal

Docker Docker: Docker root dir

-

DEPENDENT docker.root_dir

Preprocessing:

- JSONPATH: $.DockerRootDir

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Name

-

DEPENDENT docker.name

Preprocessing:

- JSONPATH: $.Name

Docker Docker: Server version

-

DEPENDENT docker.server_version

Preprocessing:

- JSONPATH: $.ServerVersion

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Default runtime

-

DEPENDENT docker.default_runtime

Preprocessing:

- JSONPATH: $.DefaultRuntime

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Live restore enabled

-

DEPENDENT docker.live_restore.enabled

Preprocessing:

- JSONPATH: $.LiveRestoreEnabled

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Layers size

-

DEPENDENT docker.layers_size

Preprocessing:

- JSONPATH: $.LayersSize

Docker Docker: Images size

-

DEPENDENT docker.images_size

Preprocessing:

- JSONPATH: $.Images[*].Size.sum()

Docker Docker: Containers size

-

DEPENDENT docker.containers_size

Preprocessing:

- JSONPATH: $.Containers[*].SizeRw.sum()

Docker Docker: Volumes size

-

DEPENDENT docker.volumes_size

Preprocessing:

- JSONPATH: $.Volumes[*].UsageData.Size.sum()

Docker Docker: Images available

Number of top-level images

DEPENDENT docker.images.top_level

Preprocessing:

- JSONPATH: $.length()

Docker Image {#NAME}: Created

-

DEPENDENT docker.image.created["{#ID}"]

Preprocessing:

- JSONPATH: $[?(@.Id == "{#ID}")].Created.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Image {#NAME}: Size

-

DEPENDENT docker.image.size["{#ID}"]

Preprocessing:

- JSONPATH: $[?(@.Id == "{#ID}")].Size.first()

Docker Container {#NAME}: Get stats

Get container stats based on resource usage

ZABBIX_PASSIVE docker.container_stats["{#NAME}"]
Docker Container {#NAME}: CPU total usage per second

-

DEPENDENT docker.container_stats.cpu_usage.total.rate["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.total_usage

- CHANGE_PER_SECOND

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: CPU percent usage

-

DEPENDENT docker.container_stats.cpu_pct_usage["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.percent_usage

Docker Container {#NAME}: CPU kernelmode usage per second

-

DEPENDENT docker.container_stats.cpu_usage.kernel.rate["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.usage_in_kernelmode

- CHANGE_PER_SECOND

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: CPU usermode usage per second

-

DEPENDENT docker.container_stats.cpu_usage.user.rate["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.usage_in_usermode

- CHANGE_PER_SECOND

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: Online CPUs

-

DEPENDENT docker.container_stats.online_cpus["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.online_cpus

Docker Container {#NAME}: Throttling periods

Number of periods with throttling active

DEPENDENT docker.container_stats.cpu_usage.throttling_periods["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.throttling_data.periods

Docker Container {#NAME}: Throttled periods

Number of periods when the container hits its throttling limit

DEPENDENT docker.container_stats.cpu_usage.throttled_periods["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.throttling_data.throttled_periods

Docker Container {#NAME}: Throttled time

Aggregate time the container was throttled for in nanoseconds

DEPENDENT docker.container_stats.cpu_usage.throttled_time["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.throttling_data.throttled_time

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: Memory usage

-

DEPENDENT docker.container_stats.memory.usage["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.usage

Docker Container {#NAME}: Memory maximum usage

-

DEPENDENT docker.container_stats.memory.max_usage["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.max_usage

Docker Container {#NAME}: Memory commit bytes

-

DEPENDENT docker.container_stats.memory.commit_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.commitbytes

Docker Container {#NAME}: Memory commit peak bytes

-

DEPENDENT docker.container_stats.memory.commit_peak_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.commitpeakbytes

Docker Container {#NAME}: Memory private working set

-

DEPENDENT docker.container_stats.memory.private_working_set["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.privateworkingset

Docker Container {#NAME}: Networks bytes received per second

-

DEPENDENT docker.networks.rx_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_bytes.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks packets received per second

-

DEPENDENT docker.networks.rx_packets["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_packets.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks errors received per second

-

DEPENDENT docker.networks.rx_errors["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_errors.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks incoming packets dropped per second

-

DEPENDENT docker.networks.rx_dropped["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_dropped.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks bytes sent per second

-

DEPENDENT docker.networks.tx_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_bytes.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks packets sent per second

-

DEPENDENT docker.networks.tx_packets["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_packets.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks errors sent per second

-

DEPENDENT docker.networks.tx_errors["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_errors.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks outgoing packets dropped per second

-

DEPENDENT docker.networks.tx_dropped["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_dropped.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Get info

Return low-level information about a container

ZABBIX_PASSIVE docker.container_info["{#NAME}"]
Docker Container {#NAME}: Created

-

DEPENDENT docker.container_info.created["{#NAME}"]

Preprocessing:

- JSONPATH: $.Created

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Image

-

DEPENDENT docker.container_info.image["{#NAME}"]

Preprocessing:

- JSONPATH: $[?(@.Names[0] == "{#NAME}")].Image.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Restart count

-

DEPENDENT docker.container_info.restart_count["{#NAME}"]

Preprocessing:

- JSONPATH: $.RestartCount

Docker Container {#NAME}: Status

-

DEPENDENT docker.container_info.state.status["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Status

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Docker Container {#NAME}: Running

-

DEPENDENT docker.container_info.state.running["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Running

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Paused

-

DEPENDENT docker.container_info.state.paused["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Paused

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Restarting

-

DEPENDENT docker.container_info.state.restarting["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Restarting

- BOOL_TO_DECIMAL

Docker Container {#NAME}: OOMKilled

-

DEPENDENT docker.container_info.state.oomkilled["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.OOMKilled

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Dead

-

DEPENDENT docker.container_info.state.dead["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Dead

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Pid

-

DEPENDENT docker.container_info.state.pid["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Pid

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Exit code

-

DEPENDENT docker.container_info.state.exitcode["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.ExitCode

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Error

-

DEPENDENT docker.container_info.state.error["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Error

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Started at

-

DEPENDENT docker.container_info.started["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.StartedAt

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Finished at

-

DEPENDENT docker.container_info.finished["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.FinishedAt

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Zabbix raw items Docker: Get info ZABBIX_PASSIVE docker.info
Zabbix raw items Docker: Get containers ZABBIX_PASSIVE docker.containers
Zabbix raw items Docker: Get images ZABBIX_PASSIVE docker.images
Zabbix raw items Docker: Get data_usage ZABBIX_PASSIVE docker.data_usage

Triggers

Name Description Expression Severity Dependencies and additional info
Docker: Service is down

-

last(/Docker by Zabbix agent 2/docker.ping)=0 AVERAGE

Manual close: YES

Docker: Failed to fetch info data

Zabbix has not received data for items for the last 30 minutes

nodata(/Docker by Zabbix agent 2/docker.name,30m)=1 WARNING

Manual close: YES

Depends on:

- Docker: Service is down

Docker: Version has changed

Docker version has changed. Ack to close.

last(/Docker by Zabbix agent 2/docker.server_version,#1)<>last(/Docker by Zabbix agent 2/docker.server_version,#2) and length(last(/Docker by Zabbix agent 2/docker.server_version))>0 INFO

Manual close: YES

Container {#NAME}: Container has been stopped with error code

-

last(/Docker by Zabbix agent 2/docker.container_info.state.exitcode["{#NAME}"])>0 and last(/Docker by Zabbix agent 2/docker.container_info.state.running["{#NAME}"])=0 AVERAGE

Manual close: YES

Container {#NAME}: An error has occurred in the container

Container {#NAME} has an error. Ack to close.

last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#1)<>last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#2) and length(last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"]))>0 WARNING

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.

This template is for Zabbix version: 6.0

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

Docker by Zabbix agent 2

Overview

The template to monitor Docker engine by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template Docker by Zabbix agent 2 — collects metrics by polling zabbix-agent2.

Requirements

Zabbix version: 6.0 and higher.

Tested versions

This template has been tested on:

  • Docker 23.0.3

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

Setup and configure Zabbix agent 2 compiled with the Docker monitoring plugin. The user by which the Zabbix agent 2 is running should have access permissions to the Docker socket.

Test availability: zabbix_get -s docker-host -k docker.info

Macros used

Name Description Default
{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

Filter of discoverable containers.

.*
{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Filter to exclude discovered containers.

CHANGE_IF_NEEDED
{$DOCKER.LLD.FILTER.IMAGE.MATCHES}

Filter of discoverable images.

.*
{$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Filter to exclude discovered images.

CHANGE_IF_NEEDED

Items

Name Description Type Key and additional info
Docker: Ping Zabbix agent docker.ping

Preprocessing

  • Discard unchanged with heartbeat: 10m

Docker: Get info Zabbix agent docker.info
Docker: Get containers Zabbix agent docker.containers
Docker: Get images Zabbix agent docker.images
Docker: Get data_usage Zabbix agent docker.data_usage
Docker: Containers total

Total number of containers on this host.

Dependent item docker.containers.total

Preprocessing

  • JSON Path: $.Containers

Docker: Containers running

Total number of containers running on this host.

Dependent item docker.containers.running

Preprocessing

  • JSON Path: $.ContainersRunning

Docker: Containers stopped

Total number of containers stopped on this host.

Dependent item docker.containers.stopped

Preprocessing

  • JSON Path: $.ContainersStopped

Docker: Containers paused

Total number of containers paused on this host.

Dependent item docker.containers.paused

Preprocessing

  • JSON Path: $.ContainersPaused

Docker: Images total

Number of images with intermediate image layers.

Dependent item docker.images.total

Preprocessing

  • JSON Path: $.Images

Docker: Storage driver

Docker storage driver.

https://docs.docker.com/storage/storagedriver/

Dependent item docker.driver

Preprocessing

  • JSON Path: $.Driver

  • Discard unchanged with heartbeat: 1d

Docker: Memory limit enabled Dependent item docker.mem_limit.enabled

Preprocessing

  • JSON Path: $.MemoryLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Swap limit enabled Dependent item docker.swap_limit.enabled

Preprocessing

  • JSON Path: $.SwapLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Kernel memory enabled Dependent item docker.kernel_mem.enabled

Preprocessing

  • JSON Path: $.KernelMemory

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Kernel memory TCP enabled Dependent item docker.kernel_mem_tcp.enabled

Preprocessing

  • JSON Path: $.KernelMemoryTCP

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: CPU CFS Period enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_period.enabled

Preprocessing

  • JSON Path: $.CpuCfsPeriod

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: CPU CFS Quota enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_cfs_quota.enabled

Preprocessing

  • JSON Path: $.CpuCfsQuota

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: CPU Shares enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_shares.enabled

Preprocessing

  • JSON Path: $.CPUShares

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: CPU Set enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

Dependent item docker.cpu_set.enabled

Preprocessing

  • JSON Path: $.CPUSet

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Pids limit enabled Dependent item docker.pids_limit.enabled

Preprocessing

  • JSON Path: $.PidsLimit

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: IPv4 Forwarding enabled Dependent item docker.ipv4_forwarding.enabled

Preprocessing

  • JSON Path: $.IPv4Forwarding

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Debug enabled Dependent item docker.debug.enabled

Preprocessing

  • JSON Path: $.Debug

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Nfd

Number of used File Descriptors.

Dependent item docker.nfd

Preprocessing

  • JSON Path: $.NFd

Docker: OomKill disabled Dependent item docker.oomkill.disabled

Preprocessing

  • JSON Path: $.OomKillDisable

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Goroutines

Number of goroutines.

Dependent item docker.goroutines

Preprocessing

  • JSON Path: $.NGoroutines

Docker: Logging driver Dependent item docker.logging_driver

Preprocessing

  • JSON Path: $.LoggingDriver

  • Discard unchanged with heartbeat: 1d

Docker: Cgroup driver Dependent item docker.cgroup_driver

Preprocessing

  • JSON Path: $.CgroupDriver

  • Discard unchanged with heartbeat: 1d

Docker: NEvents listener Dependent item docker.nevents_listener

Preprocessing

  • JSON Path: $.NEventsListener

Docker: Kernel version Dependent item docker.kernel_version

Preprocessing

  • JSON Path: $.KernelVersion

  • Discard unchanged with heartbeat: 1d

Docker: Operating system Dependent item docker.operating_system

Preprocessing

  • JSON Path: $.OperatingSystem

  • Discard unchanged with heartbeat: 1d

Docker: OS type Dependent item docker.os_type

Preprocessing

  • JSON Path: $.OSType

  • Discard unchanged with heartbeat: 1d

Docker: Architecture Dependent item docker.architecture

Preprocessing

  • JSON Path: $.Architecture

  • Discard unchanged with heartbeat: 1d

Docker: NCPU Dependent item docker.ncpu

Preprocessing

  • JSON Path: $.NCPU

Docker: Memory total Dependent item docker.mem.total

Preprocessing

  • JSON Path: $.MemTotal

Docker: Docker root dir Dependent item docker.root_dir

Preprocessing

  • JSON Path: $.DockerRootDir

  • Discard unchanged with heartbeat: 1d

Docker: Name Dependent item docker.name

Preprocessing

  • JSON Path: $.Name

Docker: Server version Dependent item docker.server_version

Preprocessing

  • JSON Path: $.ServerVersion

  • Discard unchanged with heartbeat: 1d

Docker: Default runtime Dependent item docker.default_runtime

Preprocessing

  • JSON Path: $.DefaultRuntime

  • Discard unchanged with heartbeat: 1d

Docker: Live restore enabled Dependent item docker.live_restore.enabled

Preprocessing

  • JSON Path: $.LiveRestoreEnabled

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1d

Docker: Layers size Dependent item docker.layers_size

Preprocessing

  • JSON Path: $.LayersSize

Docker: Images size Dependent item docker.images_size

Preprocessing

  • JSON Path: $.Images[*].Size.sum()

Docker: Containers size Dependent item docker.containers_size

Preprocessing

  • JSON Path: $.Containers[*].SizeRw.sum()

Docker: Volumes size Dependent item docker.volumes_size

Preprocessing

  • JSON Path: $.Volumes[*].UsageData.Size.sum()

Docker: Images available

Number of top-level images.

Dependent item docker.images.top_level

Preprocessing

  • JSON Path: $.length()

Triggers

Name Description Expression Severity Dependencies and additional info
Docker: Service is down last(/Docker by Zabbix agent 2/docker.ping)=0 Average Manual close: Yes
Docker: Failed to fetch info data

Zabbix has not received any data for items for the last 30 minutes.

nodata(/Docker by Zabbix agent 2/docker.name,30m)=1 Warning Manual close: Yes
Depends on:
  • Docker: Service is down
Docker: Version has changed

Docker version has changed. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.server_version,#1)<>last(/Docker by Zabbix agent 2/docker.server_version,#2) and length(last(/Docker by Zabbix agent 2/docker.server_version))>0 Info Manual close: Yes

LLD rule Images discovery

Name Description Type Key and additional info
Images discovery

Discovery of images metrics.

Zabbix agent docker.images.discovery

Item prototypes for Images discovery

Name Description Type Key and additional info
Image {#NAME}: Created Dependent item docker.image.created["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Created.first()

  • Discard unchanged with heartbeat: 1d

Image {#NAME}: Size Dependent item docker.image.size["{#ID}"]

Preprocessing

  • JSON Path: $[?(@.Id == "{#ID}")].Size.first()

LLD rule Containers discovery

Name Description Type Key and additional info
Containers discovery

Discovery of containers metrics.

Parameter:

true - Returns all containers

false - Returns only running containers

Zabbix agent docker.containers.discovery[false]

Item prototypes for Containers discovery

Name Description Type Key and additional info
Container {#NAME}: Get stats

Get container stats based on resource usage.

Zabbix agent docker.container_stats["{#NAME}"]
Container {#NAME}: CPU total usage per second Dependent item docker.container_stats.cpu_usage.total.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.total_usage

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU percent usage Dependent item docker.container_stats.cpu_pct_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.percent_usage

Container {#NAME}: CPU kernelmode usage per second Dependent item docker.container_stats.cpu_usage.kernel.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_kernelmode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: CPU usermode usage per second Dependent item docker.container_stats.cpu_usage.user.rate["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.cpu_usage.usage_in_usermode

  • Change per second
  • Custom multiplier: 1.0E-9

Container {#NAME}: Online CPUs Dependent item docker.container_stats.online_cpus["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.online_cpus

Container {#NAME}: Throttling periods

Number of periods with throttling active.

Dependent item docker.container_stats.cpu_usage.throttling_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.periods

Container {#NAME}: Throttled periods

Number of periods when the container hits its throttling limit.

Dependent item docker.container_stats.cpu_usage.throttled_periods["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_periods

Container {#NAME}: Throttled time

Aggregate time the container was throttled for in nanoseconds.

Dependent item docker.container_stats.cpu_usage.throttled_time["{#NAME}"]

Preprocessing

  • JSON Path: $.cpu_stats.throttling_data.throttled_time

  • Custom multiplier: 1.0E-9

Container {#NAME}: Memory usage Dependent item docker.container_stats.memory.usage["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.usage

Container {#NAME}: Memory maximum usage Dependent item docker.container_stats.memory.max_usage["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.max_usage

Container {#NAME}: Memory commit bytes Dependent item docker.container_stats.memory.commit_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitbytes

Container {#NAME}: Memory commit peak bytes Dependent item docker.container_stats.memory.commit_peak_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.commitpeakbytes

Container {#NAME}: Memory private working set Dependent item docker.container_stats.memory.private_working_set["{#NAME}"]

Preprocessing

  • JSON Path: $.memory_stats.privateworkingset

Container {#NAME}: Current PIDs count

Current number of PIDs the container has created.

Dependent item docker.container_stats.pids_stats.current["{#NAME}"]

Preprocessing

  • JSON Path: $.pids_stats.current

Container {#NAME}: Networks bytes received per second Dependent item docker.networks.rx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets received per second Dependent item docker.networks.rx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors received per second Dependent item docker.networks.rx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks incoming packets dropped per second Dependent item docker.networks.rx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].rx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks bytes sent per second Dependent item docker.networks.tx_bytes["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_bytes.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks packets sent per second Dependent item docker.networks.tx_packets["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_packets.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks errors sent per second Dependent item docker.networks.tx_errors["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_errors.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Networks outgoing packets dropped per second Dependent item docker.networks.tx_dropped["{#NAME}"]

Preprocessing

  • JSON Path: $.networks[*].tx_dropped.sum()

    ⛔️Custom on fail: Set value to: 0

  • Change per second
Container {#NAME}: Get info

Return low-level information about a container.

Zabbix agent docker.container_info["{#NAME}",full]
Container {#NAME}: Created Dependent item docker.container_info.created["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Image Dependent item docker.container_info.image["{#NAME}"]

Preprocessing

  • JSON Path: $[?(@.Names[0] == "{#NAME}")].Image.first()

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Restart count Dependent item docker.container_info.restart_count["{#NAME}"]

Preprocessing

  • JSON Path: $.RestartCount

Container {#NAME}: Status Dependent item docker.container_info.state.status["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Status

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Health status

Container's HEALTHCHECK.

Dependent item docker.container_info.state.health["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • In range: 1 -> 4

    ⛔️Custom on fail: Set value to: 4

Container {#NAME}: Health failing streak Dependent item docker.container_info.state.health.failing["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Health.FailingStreak

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Container {#NAME}: Running Dependent item docker.container_info.state.running["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Running

  • Boolean to decimal
Container {#NAME}: Paused Dependent item docker.container_info.state.paused["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Paused

  • Boolean to decimal
Container {#NAME}: Restarting Dependent item docker.container_info.state.restarting["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Restarting

  • Boolean to decimal
Container {#NAME}: OOMKilled Dependent item docker.container_info.state.oomkilled["{#NAME}"]

Preprocessing

  • JSON Path: $.State.OOMKilled

  • Boolean to decimal
Container {#NAME}: Dead Dependent item docker.container_info.state.dead["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Dead

  • Boolean to decimal
Container {#NAME}: Pid Dependent item docker.container_info.state.pid["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Pid

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Exit code Dependent item docker.container_info.state.exitcode["{#NAME}"]

Preprocessing

  • JSON Path: $.State.ExitCode

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Error Dependent item docker.container_info.state.error["{#NAME}"]

Preprocessing

  • JSON Path: $.State.Error

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Started at Dependent item docker.container_info.started["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Container {#NAME}: Finished at

Time at which the container last terminated.

Dependent item docker.container_info.finished["{#NAME}"]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

Trigger prototypes for Containers discovery

Name Description Expression Severity Dependencies and additional info
Container {#NAME}: Health state container is unhealthy

Container health state is unhealthy.

count(/Docker by Zabbix agent 2/docker.container_info.state.health["{#NAME}"],2m,,2)>=2 High
Container {#NAME}: Container has been stopped with error code last(/Docker by Zabbix agent 2/docker.container_info.state.exitcode["{#NAME}"])>0 and last(/Docker by Zabbix agent 2/docker.container_info.state.running["{#NAME}"])=0 Average Manual close: Yes
Container {#NAME}: An error has occurred in the container

Container {#NAME} has an error. Acknowledge to close the problem manually.

last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#1)<>last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#2) and length(last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"]))>0 Warning 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 at ZABBIX forums

This template is for Zabbix version: 5.4

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

Docker by Zabbix agent 2

Overview

For Zabbix version: 5.4 and higher
The template to monitor Docker engine by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template Docker by Zabbix agent 2 — collects metrics by polling zabbix-agent2.

This template was tested on:

  • Docker, version 19.03.5

Setup

See Zabbix template operation for basic instructions.

Setup and configure zabbix-agent2 compiled with the Docker monitoring plugin.

Test availability: zabbix_get -s docker-host -k docker.info

Zabbix configuration

No specific Zabbix configuration is required.

Macros used

Name Description Default
{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

Filter of discoverable containers

.*
{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Filter to exclude discovered containers

CHANGE_IF_NEEDED
{$DOCKER.LLD.FILTER.IMAGE.MATCHES}

Filter of discoverable images

.*
{$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Filter to exclude discovered images

CHANGE_IF_NEEDED

Template links

There are no template links in this template.

Discovery rules

Name Description Type Key and additional info
Images discovery

Discovery for images metrics

ZABBIX_PASSIVE docker.images.discovery

Filter:

AND

- {#NAME} MATCHES_REGEX {$DOCKER.LLD.FILTER.IMAGE.MATCHES}

- {#NAME} NOT_MATCHES_REGEX {$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Containers discovery

Discovery for containers metrics

Parameter:

true - Returns all containers

false - Returns only running containers

ZABBIX_PASSIVE docker.containers.discovery[false]

Filter:

AND

- {#NAME} MATCHES_REGEX {$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

- {#NAME} NOT_MATCHES_REGEX {$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Items collected

Group Name Description Type Key and additional info
Docker Docker: Ping ZABBIX_PASSIVE docker.ping

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

Docker Docker: Containers total

Total number of containers on this host

DEPENDENT docker.containers.total

Preprocessing:

- JSONPATH: $.Containers

Docker Docker: Containers running

Total number of containers running on this host

DEPENDENT docker.containers.running

Preprocessing:

- JSONPATH: $.ContainersRunning

Docker Docker: Containers stopped

Total number of containers stopped on this host

DEPENDENT docker.containers.stopped

Preprocessing:

- JSONPATH: $.ContainersStopped

Docker Docker: Containers paused

Total number of containers paused on this host

DEPENDENT docker.containers.paused

Preprocessing:

- JSONPATH: $.ContainersPaused

Docker Docker: Images total

Number of images with intermediate image layers

DEPENDENT docker.images.total

Preprocessing:

- JSONPATH: $.Images

Docker Docker: Storage driver

Docker storage driver

https://docs.docker.com/storage/storagedriver/

DEPENDENT docker.driver

Preprocessing:

- JSONPATH: $.Driver

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Memory limit enabled

-

DEPENDENT docker.mem_limit.enabled

Preprocessing:

- JSONPATH: $.MemoryLimit

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Swap limit enabled

-

DEPENDENT docker.swap_limit.enabled

Preprocessing:

- JSONPATH: $.SwapLimit

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Kernel memory enabled

-

DEPENDENT docker.kernel_mem.enabled

Preprocessing:

- JSONPATH: $.KernelMemory

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Kernel memory TCP enabled

-

DEPENDENT docker.kernel_mem_tcp.enabled

Preprocessing:

- JSONPATH: $.KernelMemoryTCP

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU CFS Period enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_cfs_period.enabled

Preprocessing:

- JSONPATH: $.CpuCfsPeriod

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU CFS Quota enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_cfs_quota.enabled

Preprocessing:

- JSONPATH: $.CpuCfsQuota

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU Shares enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_shares.enabled

Preprocessing:

- JSONPATH: $.CPUShares

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU Set enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_set.enabled

Preprocessing:

- JSONPATH: $.CPUSet

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Pids limit enabled

-

DEPENDENT docker.pids_limit.enabled

Preprocessing:

- JSONPATH: $.PidsLimit

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: IPv4 Forwarding enabled

-

DEPENDENT docker.ipv4_forwarding.enabled

Preprocessing:

- JSONPATH: $.IPv4Forwarding

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Debug enabled

-

DEPENDENT docker.debug.enabled

Preprocessing:

- JSONPATH: $.Debug

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Nfd

Number of used File Descriptors

DEPENDENT docker.nfd

Preprocessing:

- JSONPATH: $.NFd

Docker Docker: OomKill disabled

-

DEPENDENT docker.oomkill.disabled

Preprocessing:

- JSONPATH: $.OomKillDisable

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Goroutines

Number of goroutines

DEPENDENT docker.goroutines

Preprocessing:

- JSONPATH: $.NGoroutines

Docker Docker: Logging driver

-

DEPENDENT docker.logging_driver

Preprocessing:

- JSONPATH: $.LoggingDriver

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Cgroup driver

-

DEPENDENT docker.cgroup_driver

Preprocessing:

- JSONPATH: $.CgroupDriver

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: NEvents listener

-

DEPENDENT docker.nevents_listener

Preprocessing:

- JSONPATH: $.NEventsListener

Docker Docker: Kernel version

-

DEPENDENT docker.kernel_version

Preprocessing:

- JSONPATH: $.KernelVersion

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Operating system

-

DEPENDENT docker.operating_system

Preprocessing:

- JSONPATH: $.OperatingSystem

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: OS type

-

DEPENDENT docker.os_type

Preprocessing:

- JSONPATH: $.OSType

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Architecture

-

DEPENDENT docker.architecture

Preprocessing:

- JSONPATH: $.Architecture

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: NCPU

-

DEPENDENT docker.ncpu

Preprocessing:

- JSONPATH: $.NCPU

Docker Docker: Memory total

-

DEPENDENT docker.mem.total

Preprocessing:

- JSONPATH: $.MemTotal

Docker Docker: Docker root dir

-

DEPENDENT docker.root_dir

Preprocessing:

- JSONPATH: $.DockerRootDir

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Name

-

DEPENDENT docker.name

Preprocessing:

- JSONPATH: $.Name

Docker Docker: Server version

-

DEPENDENT docker.server_version

Preprocessing:

- JSONPATH: $.ServerVersion

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Default runtime

-

DEPENDENT docker.default_runtime

Preprocessing:

- JSONPATH: $.DefaultRuntime

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Live restore enabled

-

DEPENDENT docker.live_restore.enabled

Preprocessing:

- JSONPATH: $.LiveRestoreEnabled

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Layers size

-

DEPENDENT docker.layers_size

Preprocessing:

- JSONPATH: $.LayersSize

Docker Docker: Images size

-

DEPENDENT docker.images_size

Preprocessing:

- JSONPATH: $.Images[*].Size.sum()

Docker Docker: Containers size

-

DEPENDENT docker.containers_size

Preprocessing:

- JSONPATH: $.Containers[*].SizeRw.sum()

Docker Docker: Volumes size

-

DEPENDENT docker.volumes_size

Preprocessing:

- JSONPATH: $.Volumes[*].UsageData.Size.sum()

Docker Docker: Images available

Number of top-level images

DEPENDENT docker.images.top_level

Preprocessing:

- JSONPATH: $.length()

Docker Image {#NAME}: Created

-

DEPENDENT docker.image.created["{#ID}"]

Preprocessing:

- JSONPATH: $[?(@.Id == "{#ID}")].Created.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Image {#NAME}: Size

-

DEPENDENT docker.image.size["{#ID}"]

Preprocessing:

- JSONPATH: $[?(@.Id == "{#ID}")].Size.first()

Docker Container {#NAME}: Get stats

Get container stats based on resource usage

ZABBIX_PASSIVE docker.container_stats["{#NAME}"]
Docker Container {#NAME}: CPU total usage per second

-

DEPENDENT docker.container_stats.cpu_usage.total.rate["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.total_usage

- CHANGE_PER_SECOND

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: CPU percent usage

-

DEPENDENT docker.container_stats.cpu_pct_usage["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.percent_usage

Docker Container {#NAME}: CPU kernelmode usage per second

-

DEPENDENT docker.container_stats.cpu_usage.kernel.rate["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.usage_in_kernelmode

- CHANGE_PER_SECOND

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: CPU usermode usage per second

-

DEPENDENT docker.container_stats.cpu_usage.user.rate["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.usage_in_usermode

- CHANGE_PER_SECOND

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: Online CPUs

-

DEPENDENT docker.container_stats.online_cpus["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.online_cpus

Docker Container {#NAME}: Throttling periods

Number of periods with throttling active

DEPENDENT docker.container_stats.cpu_usage.throttling_periods["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.throttling_data.periods

Docker Container {#NAME}: Throttled periods

Number of periods when the container hits its throttling limit

DEPENDENT docker.container_stats.cpu_usage.throttled_periods["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.throttling_data.throttled_periods

Docker Container {#NAME}: Throttled time

Aggregate time the container was throttled for in nanoseconds

DEPENDENT docker.container_stats.cpu_usage.throttled_time["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.throttling_data.throttled_time

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: Memory usage

-

DEPENDENT docker.container_stats.memory.usage["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.usage

Docker Container {#NAME}: Memory maximum usage

-

DEPENDENT docker.container_stats.memory.max_usage["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.max_usage

Docker Container {#NAME}: Memory commit bytes

-

DEPENDENT docker.container_stats.memory.commit_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.commitbytes

Docker Container {#NAME}: Memory commit peak bytes

-

DEPENDENT docker.container_stats.memory.commit_peak_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.commitpeakbytes

Docker Container {#NAME}: Memory private working set

-

DEPENDENT docker.container_stats.memory.private_working_set["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.privateworkingset

Docker Container {#NAME}: Networks bytes received per second

-

DEPENDENT docker.networks.rx_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_bytes.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks packets received per second

-

DEPENDENT docker.networks.rx_packets["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_packets.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks errors received per second

-

DEPENDENT docker.networks.rx_errors["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_errors.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks incoming packets dropped per second

-

DEPENDENT docker.networks.rx_dropped["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_dropped.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks bytes sent per second

-

DEPENDENT docker.networks.tx_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_bytes.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks packets sent per second

-

DEPENDENT docker.networks.tx_packets["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_packets.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks errors sent per second

-

DEPENDENT docker.networks.tx_errors["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_errors.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks outgoing packets dropped per second

-

DEPENDENT docker.networks.tx_dropped["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_dropped.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Get info

Return low-level information about a container

ZABBIX_PASSIVE docker.container_info["{#NAME}"]
Docker Container {#NAME}: Created

-

DEPENDENT docker.container_info.created["{#NAME}"]

Preprocessing:

- JSONPATH: $.Created

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Image

-

DEPENDENT docker.container_info.image["{#NAME}"]

Preprocessing:

- JSONPATH: $[?(@.Names[0] == "{#NAME}")].Image.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Restart count

-

DEPENDENT docker.container_info.restart_count["{#NAME}"]

Preprocessing:

- JSONPATH: $.RestartCount

Docker Container {#NAME}: Status

-

DEPENDENT docker.container_info.state.status["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Status

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Docker Container {#NAME}: Running

-

DEPENDENT docker.container_info.state.running["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Running

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Paused

-

DEPENDENT docker.container_info.state.paused["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Paused

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Restarting

-

DEPENDENT docker.container_info.state.restarting["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Restarting

- BOOL_TO_DECIMAL

Docker Container {#NAME}: OOMKilled

-

DEPENDENT docker.container_info.state.oomkilled["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.OOMKilled

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Dead

-

DEPENDENT docker.container_info.state.dead["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Dead

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Pid

-

DEPENDENT docker.container_info.state.pid["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Pid

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Exit code

-

DEPENDENT docker.container_info.state.exitcode["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.ExitCode

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Error

-

DEPENDENT docker.container_info.state.error["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Error

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Started at

-

DEPENDENT docker.container_info.started["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.StartedAt

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Finished at

-

DEPENDENT docker.container_info.finished["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.FinishedAt

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Zabbix_raw_items Docker: Get info ZABBIX_PASSIVE docker.info
Zabbix_raw_items Docker: Get containers ZABBIX_PASSIVE docker.containers
Zabbix_raw_items Docker: Get images ZABBIX_PASSIVE docker.images
Zabbix_raw_items Docker: Get data_usage ZABBIX_PASSIVE docker.data_usage

Triggers

Name Description Expression Severity Dependencies and additional info
Docker: Service is down

-

last(/Docker by Zabbix agent 2/docker.ping)=0 AVERAGE

Manual close: YES

Docker: Failed to fetch info data (or no data for 30m)

Zabbix has not received data for items for the last 30 minutes

nodata(/Docker by Zabbix agent 2/docker.name,30m)=1 WARNING

Manual close: YES

Depends on:

- Docker: Service is down

Docker: Version has changed (new version: {ITEM.VALUE})

Docker version has changed. Ack to close.

last(/Docker by Zabbix agent 2/docker.server_version,#1)<>last(/Docker by Zabbix agent 2/docker.server_version,#2) and length(last(/Docker by Zabbix agent 2/docker.server_version))>0 INFO

Manual close: YES

Container {#NAME}: Container has been stopped with error code

-

last(/Docker by Zabbix agent 2/docker.container_info.state.exitcode["{#NAME}"])>0 and last(/Docker by Zabbix agent 2/docker.container_info.state.running["{#NAME}"])=0 AVERAGE

Manual close: YES

Container {#NAME}: An error has occurred in the container

Container {#NAME} has an error. Ack to close.

last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#1)<>last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"],#2) and length(last(/Docker by Zabbix agent 2/docker.container_info.state.error["{#NAME}"]))>0 WARNING

Manual close: YES

Feedback

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

You can also provide a feedback, discuss the template or ask for help with it at ZABBIX forums.

This template is for Zabbix version: 5.0

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

Template App Docker

Overview

For Zabbix version: 5.0 and higher
The template to monitor Docker engine by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template Docker — collects metrics by polling zabbix-agent2.

This template was tested on:

  • Docker, version 19.03.5

Setup

See Zabbix template operation for basic instructions.

Setup and configure zabbix-agent2 compiled with the Docker monitoring plugin.

Test availability: zabbix_get -s docker-host -k docker.info

Zabbix configuration

No specific Zabbix configuration is required.

Macros used

Name Description Default
{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

Filter of discoverable containers

.*
{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Filter to exclude discovered containers

CHANGE_IF_NEEDED
{$DOCKER.LLD.FILTER.IMAGE.MATCHES}

Filter of discoverable images

.*
{$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Filter to exclude discovered images

CHANGE_IF_NEEDED

Template links

There are no template links in this template.

Discovery rules

Name Description Type Key and additional info
Images discovery

Discovery for images metrics

ZABBIX_PASSIVE docker.images.discovery

Filter:

AND

- A: {#NAME} MATCHES_REGEX {$DOCKER.LLD.FILTER.IMAGE.MATCHES}

- B: {#NAME} NOT_MATCHES_REGEX {$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}

Containers discovery

Discovery for containers metrics

Parameter:

true - Returns all containers

false - Returns only running containers

ZABBIX_PASSIVE docker.containers.discovery[false]

Filter:

AND

- A: {#NAME} MATCHES_REGEX {$DOCKER.LLD.FILTER.CONTAINER.MATCHES}

- B: {#NAME} NOT_MATCHES_REGEX {$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}

Items collected

Group Name Description Type Key and additional info
Docker Docker: Ping ZABBIX_PASSIVE docker.ping

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

Docker Docker: Containers total

Total number of containers on this host

DEPENDENT docker.containers.total

Preprocessing:

- JSONPATH: $.Containers

Docker Docker: Containers running

Total number of containers running on this host

DEPENDENT docker.containers.running

Preprocessing:

- JSONPATH: $.ContainersRunning

Docker Docker: Containers stopped

Total number of containers stopped on this host

DEPENDENT docker.containers.stopped

Preprocessing:

- JSONPATH: $.ContainersStopped

Docker Docker: Containers paused

Total number of containers paused on this host

DEPENDENT docker.containers.paused

Preprocessing:

- JSONPATH: $.ContainersPaused

Docker Docker: Images total

Number of images with intermediate image layers

DEPENDENT docker.images.total

Preprocessing:

- JSONPATH: $.Images

Docker Docker: Storage driver

Docker storage driver

https://docs.docker.com/storage/storagedriver/

DEPENDENT docker.driver

Preprocessing:

- JSONPATH: $.Driver

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Memory limit enabled

-

DEPENDENT docker.mem_limit.enabled

Preprocessing:

- JSONPATH: $.MemoryLimit

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Swap limit enabled

-

DEPENDENT docker.swap_limit.enabled

Preprocessing:

- JSONPATH: $.SwapLimit

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Kernel memory enabled

-

DEPENDENT docker.kernel_mem.enabled

Preprocessing:

- JSONPATH: $.KernelMemory

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Kernel memory TCP enabled

-

DEPENDENT docker.kernel_mem_tcp.enabled

Preprocessing:

- JSONPATH: $.KernelMemoryTCP

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU CFS Period enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_cfs_period.enabled

Preprocessing:

- JSONPATH: $.CpuCfsPeriod

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU CFS Quota enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_cfs_quota.enabled

Preprocessing:

- JSONPATH: $.CpuCfsQuota

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU Shares enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_shares.enabled

Preprocessing:

- JSONPATH: $.CPUShares

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: CPU Set enabled

https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler

DEPENDENT docker.cpu_set.enabled

Preprocessing:

- JSONPATH: $.CPUSet

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Pids limit enabled

-

DEPENDENT docker.pids_limit.enabled

Preprocessing:

- JSONPATH: $.PidsLimit

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: IPv4 Forwarding enabled

-

DEPENDENT docker.ipv4_forwarding.enabled

Preprocessing:

- JSONPATH: $.IPv4Forwarding

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Debug enabled

-

DEPENDENT docker.debug.enabled

Preprocessing:

- JSONPATH: $.Debug

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Nfd

Number of used File Descriptors

DEPENDENT docker.nfd

Preprocessing:

- JSONPATH: $.NFd

Docker Docker: OomKill disabled

-

DEPENDENT docker.oomkill.disabled

Preprocessing:

- JSONPATH: $.OomKillDisable

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Goroutines

Number of goroutines

DEPENDENT docker.goroutines

Preprocessing:

- JSONPATH: $.NGoroutines

Docker Docker: Logging driver

-

DEPENDENT docker.logging_driver

Preprocessing:

- JSONPATH: $.LoggingDriver

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Cgroup driver

-

DEPENDENT docker.cgroup_driver

Preprocessing:

- JSONPATH: $.CgroupDriver

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: NEvents listener

-

DEPENDENT docker.nevents_listener

Preprocessing:

- JSONPATH: $.NEventsListener

Docker Docker: Kernel version

-

DEPENDENT docker.kernel_version

Preprocessing:

- JSONPATH: $.KernelVersion

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Operating system

-

DEPENDENT docker.operating_system

Preprocessing:

- JSONPATH: $.OperatingSystem

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: OS type

-

DEPENDENT docker.os_type

Preprocessing:

- JSONPATH: $.OSType

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Architecture

-

DEPENDENT docker.architecture

Preprocessing:

- JSONPATH: $.Architecture

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: NCPU

-

DEPENDENT docker.ncpu

Preprocessing:

- JSONPATH: $.NCPU

Docker Docker: Memory total

-

DEPENDENT docker.mem.total

Preprocessing:

- JSONPATH: $.MemTotal

Docker Docker: Docker root dir

-

DEPENDENT docker.root_dir

Preprocessing:

- JSONPATH: $.DockerRootDir

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Name

-

DEPENDENT docker.name

Preprocessing:

- JSONPATH: $.Name

Docker Docker: Server version

-

DEPENDENT docker.server_version

Preprocessing:

- JSONPATH: $.ServerVersion

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Default runtime

-

DEPENDENT docker.default_runtime

Preprocessing:

- JSONPATH: $.DefaultRuntime

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Live restore enabled

-

DEPENDENT docker.live_restore.enabled

Preprocessing:

- JSONPATH: $.LiveRestoreEnabled

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Docker: Layers size

-

DEPENDENT docker.layers_size

Preprocessing:

- JSONPATH: $.LayersSize

Docker Docker: Images size

-

DEPENDENT docker.images_size

Preprocessing:

- JSONPATH: $.Images[*].Size.sum()

Docker Docker: Containers size

-

DEPENDENT docker.containers_size

Preprocessing:

- JSONPATH: $.Containers[*].SizeRw.sum()

Docker Docker: Volumes size

-

DEPENDENT docker.volumes_size

Preprocessing:

- JSONPATH: $.Volumes[*].UsageData.Size.sum()

Docker Docker: Images available

Number of top-level images

DEPENDENT docker.images.top_level

Preprocessing:

- JSONPATH: $.length()

Docker Image {#NAME}: Created

-

DEPENDENT docker.image.created["{#ID}"]

Preprocessing:

- JSONPATH: $[?(@.Id == "{#ID}")].Created.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Image {#NAME}: Size

-

DEPENDENT docker.image.size["{#ID}"]

Preprocessing:

- JSONPATH: $[?(@.Id == "{#ID}")].Size.first()

Docker Container {#NAME}: Get stats

Get container stats based on resource usage

ZABBIX_PASSIVE docker.container_stats["{#NAME}"]
Docker Container {#NAME}: CPU total usage per second

-

DEPENDENT docker.container_stats.cpu_usage.total.rate["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.total_usage

- CHANGE_PER_SECOND

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: CPU percent usage

-

DEPENDENT docker.container_stats.cpu_pct_usage["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.percent_usage

Docker Container {#NAME}: CPU kernelmode usage per second

-

DEPENDENT docker.container_stats.cpu_usage.kernel.rate["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.usage_in_kernelmode

- CHANGE_PER_SECOND

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: CPU usermode usage per second

-

DEPENDENT docker.container_stats.cpu_usage.user.rate["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.cpu_usage.usage_in_usermode

- CHANGE_PER_SECOND

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: Online CPUs

-

DEPENDENT docker.container_stats.online_cpus["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.online_cpus

Docker Container {#NAME}: Throttling periods

Number of periods with throttling active

DEPENDENT docker.container_stats.cpu_usage.throttling_periods["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.throttling_data.periods

Docker Container {#NAME}: Throttled periods

Number of periods when the container hits its throttling limit

DEPENDENT docker.container_stats.cpu_usage.throttled_periods["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.throttling_data.throttled_periods

Docker Container {#NAME}: Throttled time

Aggregate time the container was throttled for in nanoseconds

DEPENDENT docker.container_stats.cpu_usage.throttled_time["{#NAME}"]

Preprocessing:

- JSONPATH: $.cpu_stats.throttling_data.throttled_time

- MULTIPLIER: 1.0E-9

Docker Container {#NAME}: Memory usage

-

DEPENDENT docker.container_stats.memory.usage["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.usage

Docker Container {#NAME}: Memory maximum usage

-

DEPENDENT docker.container_stats.memory.max_usage["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.max_usage

Docker Container {#NAME}: Memory commit bytes

-

DEPENDENT docker.container_stats.memory.commit_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.commitbytes

Docker Container {#NAME}: Memory commit peak bytes

-

DEPENDENT docker.container_stats.memory.commit_peak_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.commitpeakbytes

Docker Container {#NAME}: Memory private working set

-

DEPENDENT docker.container_stats.memory.private_working_set["{#NAME}"]

Preprocessing:

- JSONPATH: $.memory_stats.privateworkingset

Docker Container {#NAME}: Networks bytes received per second

-

DEPENDENT docker.networks.rx_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_bytes.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks packets received per second

-

DEPENDENT docker.networks.rx_packets["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_packets.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks errors received per second

-

DEPENDENT docker.networks.rx_errors["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_errors.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks incoming packets dropped per second

-

DEPENDENT docker.networks.rx_dropped["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].rx_dropped.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks bytes sent per second

-

DEPENDENT docker.networks.tx_bytes["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_bytes.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks packets sent per second

-

DEPENDENT docker.networks.tx_packets["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_packets.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks errors sent per second

-

DEPENDENT docker.networks.tx_errors["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_errors.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Networks outgoing packets dropped per second

-

DEPENDENT docker.networks.tx_dropped["{#NAME}"]

Preprocessing:

- JSONPATH: $.networks[*].tx_dropped.sum()

⛔️ON_FAIL: CUSTOM_VALUE -> 0

- CHANGE_PER_SECOND

Docker Container {#NAME}: Get info

Return low-level information about a container

ZABBIX_PASSIVE docker.container_info["{#NAME}"]
Docker Container {#NAME}: Created

-

DEPENDENT docker.container_info.created["{#NAME}"]

Preprocessing:

- JSONPATH: $.Created

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Image

-

DEPENDENT docker.container_info.image["{#NAME}"]

Preprocessing:

- JSONPATH: $[?(@.Names[0] == "{#NAME}")].Image.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Restart count

-

DEPENDENT docker.container_info.restart_count["{#NAME}"]

Preprocessing:

- JSONPATH: $.RestartCount

Docker Container {#NAME}: Status

-

DEPENDENT docker.container_info.state.status["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Status

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Docker Container {#NAME}: Running

-

DEPENDENT docker.container_info.state.running["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Running

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Paused

-

DEPENDENT docker.container_info.state.paused["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Paused

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Restarting

-

DEPENDENT docker.container_info.state.restarting["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Restarting

- BOOL_TO_DECIMAL

Docker Container {#NAME}: OOMKilled

-

DEPENDENT docker.container_info.state.oomkilled["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.OOMKilled

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Dead

-

DEPENDENT docker.container_info.state.dead["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Dead

- BOOL_TO_DECIMAL

Docker Container {#NAME}: Pid

-

DEPENDENT docker.container_info.state.pid["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Pid

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Exit code

-

DEPENDENT docker.container_info.state.exitcode["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.ExitCode

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Error

-

DEPENDENT docker.container_info.state.error["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.Error

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Started at

-

DEPENDENT docker.container_info.started["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.StartedAt

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Docker Container {#NAME}: Finished at

-

DEPENDENT docker.container_info.finished["{#NAME}"]

Preprocessing:

- JSONPATH: $.State.FinishedAt

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Zabbix_raw_items Docker: Get info ZABBIX_PASSIVE docker.info
Zabbix_raw_items Docker: Get containers ZABBIX_PASSIVE docker.containers
Zabbix_raw_items Docker: Get images ZABBIX_PASSIVE docker.images
Zabbix_raw_items Docker: Get data_usage ZABBIX_PASSIVE docker.data_usage

Triggers

Name Description Expression Severity Dependencies and additional info
Docker: Service is down

-

{TEMPLATE_NAME:docker.ping.last()}=0 AVERAGE

Manual close: YES

Docker: Failed to fetch info data (or no data for 30m)

Zabbix has not received data for items for the last 30 minutes

{TEMPLATE_NAME:docker.name.nodata(30m)}=1 WARNING

Manual close: YES

Depends on:

- Docker: Service is down

Docker: Version has changed (new version: {ITEM.VALUE})

Docker version has changed. Ack to close.

{TEMPLATE_NAME:docker.server_version.diff()}=1 and {TEMPLATE_NAME:docker.server_version.strlen()}>0 INFO

Manual close: YES

Container {#NAME}: Container has been stopped with error code

-

{TEMPLATE_NAME:docker.container_info.state.exitcode["{#NAME}"].last()}>0 and {TEMPLATE_NAME:docker.container_info.state.running["{#NAME}"].last()}=0 AVERAGE

Manual close: YES

Container {#NAME}: An error has occurred in the container

Container {#NAME} has an error. Ack to close.

{TEMPLATE_NAME:docker.container_info.state.error["{#NAME}"].diff()}=1 and {TEMPLATE_NAME:docker.container_info.state.error["{#NAME}"].strlen()}>0 WARNING

Manual close: YES

Feedback

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

You can also provide a feedback, discuss the template or ask for help with it at ZABBIX forums.

Articles and documentation

+ Propose new article

Media

👁 ZABBIX Agent2 Template for Simple Docker Container Monitoring
ZABBIX Agent2 Template for Simple Docker Container Monitoring
👁 Zabbix Docker Containers
Zabbix Docker Containers
👁 Zabbix 3.0/3.2/3.4/4.0/trunk quick deployment with docker - by Zabbix Cookbook
Zabbix 3.0/3.2/3.4/4.0/trunk quick deployment with docker - by Zabbix Cookbook
👁 Image

Request custom integration

Zabbix integration team will develop custom integration based on your requirements and Zabbix best practices.

Request
👁 Image

Propose integration

Have you already developed high quality integration and want to submit to Zabbix integration repository?

Propose