Skip to content

Commit f377a4f

Browse files
authored
Merge pull request #4 from nikosch86/disk-status-and-lifetime
Disk status and lifetime - bump to reflect that this is for zabbix 7.2
2 parents fea645c + b34d870 commit f377a4f

File tree

2 files changed

+43
-37
lines changed

2 files changed

+43
-37
lines changed

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PBS uses an API, the documentation can be found here: https://pbs.proxmox.com/do
88

99
## Requirements
1010

11-
Zabbix 6.4 and higher
11+
Zabbix 7.2 and higher
1212

1313
## Tested versions
1414

@@ -107,5 +107,5 @@ Use the resulting Token ID and Secret in the host macros.
107107
| -------------------------------------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------- |
108108
| PBS: Disk [{#DATASTORE.NAME}] Model has changed | <p>The model identifier has changed.</p> | `last(/Proxmox Backup Server by HTTP/pbs.disk.model[{#DISK.PATH}],#1)<>last(/Proxmox Backup Server by HTTP/pbs.disk.model[{#DISK.PATH}],#2)` | Warning | |
109109
| PBS: Disk [{#DATASTORE.NAME}] Serial has changed | <p>The Serial number has changed.</p> | `last(/Proxmox Backup Server by HTTP/pbs.disk.serial[{#DISK.PATH}],#1)<>last(/Proxmox Backup Server by HTTP/pbs.disk.serial[{#DISK.PATH}],#2)` | Warning | |
110-
| PBS: Disk [{#DATASTORE.NAME}] Status indicates a problem | <p>The Status indicator shows some different from 'unknown'.</p> | `find(/Proxmox Backup Server by HTTP/pbs.disk.status[{#DISK.PATH}],,"like","unknown")=0` | Warning | |
110+
| PBS: Disk [{#DATASTORE.NAME}] Status indicates a problem | <p>The Status indicator shows 'failed'.</p> | `find(/Proxmox Backup Server by HTTP/pbs.disk.status[{#DISK.PATH}],,"like","failed")=1` | Warning | |
111111
| PBS: Disk [{#DATASTORE.NAME}] Used has changed | <p>The disk is being reported as used differently than before.</p> | `last(/Proxmox Backup Server by HTTP/pbs.disk.used[{#DISK.PATH}],#1)<>last(/Proxmox Backup Server by HTTP/pbs.disk.used[{#DISK.PATH}],#2)` | Warning | |

template_app_proxmox_backup_server.yaml

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
zabbix_export:
2-
version: '6.4'
2+
version: '7.2'
33
template_groups:
44
- uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
55
name: Templates/Applications
@@ -46,6 +46,8 @@ zabbix_export:
4646
- name: token
4747
value: '{$PBS.TOKEN.ID}'
4848
tags:
49+
- tag: component
50+
value: backup
4951
- tag: component
5052
value: system
5153
triggers:
@@ -58,13 +60,13 @@ zabbix_export:
5860
type: HTTP_AGENT
5961
key: pbs.datastore.status
6062
delay: 5m
61-
trends: '0'
63+
history: 90d
6264
value_type: TEXT
6365
description: 'Get datastore status.'
6466
preprocessing:
6567
- type: CHECK_NOT_SUPPORTED
6668
parameters:
67-
- ''
69+
- '-1'
6870
error_handler: CUSTOM_VALUE
6971
error_handler_params: 'Error getting data'
7072
- type: JSONPATH
@@ -77,20 +79,22 @@ zabbix_export:
7779
value: 'PBSAPIToken={$PBS.TOKEN.ID}:{$PBS.TOKEN.SECRET}'
7880
output_format: JSON
7981
tags:
82+
- tag: component
83+
value: backup
8084
- tag: component
8185
value: raw
8286
- uuid: 83c76592aedf4833a63393b5e7b54fb9
8387
name: 'PBS: Get disks'
8488
type: HTTP_AGENT
8589
key: pbs.disks
8690
delay: 5m
87-
trends: '0'
91+
history: 90d
8892
value_type: TEXT
8993
description: 'Get disks.'
9094
preprocessing:
9195
- type: CHECK_NOT_SUPPORTED
9296
parameters:
93-
- ''
97+
- '-1'
9498
error_handler: CUSTOM_VALUE
9599
error_handler_params: 'Error getting data'
96100
- type: JSONPATH
@@ -103,20 +107,22 @@ zabbix_export:
103107
value: 'PBSAPIToken={$PBS.TOKEN.ID}:{$PBS.TOKEN.SECRET}'
104108
output_format: JSON
105109
tags:
110+
- tag: component
111+
value: backup
106112
- tag: component
107113
value: raw
108114
- uuid: 17e7c9ee749946aaaf19ae4f1148f0d1
109115
name: 'PBS: Get failed tasks'
110116
type: HTTP_AGENT
111117
key: pbs.tasks.error
112118
delay: 5m
113-
trends: '0'
119+
history: 90d
114120
value_type: TEXT
115121
description: 'Get erroneuous tasks.'
116122
preprocessing:
117123
- type: CHECK_NOT_SUPPORTED
118124
parameters:
119-
- ''
125+
- '-1'
120126
error_handler: CUSTOM_VALUE
121127
error_handler_params: 'Error getting data'
122128
- type: JSONPATH
@@ -157,6 +163,8 @@ zabbix_export:
157163
value: 'PBSAPIToken={$PBS.TOKEN.ID}:{$PBS.TOKEN.SECRET}'
158164
output_format: JSON
159165
tags:
166+
- tag: component
167+
value: backup
160168
- tag: component
161169
value: raw
162170
triggers:
@@ -173,13 +181,14 @@ zabbix_export:
173181
name: 'PBS: Datastore discovery'
174182
type: DEPENDENT
175183
key: pbs.datastore.discovery
176-
delay: '0'
184+
lifetime: 30d
185+
enabled_lifetime_type: DISABLE_NEVER
177186
item_prototypes:
178187
- uuid: 60f2c0498c414dfdab7e80cc7ea2985b
179188
name: 'PBS: Datastore [{#DATASTORE.NAME}] Available Size'
180189
type: DEPENDENT
181190
key: 'pbs.datastore.available[{#DATASTORE.NAME}]'
182-
delay: '0'
191+
history: 90d
183192
units: bytes
184193
description: 'Available size of datastore in bytes.'
185194
preprocessing:
@@ -208,8 +217,7 @@ zabbix_export:
208217
name: 'PBS: Datastore [{#DATASTORE.NAME}] Error'
209218
type: DEPENDENT
210219
key: 'pbs.datastore.error[{#DATASTORE.NAME}]'
211-
delay: '0'
212-
trends: '0'
220+
history: 90d
213221
value_type: TEXT
214222
description: 'Error status of datastore.'
215223
preprocessing:
@@ -238,8 +246,7 @@ zabbix_export:
238246
name: 'PBS: Datastore [{#DATASTORE.NAME}] Estimated Full Date'
239247
type: DEPENDENT
240248
key: 'pbs.datastore.estimatedfulldate[{#DATASTORE.NAME}]'
241-
delay: '0'
242-
trends: '0'
249+
history: 90d
243250
value_type: TEXT
244251
description: |
245252
Estimation of the Date Time Stamp when the storage will be full.
@@ -271,7 +278,7 @@ zabbix_export:
271278
name: 'PBS: Datastore [{#DATASTORE.NAME}] Estimated Seconds to Full'
272279
type: DEPENDENT
273280
key: 'pbs.datastore.estimatedsecondstofull[{#DATASTORE.NAME}]'
274-
delay: '0'
281+
history: 90d
275282
description: |
276283
Estimation of the UNIX epoch when the storage will be full.
277284
It's calculated via a simple Linear Regression (Least Squares) over the RRD data of the
@@ -312,8 +319,7 @@ zabbix_export:
312319
name: 'PBS: Datastore [{#DATASTORE.NAME}] Estimated Time to Full'
313320
type: DEPENDENT
314321
key: 'pbs.datastore.estimatedtimetofull[{#DATASTORE.NAME}]'
315-
delay: '0'
316-
trends: '0'
322+
history: 90d
317323
value_type: TEXT
318324
description: |
319325
Estimation of the Time until the storage will be full.
@@ -357,7 +363,7 @@ zabbix_export:
357363
name: 'PBS: Datastore [{#DATASTORE.NAME}] Total Size'
358364
type: DEPENDENT
359365
key: 'pbs.datastore.total[{#DATASTORE.NAME}]'
360-
delay: '0'
366+
history: 90d
361367
units: bytes
362368
description: 'Total size of datastore in bytes.'
363369
preprocessing:
@@ -375,7 +381,7 @@ zabbix_export:
375381
name: 'PBS: Datastore [{#DATASTORE.NAME}] Used Size'
376382
type: DEPENDENT
377383
key: 'pbs.datastore.used[{#DATASTORE.NAME}]'
378-
delay: '0'
384+
history: 90d
379385
units: bytes
380386
description: 'Used size of datastore in bytes.'
381387
preprocessing:
@@ -401,14 +407,14 @@ zabbix_export:
401407
name: 'PBS: Disk discovery'
402408
type: DEPENDENT
403409
key: pbs.disk.discovery
404-
delay: '0'
410+
lifetime: 30d
411+
enabled_lifetime_type: DISABLE_NEVER
405412
item_prototypes:
406413
- uuid: 85501120e36d48589a52d56d0dec55d7
407414
name: 'PBS: Disk [{#DISK.PATH}] Model'
408415
type: DEPENDENT
409416
key: 'pbs.disk.model[{#DISK.PATH}]'
410-
delay: '0'
411-
trends: '0'
417+
history: 90d
412418
value_type: TEXT
413419
description: 'Model of the disk.'
414420
preprocessing:
@@ -430,8 +436,7 @@ zabbix_export:
430436
name: 'PBS: Disk [{#DISK.PATH}] Name'
431437
type: DEPENDENT
432438
key: 'pbs.disk.name[{#DISK.PATH}]'
433-
delay: '0'
434-
trends: '0'
439+
history: 90d
435440
value_type: TEXT
436441
description: 'Name of the disk.'
437442
preprocessing:
@@ -447,8 +452,7 @@ zabbix_export:
447452
name: 'PBS: Disk [{#DISK.PATH}] Serial'
448453
type: DEPENDENT
449454
key: 'pbs.disk.serial[{#DISK.PATH}]'
450-
delay: '0'
451-
trends: '0'
455+
history: 90d
452456
value_type: TEXT
453457
description: 'Serial of the disk.'
454458
preprocessing:
@@ -470,7 +474,7 @@ zabbix_export:
470474
name: 'PBS: Disk [{#DISK.PATH}] Size'
471475
type: DEPENDENT
472476
key: 'pbs.disk.size[{#DISK.PATH}]'
473-
delay: '0'
477+
history: 90d
474478
units: bytes
475479
description: 'Total Size of disk in bytes.'
476480
preprocessing:
@@ -486,8 +490,7 @@ zabbix_export:
486490
name: 'PBS: Disk [{#DISK.PATH}] Status'
487491
type: DEPENDENT
488492
key: 'pbs.disk.status[{#DISK.PATH}]'
489-
delay: '0'
490-
trends: '0'
493+
history: 90d
491494
value_type: TEXT
492495
description: 'Disk status.'
493496
preprocessing:
@@ -499,18 +502,20 @@ zabbix_export:
499502
- 1h
500503
master_item:
501504
key: pbs.disks
505+
tags:
506+
- tag: component
507+
value: pbs_disk
502508
trigger_prototypes:
503509
- uuid: 0ebb109edcbc40d095945ca9a530dc5f
504-
expression: 'find(/Proxmox Backup Server by HTTP/pbs.disk.status[{#DISK.PATH}],,"like","unknown")=0'
510+
expression: 'find(/Proxmox Backup Server by HTTP/pbs.disk.status[{#DISK.PATH}],,"like","failed")=1'
505511
name: 'PBS: Disk [{#DISK.PATH}] Status indicates a problem'
506512
priority: WARNING
507513
manual_close: 'YES'
508514
- uuid: 4e4148965fd9483bbc1ba7c145368bba
509515
name: 'PBS: Disk [{#DISK.PATH}] Used'
510516
type: DEPENDENT
511517
key: 'pbs.disk.used[{#DISK.PATH}]'
512-
delay: '0'
513-
trends: '0'
518+
history: 90d
514519
value_type: TEXT
515520
description: 'Indicates where (and if) that disk is used by PBS.'
516521
preprocessing:
@@ -532,8 +537,7 @@ zabbix_export:
532537
name: 'PBS: Disk [{#DISK.PATH}] Vendor'
533538
type: DEPENDENT
534539
key: 'pbs.disk.vendor[{#DISK.PATH}]'
535-
delay: '0'
536-
trends: '0'
540+
history: 90d
537541
value_type: TEXT
538542
description: 'Vendor of the disk.'
539543
preprocessing:
@@ -549,8 +553,7 @@ zabbix_export:
549553
name: 'PBS: Disk [{#DISK.PATH}] Wearout'
550554
type: DEPENDENT
551555
key: 'pbs.disk.wearout[{#DISK.PATH}]'
552-
delay: '0'
553-
trends: '0'
556+
history: 90d
554557
value_type: TEXT
555558
description: 'Wearout indicator.'
556559
preprocessing:
@@ -583,6 +586,9 @@ zabbix_export:
583586
path: $.vendor
584587
- lld_macro: '{#DISK.WEAROUT}'
585588
path: $.wearout
589+
tags:
590+
- tag: component
591+
value: backup
586592
macros:
587593
- macro: '{$PBS.DATASTORE.AVAILABLE.MIN}'
588594
value: '10737418240'

0 commit comments

Comments
 (0)