zabbix-domain-expiry/zbx_domain_expiry.yaml

185 lines
6.9 KiB
YAML
Raw Permalink Normal View History

2023-11-28 18:46:39 +02:00
zabbix_export:
version: '6.4'
2025-06-26 17:54:43 +01:00
template_groups:
- uuid: 7df96b18c230490a9a0a9e2307226338
name: Templates
2023-11-28 18:46:39 +02:00
templates:
2025-06-26 17:54:43 +01:00
- uuid: 644e89db964346f3b1ecd249d2d57876
2023-11-28 18:46:39 +02:00
template: 'Domain Expiry'
name: 'Domain Expiry'
2025-06-26 17:54:43 +01:00
description: |
Template version: 2.0.0
Downloaded from: https://github.com/a-stoyanov/zabbix-domain-expiry
2023-11-28 18:46:39 +02:00
vendor:
name: github.com/a-stoyanov
version: 6.4-0
groups:
2025-06-26 17:54:43 +01:00
- name: Templates
2023-11-28 18:46:39 +02:00
items:
2025-06-26 17:54:43 +01:00
- uuid: 7446af7e8dce480690f2ebd72a843953
2023-11-28 18:46:39 +02:00
name: 'Days Left'
type: DEPENDENT
2025-06-26 17:54:43 +01:00
key: check_domain.days_left
2023-11-28 18:46:39 +02:00
delay: '0'
2025-06-26 17:54:43 +01:00
value_type: FLOAT
2023-11-28 18:46:39 +02:00
preprocessing:
2025-06-26 17:54:43 +01:00
- type: JSONPATH
2023-11-28 18:46:39 +02:00
parameters:
2025-06-26 17:54:43 +01:00
- $.days_left
2023-11-28 18:46:39 +02:00
error_handler: CUSTOM_VALUE
error_handler_params: '0'
master_item:
2025-06-26 17:54:43 +01:00
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
- uuid: 5a55bf6bf9b8490bb058982428572485
2023-11-28 18:46:39 +02:00
name: 'Days Since Expired'
type: DEPENDENT
2025-06-26 17:54:43 +01:00
key: check_domain.days_since_expired
2023-11-28 18:46:39 +02:00
delay: '0'
2025-06-26 17:54:43 +01:00
value_type: FLOAT
2023-11-28 18:46:39 +02:00
preprocessing:
2025-06-26 17:54:43 +01:00
- type: JSONPATH
2023-11-28 18:46:39 +02:00
parameters:
2025-06-26 17:54:43 +01:00
- $.days_since_expired
2023-11-28 18:46:39 +02:00
error_handler: CUSTOM_VALUE
error_handler_params: '0'
master_item:
2025-06-26 17:54:43 +01:00
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
- uuid: 0e104f2540204ac686072bd6cec91a86
2023-11-28 18:46:39 +02:00
name: 'Expire Date'
type: DEPENDENT
2025-06-26 17:54:43 +01:00
key: check_domain.expire_date
2023-11-28 18:46:39 +02:00
delay: '0'
value_type: TEXT
2025-06-26 17:54:43 +01:00
trends: '0'
2023-11-28 18:46:39 +02:00
preprocessing:
2025-06-26 17:54:43 +01:00
- type: JSONPATH
2023-11-28 18:46:39 +02:00
parameters:
2025-06-26 17:54:43 +01:00
- $.expire_date
2023-11-28 18:46:39 +02:00
error_handler: CUSTOM_VALUE
error_handler_params: '0'
master_item:
2025-06-26 17:54:43 +01:00
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
- uuid: 99f25b8648814596a72f66f3e3db01cf
name: Message
2023-11-28 18:46:39 +02:00
type: DEPENDENT
2025-06-26 17:54:43 +01:00
key: check_domain.message
2023-11-28 18:46:39 +02:00
delay: '0'
2025-06-26 17:54:43 +01:00
value_type: TEXT
trends: '0'
preprocessing:
- type: JSONPATH
parameters:
- $.message
master_item:
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
- uuid: 48baf9c076d1453d8c7272dffa014fd9
name: 'Check Domain'
type: EXTERNAL
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
delay: 1d
history: '0'
value_type: TEXT
2023-11-28 18:46:39 +02:00
trends: '0'
2025-06-26 17:54:43 +01:00
- uuid: ceb24ded619c4d34b8394a50d700bf52
name: State
type: DEPENDENT
key: check_domain.state
delay: '0'
2023-11-28 18:46:39 +02:00
value_type: TEXT
2025-06-26 17:54:43 +01:00
trends: '0'
2023-11-28 18:46:39 +02:00
preprocessing:
2025-06-26 17:54:43 +01:00
- type: JSONPATH
2023-11-28 18:46:39 +02:00
parameters:
2025-06-26 17:54:43 +01:00
- $.state
2023-11-28 18:46:39 +02:00
master_item:
2025-06-26 17:54:43 +01:00
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
2023-11-28 18:46:39 +02:00
tags:
- tag: domain
value: registration
macros:
- macro: '{$EXP_CRIT}'
value: '7'
description: 'Threshold value of days remaining before triggering a HIGH alert'
- macro: '{$EXP_WARN}'
value: '30'
description: 'Threshold value of days remaining before triggering a WARNING alert'
2025-06-26 17:54:43 +01:00
- macro: '{$RDAP_SERVER}'
description: 'Specify which RDAP server to use. Default empty value will use IANA lookup'
2023-11-28 18:46:39 +02:00
- macro: '{$WHOIS_SERVER}'
2025-06-26 17:54:43 +01:00
description: 'Specify which WHOIS server to use. Default empty value will use the whois utility config (rfc-3912 lookup)'
2023-11-28 18:46:39 +02:00
triggers:
2025-06-26 17:54:43 +01:00
- uuid: 126653ca5057472c9499f5bcf74b17ba
expression: |
last(/Domain Expiry/check_domain.state)="UNKNOWN"
and
last(/Domain Expiry/check_domain.message)<>0
name: 'Domain Expiry: {HOST.HOST} - {ITEM.LASTVALUE2}'
description: 'Raise alert in case script is unable to determine the expiration status for the domain (state = unknown)'
tags:
- tag: domain
value: status
- uuid: 71b376de644848379c14ef181e12245a
2023-11-28 18:46:39 +02:00
expression: |
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.state)="CRITICAL"
2023-11-28 18:46:39 +02:00
and
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.days_since_expired)>0
2023-11-28 18:46:39 +02:00
and
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.expire_date)<>0
name: 'Domain Expiry: {HOST.HOST} has expired'
2023-11-28 18:46:39 +02:00
opdata: '{ITEM.LASTVALUE2} days ago on {ITEM.LASTVALUE3}'
priority: DISASTER
2025-06-26 17:54:43 +01:00
description: 'Raise alert if domain registration has expired.'
2023-11-28 18:46:39 +02:00
dependencies:
2025-06-26 17:54:43 +01:00
- name: 'Domain Expiry: {HOST.HOST} - {ITEM.LASTVALUE2}'
expression: |
last(/Domain Expiry/check_domain.state)="UNKNOWN"
and
last(/Domain Expiry/check_domain.message)<>0
2023-11-28 18:46:39 +02:00
tags:
- tag: domain
value: expired
2025-06-26 17:54:43 +01:00
- uuid: 5f767265e8714f1db4e969d4f7f95448
2023-11-28 18:46:39 +02:00
expression: |
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.state)="CRITICAL"
2023-11-28 18:46:39 +02:00
and
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.days_left)<={$EXP_CRIT}
and
last(/Domain Expiry/check_domain.expire_date)<>0
name: 'Domain Expiry: {HOST.HOST} will expire soon'
opdata: 'in {ITEM.LASTVALUE2} days on {ITEM.LASTVALUE3}'
2023-11-28 18:46:39 +02:00
priority: HIGH
2025-06-26 17:54:43 +01:00
description: 'Raise alert if number of days remaining before expiry is below critical threshold ({$EXP_CRIT}).'
2023-11-28 18:46:39 +02:00
dependencies:
2025-06-26 17:54:43 +01:00
- name: 'Domain Expiry: {HOST.HOST} has expired'
2023-11-28 18:46:39 +02:00
expression: |
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.state)="CRITICAL"
2023-11-28 18:46:39 +02:00
and
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.days_since_expired)>0
2023-11-28 18:46:39 +02:00
and
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.expire_date)<>0
2023-11-28 18:46:39 +02:00
tags:
- tag: domain
value: expiry
2025-06-26 17:54:43 +01:00
- uuid: 68e36957e56b4d95860b6a8c131a9e1b
2023-11-28 18:46:39 +02:00
expression: |
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.state)="WARNING"
and
last(/Domain Expiry/check_domain.days_left)<={$EXP_WARN}
2023-11-28 18:46:39 +02:00
and
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.expire_date)<>0
name: 'Domain Expiry: {HOST.HOST} will expire soon'
opdata: 'in {ITEM.LASTVALUE2} days on {ITEM.LASTVALUE3}'
2023-11-28 18:46:39 +02:00
priority: WARNING
2025-06-26 17:54:43 +01:00
description: 'Raise alert if number of days remaining before expiry is below warning threshold ({$EXP_WARN}).'
2023-11-28 18:46:39 +02:00
dependencies:
2025-06-26 17:54:43 +01:00
- name: 'Domain Expiry: {HOST.HOST} will expire soon'
2023-11-28 18:46:39 +02:00
expression: |
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.state)="CRITICAL"
and
last(/Domain Expiry/check_domain.days_left)<={$EXP_CRIT}
2023-11-28 18:46:39 +02:00
and
2025-06-26 17:54:43 +01:00
last(/Domain Expiry/check_domain.expire_date)<>0
2023-11-28 18:46:39 +02:00
tags:
- tag: domain
value: expiry