+ block device discovery

This commit is contained in:
Márkus Sándor 2025-01-31 12:16:59 +01:00
parent 10730efc6d
commit becfa84284

View File

@ -1,6 +1,8 @@
zabbix_export:
version: '7.0'
template_groups:
- uuid: d8bbe56256854f039dfe7368a22164a6
name: Templates/msandor
- uuid: 40cc3baad80b4c0c815f809ea20e2875
name: 'Templates/Operating systems'
templates:
@ -8,7 +10,7 @@ zabbix_export:
template: 'Linux by SSH'
name: 'Linux by SSH'
description: |
'vaniacer' munkássága alapján készítettem, és felpimpeltem a zabbix 7.0-ra. Kijavítottam a hibáit (pl. network devices & mounted filesystem discovery, memória, stb), és kibővítettem új funkciókkal, triggerekkel, dashboardokkal, grafikonokkal.
'vaniacer' munkássága alapján készítettem, és felpimpeltem a zabbix 7.0-ra. Kijavítottam a hibáit (pl. network devices & mounted filesystem discovery, memória, stb), és kibővítettem új funkciókkal, triggerekkel, dashboardokkal, grafikonokkal és a block device discovery-vel.
29 változóval (macros) rendelkezik, amiből számunkra a 3 legfontosabb:
- {$SSH.PORT}: ha nem a 22-es porton figyel az ssh szerver, állítsd be a hosztnál
@ -37,8 +39,9 @@ zabbix_export:
https://www.zabbix.com/documentation/current/en/manual/config/items/itemtypes/ssh_checks
vendor:
name: msandor
version: 7.0-1
version: 7.0-2
groups:
- name: Templates/msandor
- name: 'Templates/Operating systems'
items:
- uuid: 6f79c48d973f4a7486aa6f1c9a92167f
@ -47,6 +50,8 @@ zabbix_export:
key: 'net.tcp.service[ssh,,{$SSH.PORT}]'
history: 1w
description: 'Used for monitoring the availability status of the service.'
valuemap:
name: 'Service state'
tags:
- tag: Application
value: 'SSH service'
@ -1040,6 +1045,141 @@ zabbix_export:
item:
host: 'Linux by SSH'
key: 'ssh.run[net.if.out."{#IFNAME}",,{$SSH.PORT}]'
- uuid: bceedfe5f93e4653854b4988e8853506
name: 'Block devices discovery'
type: SSH
key: 'ssh.run[vfs.dev.discovery,,{$SSH.PORT}]'
delay: 1h
params: 'lsblk | grep disk | awk ''{print $1}'''
username: '{$SSH.USER}'
password: '{$SSH.PWD}'
lifetime: 30d
enabled_lifetime_type: DISABLE_NEVER
description: 'https://www.kernel.org/doc/Documentation/iostats.txt'
item_prototypes:
- uuid: 4e03701b4a564f36bda120a91993191f
name: '{#DEVNAME}: Disk average queue size (avgqu-sz)'
type: SSH
key: 'ssh.run[vfs.dev.queue_size.{#DEVNAME},,{$SSH.PORT}]'
value_type: FLOAT
params: 'iostat -x | grep {#DEVNAME} | awk ''{print $12}'''
username: '{$SSH.USER}'
password: '{$SSH.PWD}'
description: 'The current average disk queue; the number of requests outstanding on the disk while the performance data is being collected.'
tags:
- tag: component
value: storage
- tag: disk
value: '{#DEVNAME}'
- uuid: 01319ca384284d67b6a3711fee41ef6a
name: '{#DEVNAME}: Disk read request avg waiting time (r_await)'
type: SSH
key: 'ssh.run[vfs.dev.read.await.{#DEVNAME},,{$SSH.PORT}]'
value_type: FLOAT
units: m/s
params: 'iostat -x | grep {#DEVNAME} | awk ''{print $10}'''
username: '{$SSH.USER}'
password: '{$SSH.PWD}'
description: 'This formula contains two Boolean expressions that evaluate to 1 or 0 in order to set the calculated metric to zero and to avoid the exception - division by zero.'
tags:
- tag: component
value: storage
- tag: disk
value: '{#DEVNAME}'
- uuid: 78acd200b851445789b199f4db560ba3
name: '{#DEVNAME}: Disk read rate'
type: SSH
key: 'ssh.run[vfs.dev.read.rate.{#DEVNAME},,{$SSH.PORT}]'
value_type: FLOAT
units: r/s
params: 'iostat -x | grep {#DEVNAME} | awk ''{print $2}'''
username: '{$SSH.USER}'
password: '{$SSH.PWD}'
description: 'r/s (read operations per second) - the number (after merges) of read requests completed per second for the device.'
tags:
- tag: component
value: storage
- tag: disk
value: '{#DEVNAME}'
- uuid: 9542c7fdba73471e8d6c5c08550aa2cc
name: '{#DEVNAME}: Disk read time (rate)'
type: SSH
key: 'ssh.run[vfs.dev.read.time.rate.{#DEVNAME},,{$SSH.PORT}]'
value_type: FLOAT
params: 'iostat -x | grep {#DEVNAME} | awk ''{print $6}'''
username: '{$SSH.USER}'
password: '{$SSH.PWD}'
description: 'The rate of total read time counter; used in `r_await` calculation.'
tags:
- tag: component
value: storage
- tag: disk
value: '{#DEVNAME}'
- uuid: 769465499b2f40a0af7d919a8f125956
name: '{#DEVNAME}: Disk write request avg waiting time (w_await)'
type: SSH
key: 'ssh.run[vfs.dev.write.await.{#DEVNAME},,{$SSH.PORT}]'
value_type: FLOAT
units: ms
params: 'iostat -x | grep {#DEVNAME} | awk ''{print $11}'''
username: '{$SSH.USER}'
password: '{$SSH.PWD}'
description: 'This formula contains two Boolean expressions that evaluate to 1 or 0 in order to set the calculated metric to zero and to avoid the exception - division by zero.'
tags:
- tag: component
value: storage
- tag: disk
value: '{#DEVNAME}'
- uuid: df755e084aba4fbc8be348a9b5aaab70
name: '{#DEVNAME}: Disk write rate'
type: SSH
key: 'ssh.run[vfs.dev.write.rate.{#DEVNAME},,{$SSH.PORT}]'
value_type: FLOAT
units: w/s
params: 'iostat -x | grep {#DEVNAME} | awk ''{print $3}'''
username: '{$SSH.USER}'
password: '{$SSH.PWD}'
description: 'w/s (write operations per second) - the number (after merges) of write requests completed per second for the device.'
tags:
- tag: component
value: storage
- tag: disk
value: '{#DEVNAME}'
- uuid: 30cb09ff09ac4531bbb935f964629866
name: '{#DEVNAME}: Disk write time (rate)'
type: SSH
key: 'ssh.run[vfs.dev.write.time.rate.{#DEVNAME},,{$SSH.PORT}]'
value_type: FLOAT
params: 'iostat -x | grep {#DEVNAME} | awk ''{print $7}'''
username: '{$SSH.USER}'
password: '{$SSH.PWD}'
description: 'The rate of total write time counter; used in `w_await` calculation.'
tags:
- tag: component
value: storage
- tag: disk
value: '{#DEVNAME}'
trigger_prototypes:
- uuid: 41b40a8715f94323bc31f36b73d3973d
expression: 'min(/Linux by SSH/ssh.run[vfs.dev.read.await.{#DEVNAME},,{$SSH.PORT}],15m) > {$VFS.DEV.READ.AWAIT.WARN:"{#DEVNAME}"} or min(/Linux by SSH/ssh.run[vfs.dev.write.await.{#DEVNAME},,{$SSH.PORT}],15m) > {$VFS.DEV.WRITE.AWAIT.WARN:"{#DEVNAME}"}'
name: '{#DEVNAME}: Disk read/write request responses are too high'
event_name: '{#DEVNAME}: Disk read/write request responses are too high (read > {$VFS.DEV.READ.AWAIT.WARN:"{#DEVNAME}"} ms for 15m or write > {$VFS.DEV.WRITE.AWAIT.WARN:"{#DEVNAME}"} ms for 15m)'
priority: WARNING
description: 'This trigger might indicate the disk `{#DEVNAME}` saturation.'
manual_close: 'YES'
tags:
- tag: scope
value: performance
preprocessing:
- type: JAVASCRIPT
parameters:
- |
return JSON.stringify(value.split("\n").map(function (name) {
return ({"{#DEVNAME}": name});
}));
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
- uuid: 840c2e71f37f4aaf98fc8b377d6c8e9d
name: 'Mounted filesystem discovery'
type: SSH
@ -1512,6 +1652,14 @@ zabbix_export:
- type: STRING
name: reference
value: AAAAD
valuemaps:
- uuid: 7d3ba2959ebe48f58df02668f2253b61
name: 'Service state'
mappings:
- value: '0'
newvalue: Down
- value: '1'
newvalue: Up
triggers:
- uuid: 49d74dedfa69411da6f85eadf613388a
expression: 'last(/Linux by SSH/ssh.run[proc.num,,{$SSH.PORT}])/last(/Linux by SSH/ssh.run[kernel.maxproc,,{$SSH.PORT}])*100>80'