tornado-relayer/monitoring/templates/Docker-template.yaml

394 lines
13 KiB
YAML
Raw Permalink Normal View History

zabbix_export:
version: '5.2'
date: '2021-11-29T12:29:17Z'
groups:
2022-01-19 13:11:00 +01:00
- name: Docker
templates:
2022-01-19 13:11:00 +01:00
- template: Docker
name: Docker
description: |
Get Docker engine metrics from plugin for the New Zabbix Agent (zabbix-agent2).
2022-01-19 13:11:00 +01:00
You can discuss this template or leave feedback on our forum
2022-01-19 13:11:00 +01:00
Template tooling version used: 0.38
groups:
2022-01-19 13:11:00 +01:00
- name: Docker
applications:
2022-01-19 13:11:00 +01:00
- name: Docker
- name: 'Zabbix raw items'
items:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Get containers'
key: docker.containers
history: '0'
trends: '0'
value_type: TEXT
applications:
2022-01-19 13:11:00 +01:00
- name: 'Zabbix raw items'
- name: 'Docker: Containers paused'
type: DEPENDENT
key: docker.containers.paused
delay: '0'
history: 7d
description: 'Total number of containers paused on this host'
applications:
2022-01-19 13:11:00 +01:00
- name: Docker
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.ContainersPaused
master_item:
key: docker.info
2022-01-19 13:11:00 +01:00
- name: 'Docker: Containers running'
type: DEPENDENT
key: docker.containers.running
delay: '0'
history: 7d
description: 'Total number of containers running on this host'
applications:
2022-01-19 13:11:00 +01:00
- name: Docker
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.ContainersRunning
master_item:
key: docker.info
2022-01-19 13:11:00 +01:00
- name: 'Docker: Containers stopped'
type: DEPENDENT
key: docker.containers.stopped
delay: '0'
history: 7d
description: 'Total number of containers stopped on this host'
applications:
2022-01-19 13:11:00 +01:00
- name: Docker
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.ContainersStopped
master_item:
key: docker.info
triggers:
2022-01-19 13:11:00 +01:00
- expression: '{avg(5m)}>=1'
name: 'Docker: containers is stopped'
priority: HIGH
2022-01-19 13:11:00 +01:00
- name: 'Docker: Containers total'
type: DEPENDENT
key: docker.containers.total
delay: '0'
history: 7d
description: 'Total number of containers on this host'
applications:
2022-01-19 13:11:00 +01:00
- name: Docker
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.Containers
master_item:
key: docker.info
2022-01-19 13:11:00 +01:00
- name: 'Docker: Get images'
key: docker.images
history: '0'
trends: '0'
status: DISABLED
value_type: TEXT
applications:
2022-01-19 13:11:00 +01:00
- name: 'Zabbix raw items'
- name: 'Docker: Get info'
key: docker.info
history: '0'
trends: '0'
value_type: TEXT
applications:
2022-01-19 13:11:00 +01:00
- name: 'Zabbix raw items'
- name: 'Docker: Memory total'
type: DEPENDENT
key: docker.mem.total
delay: '0'
history: 7d
status: DISABLED
units: B
applications:
2022-01-19 13:11:00 +01:00
- name: Docker
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.MemTotal
master_item:
key: docker.info
2022-01-19 13:11:00 +01:00
- name: 'Docker: Ping'
key: docker.ping
history: 7h
applications:
2022-01-19 13:11:00 +01:00
- name: Docker
valuemap:
name: 'Service state'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 10m
triggers:
2022-01-19 13:11:00 +01:00
- expression: '{last()}=0'
name: 'Docker: Service is down'
priority: AVERAGE
manual_close: 'YES'
discovery_rules:
2022-01-19 13:11:00 +01:00
- name: 'Containers discovery'
key: 'docker.containers.discovery[true]'
delay: 15m
filter:
evaltype: AND
conditions:
2022-01-19 13:11:00 +01:00
- macro: '{#NAME}'
value: '{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}'
formulaid: A
2022-01-19 13:11:00 +01:00
- macro: '{#NAME}'
value: '{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}'
operator: NOT_MATCHES_REGEX
formulaid: B
description: |
Discovery for containers metrics
2022-01-19 13:11:00 +01:00
Parameter:
true - Returns all containers
false - Returns only running containers
item_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Finished at'
type: DEPENDENT
key: 'docker.container_info.finished["{#NAME}"]'
delay: '0'
history: 7d
value_type: FLOAT
units: unixtime
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.State.FinishedAt
2022-01-19 13:11:00 +01:00
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1d
master_item:
key: 'docker.container_info["{#NAME}"]'
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Restart count'
type: DEPENDENT
key: 'docker.container_info.restart_count["{#NAME}"]'
delay: '0'
history: 7d
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.RestartCount
master_item:
key: 'docker.container_info["{#NAME}"]'
trigger_prototypes:
2022-01-19 13:11:00 +01:00
- expression: '{last()}>5'
name: 'Container {#NAME}: restarting constantly'
opdata: '{ITEM.VALUE}'
priority: HIGH
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Started at'
type: DEPENDENT
key: 'docker.container_info.started["{#NAME}"]'
delay: '0'
history: 7d
value_type: FLOAT
units: unixtime
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.State.StartedAt
2022-01-19 13:11:00 +01:00
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1d
master_item:
key: 'docker.container_info["{#NAME}"]'
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Error'
type: DEPENDENT
key: 'docker.container_info.state.error["{#NAME}"]'
delay: '0'
history: 7d
trends: '0'
value_type: CHAR
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.State.Error
2022-01-19 13:11:00 +01:00
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1d
master_item:
key: 'docker.container_info["{#NAME}"]'
trigger_prototypes:
2022-01-19 13:11:00 +01:00
- expression: '{diff()}=1 and {strlen()}>0'
name: 'Container {#NAME}: An error has occurred in the container'
priority: WARNING
description: 'Container {#NAME} has an error. Ack to close.'
manual_close: 'YES'
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Exit code'
type: DEPENDENT
key: 'docker.container_info.state.exitcode["{#NAME}"]'
delay: '0'
history: 7d
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.State.ExitCode
2022-01-19 13:11:00 +01:00
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1d
master_item:
key: 'docker.container_info["{#NAME}"]'
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Paused'
type: DEPENDENT
key: 'docker.container_info.state.paused["{#NAME}"]'
delay: '0'
history: 7d
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
valuemap:
name: 'Docker flag'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.State.Paused
2022-01-19 13:11:00 +01:00
- type: BOOL_TO_DECIMAL
parameters:
- ''
master_item:
key: 'docker.container_info["{#NAME}"]'
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Restarting'
type: DEPENDENT
key: 'docker.container_info.state.restarting["{#NAME}"]'
delay: '0'
history: 7d
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
valuemap:
name: 'Docker flag'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.State.Restarting
2022-01-19 13:11:00 +01:00
- type: BOOL_TO_DECIMAL
parameters:
- ''
master_item:
key: 'docker.container_info["{#NAME}"]'
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Running'
type: DEPENDENT
key: 'docker.container_info.state.running["{#NAME}"]'
delay: '0'
history: 7d
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
valuemap:
name: 'Docker flag'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.State.Running
2022-01-19 13:11:00 +01:00
- type: BOOL_TO_DECIMAL
parameters:
- ''
master_item:
key: 'docker.container_info["{#NAME}"]'
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Status'
type: DEPENDENT
key: 'docker.container_info.state.status["{#NAME}"]'
delay: '0'
history: 7d
trends: '0'
value_type: CHAR
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
preprocessing:
2022-01-19 13:11:00 +01:00
- type: JSONPATH
parameters:
- $.State.Status
2022-01-19 13:11:00 +01:00
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
master_item:
key: 'docker.container_info["{#NAME}"]'
2022-01-19 13:11:00 +01:00
- name: 'Container {#NAME}: Get info'
key: 'docker.container_info["{#NAME}"]'
history: '0'
trends: '0'
value_type: CHAR
description: 'Return low-level information about a container'
application_prototypes:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Container {#NAME}'
trigger_prototypes:
2022-01-19 13:11:00 +01:00
- expression: '{Docker:docker.container_info.state.exitcode["{#NAME}"].last()}>0 and {Docker:docker.container_info.state.running["{#NAME}"].last()}=0'
name: 'Container {#NAME}: Container has been stopped with error code'
opdata: 'Exit code: {ITEM.LASTVALUE1}'
priority: AVERAGE
manual_close: 'YES'
macros:
2022-01-19 13:11:00 +01:00
- macro: '{$DOCKER.LLD.FILTER.CONTAINER.MATCHES}'
value: '.*'
description: 'Filter of discoverable containers'
2022-01-19 13:11:00 +01:00
- macro: '{$DOCKER.LLD.FILTER.CONTAINER.NOT_MATCHES}'
value: CHANGE_IF_NEEDED
description: 'Filter to exclude discovered containers'
2022-01-19 13:11:00 +01:00
- macro: '{$DOCKER.LLD.FILTER.IMAGE.MATCHES}'
value: '.*'
description: 'Filter of discoverable images'
2022-01-19 13:11:00 +01:00
- macro: '{$DOCKER.LLD.FILTER.IMAGE.NOT_MATCHES}'
value: CHANGE_IF_NEEDED
description: 'Filter to exclude discovered images'
graphs:
2022-01-19 13:11:00 +01:00
- name: 'Docker: Containers'
graph_items:
2022-01-19 13:11:00 +01:00
- drawtype: GRADIENT_LINE
color: 1A7C11
item:
host: Docker
key: docker.containers.running
2022-01-19 13:11:00 +01:00
- sortorder: '1'
drawtype: BOLD_LINE
color: 2774A4
item:
host: Docker
key: docker.containers.paused
2022-01-19 13:11:00 +01:00
- sortorder: '2'
drawtype: BOLD_LINE
color: F63100
item:
host: Docker
key: docker.containers.stopped
2022-01-19 13:11:00 +01:00
- sortorder: '3'
drawtype: BOLD_LINE
color: A54F10
item:
host: Docker
key: docker.containers.total
2022-01-19 13:11:00 +01:00
- name: 'Docker: Memory total'
graph_items:
2022-01-19 13:11:00 +01:00
- drawtype: BOLD_LINE
color: 1A7C11
item:
host: Docker
key: docker.mem.total
value_maps:
2022-01-19 13:11:00 +01:00
- name: 'Docker flag'
mappings:
2022-01-19 13:11:00 +01:00
- value: '0'
newvalue: 'False'
2022-01-19 13:11:00 +01:00
- value: '1'
newvalue: 'True'
2022-01-19 13:11:00 +01:00
- name: 'Service state'
mappings:
2022-01-19 13:11:00 +01:00
- value: '0'
newvalue: Down
2022-01-19 13:11:00 +01:00
- value: '1'
newvalue: Up