mirror of
https://github.com/a-stoyanov/zabbix-domain-expiry.git
synced 2025-12-13 18:02:31 +00:00
v2.0.0
This commit is contained in:
parent
9b8e1279fb
commit
f1d2906d4e
2 changed files with 1067 additions and 532 deletions
1189
check_domain.sh
1189
check_domain.sh
File diff suppressed because it is too large
Load diff
|
|
@ -1,89 +1,98 @@
|
||||||
zabbix_export:
|
zabbix_export:
|
||||||
version: '6.4'
|
version: '6.4'
|
||||||
|
template_groups:
|
||||||
|
- uuid: 7df96b18c230490a9a0a9e2307226338
|
||||||
|
name: Templates
|
||||||
templates:
|
templates:
|
||||||
- uuid: d2df9ca51f754af8aff5d50f96c656e3
|
- uuid: 644e89db964346f3b1ecd249d2d57876
|
||||||
template: 'Domain Expiry'
|
template: 'Domain Expiry'
|
||||||
name: 'Domain Expiry'
|
name: 'Domain Expiry'
|
||||||
description: 'Template downloaded from: https://github.com/a-stoyanov/zabbix-domain-expiry'
|
description: |
|
||||||
|
Template version: 2.0.0
|
||||||
|
Downloaded from: https://github.com/a-stoyanov/zabbix-domain-expiry
|
||||||
vendor:
|
vendor:
|
||||||
name: github.com/a-stoyanov
|
name: github.com/a-stoyanov
|
||||||
version: 6.4-0
|
version: 6.4-0
|
||||||
groups:
|
groups:
|
||||||
- name: Custom/Domain
|
- name: Templates
|
||||||
items:
|
items:
|
||||||
- uuid: 24dcc49a7c384aaeb3dd8846b3401986
|
- uuid: 7446af7e8dce480690f2ebd72a843953
|
||||||
name: 'Domain Check Expiry'
|
|
||||||
type: EXTERNAL
|
|
||||||
key: 'check_domain.sh["-d",{HOST.NAME},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
|
||||||
delay: 1d
|
|
||||||
history: '0'
|
|
||||||
trends: '0'
|
|
||||||
value_type: TEXT
|
|
||||||
- uuid: 78a9ed45942a482f88d60acd4a24538d
|
|
||||||
name: 'Days Left'
|
name: 'Days Left'
|
||||||
type: DEPENDENT
|
type: DEPENDENT
|
||||||
key: domain_check_expiry.days_left
|
key: check_domain.days_left
|
||||||
delay: '0'
|
delay: '0'
|
||||||
|
value_type: FLOAT
|
||||||
preprocessing:
|
preprocessing:
|
||||||
- type: REGEX
|
- type: JSONPATH
|
||||||
parameters:
|
parameters:
|
||||||
- 'Days left: (\d+)'
|
- $.days_left
|
||||||
- \1
|
|
||||||
error_handler: CUSTOM_VALUE
|
error_handler: CUSTOM_VALUE
|
||||||
error_handler_params: '0'
|
error_handler_params: '0'
|
||||||
master_item:
|
master_item:
|
||||||
key: 'check_domain.sh["-d",{HOST.NAME},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
||||||
- uuid: bccdb32210514ba1801f3c9a50c2b737
|
- uuid: 5a55bf6bf9b8490bb058982428572485
|
||||||
name: 'Days Since Expired'
|
name: 'Days Since Expired'
|
||||||
type: DEPENDENT
|
type: DEPENDENT
|
||||||
key: domain_check_expiry.days_since_expired
|
key: check_domain.days_since_expired
|
||||||
delay: '0'
|
delay: '0'
|
||||||
|
value_type: FLOAT
|
||||||
preprocessing:
|
preprocessing:
|
||||||
- type: REGEX
|
- type: JSONPATH
|
||||||
parameters:
|
parameters:
|
||||||
- 'Days since expired: (\d+)'
|
- $.days_since_expired
|
||||||
- \1
|
|
||||||
error_handler: CUSTOM_VALUE
|
error_handler: CUSTOM_VALUE
|
||||||
error_handler_params: '0'
|
error_handler_params: '0'
|
||||||
master_item:
|
master_item:
|
||||||
key: 'check_domain.sh["-d",{HOST.NAME},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
||||||
- uuid: c6c00c3717d84bf291420b7913b1133d
|
- uuid: 0e104f2540204ac686072bd6cec91a86
|
||||||
name: 'Expire Date'
|
name: 'Expire Date'
|
||||||
type: DEPENDENT
|
type: DEPENDENT
|
||||||
key: domain_check_expiry.expire_date
|
key: check_domain.expire_date
|
||||||
delay: '0'
|
delay: '0'
|
||||||
trends: '0'
|
|
||||||
value_type: TEXT
|
value_type: TEXT
|
||||||
|
trends: '0'
|
||||||
preprocessing:
|
preprocessing:
|
||||||
- type: REGEX
|
- type: JSONPATH
|
||||||
parameters:
|
parameters:
|
||||||
- 'Expire date: (.+)'
|
- $.expire_date
|
||||||
- \1
|
|
||||||
error_handler: CUSTOM_VALUE
|
error_handler: CUSTOM_VALUE
|
||||||
error_handler_params: '0'
|
error_handler_params: '0'
|
||||||
master_item:
|
master_item:
|
||||||
key: 'check_domain.sh["-d",{HOST.NAME},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
||||||
- uuid: 67828b062ef74c0f8e866a9fbfb78d27
|
- uuid: 99f25b8648814596a72f66f3e3db01cf
|
||||||
name: Status
|
name: Message
|
||||||
type: DEPENDENT
|
type: DEPENDENT
|
||||||
key: domain_check_expiry.status
|
key: check_domain.message
|
||||||
delay: '0'
|
delay: '0'
|
||||||
trends: '0'
|
|
||||||
value_type: TEXT
|
value_type: TEXT
|
||||||
|
trends: '0'
|
||||||
preprocessing:
|
preprocessing:
|
||||||
- type: REGEX
|
- type: JSONPATH
|
||||||
parameters:
|
parameters:
|
||||||
- 'State: (.+)'
|
- $.message
|
||||||
- \1
|
|
||||||
master_item:
|
master_item:
|
||||||
key: 'check_domain.sh["-d",{HOST.NAME},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
||||||
triggers:
|
- uuid: 48baf9c076d1453d8c7272dffa014fd9
|
||||||
- uuid: 2a7fb4f347ce4c5aa0617f08a0b339f0
|
name: 'Check Domain'
|
||||||
expression: 'find(/Domain Expiry/domain_check_expiry.status,#1,"like","UNKNOWN")=1'
|
type: EXTERNAL
|
||||||
name: 'Domain Expiry: {HOST.NAME} - {ITEM.LASTVALUE1}'
|
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
||||||
tags:
|
delay: 1d
|
||||||
- tag: domain
|
history: '0'
|
||||||
value: status
|
value_type: TEXT
|
||||||
|
trends: '0'
|
||||||
|
- uuid: ceb24ded619c4d34b8394a50d700bf52
|
||||||
|
name: State
|
||||||
|
type: DEPENDENT
|
||||||
|
key: check_domain.state
|
||||||
|
delay: '0'
|
||||||
|
value_type: TEXT
|
||||||
|
trends: '0'
|
||||||
|
preprocessing:
|
||||||
|
- type: JSONPATH
|
||||||
|
parameters:
|
||||||
|
- $.state
|
||||||
|
master_item:
|
||||||
|
key: 'check_domain.sh["-d",{HOST.HOST},"-r",{$RDAP_SERVER},"-s",{$WHOIS_SERVER},"-w",{$EXP_WARN},"-c",{$EXP_CRIT}]'
|
||||||
tags:
|
tags:
|
||||||
- tag: domain
|
- tag: domain
|
||||||
value: registration
|
value: registration
|
||||||
|
|
@ -94,59 +103,82 @@ zabbix_export:
|
||||||
- macro: '{$EXP_WARN}'
|
- macro: '{$EXP_WARN}'
|
||||||
value: '30'
|
value: '30'
|
||||||
description: 'Threshold value of days remaining before triggering a WARNING alert'
|
description: 'Threshold value of days remaining before triggering a WARNING alert'
|
||||||
|
- macro: '{$RDAP_SERVER}'
|
||||||
|
description: 'Specify which RDAP server to use. Default empty value will use IANA lookup'
|
||||||
- macro: '{$WHOIS_SERVER}'
|
- macro: '{$WHOIS_SERVER}'
|
||||||
value: '""'
|
description: 'Specify which WHOIS server to use. Default empty value will use the whois utility config (rfc-3912 lookup)'
|
||||||
description: 'Used to specify which whois service to use. Default value "" uses the whois util config default'
|
|
||||||
triggers:
|
triggers:
|
||||||
- uuid: acf67a4bfd9649c9a96c63cafa812e9b
|
- uuid: 126653ca5057472c9499f5bcf74b17ba
|
||||||
expression: |
|
expression: |
|
||||||
find(/Domain Expiry/domain_check_expiry.status,#1,"like","EXPIRED")=1
|
last(/Domain Expiry/check_domain.state)="UNKNOWN"
|
||||||
and
|
and
|
||||||
last(/Domain Expiry/domain_check_expiry.days_since_expired)>=0
|
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
|
||||||
|
expression: |
|
||||||
|
last(/Domain Expiry/check_domain.state)="CRITICAL"
|
||||||
and
|
and
|
||||||
last(/Domain Expiry/domain_check_expiry.expire_date)<>0
|
last(/Domain Expiry/check_domain.days_since_expired)>0
|
||||||
name: 'Domain Expiry: {HOST.NAME} has expired'
|
and
|
||||||
|
last(/Domain Expiry/check_domain.expire_date)<>0
|
||||||
|
name: 'Domain Expiry: {HOST.HOST} has expired'
|
||||||
opdata: '{ITEM.LASTVALUE2} days ago on {ITEM.LASTVALUE3}'
|
opdata: '{ITEM.LASTVALUE2} days ago on {ITEM.LASTVALUE3}'
|
||||||
priority: DISASTER
|
priority: DISASTER
|
||||||
|
description: 'Raise alert if domain registration has expired.'
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: 'Domain Expiry: {HOST.NAME} - {ITEM.LASTVALUE1}'
|
- name: 'Domain Expiry: {HOST.HOST} - {ITEM.LASTVALUE2}'
|
||||||
expression: 'find(/Domain Expiry/domain_check_expiry.status,#1,"like","UNKNOWN")=1'
|
expression: |
|
||||||
|
last(/Domain Expiry/check_domain.state)="UNKNOWN"
|
||||||
|
and
|
||||||
|
last(/Domain Expiry/check_domain.message)<>0
|
||||||
tags:
|
tags:
|
||||||
- tag: domain
|
- tag: domain
|
||||||
value: expired
|
value: expired
|
||||||
- uuid: 7664fe7d988e4bcca9dd1518e42abf79
|
- uuid: 5f767265e8714f1db4e969d4f7f95448
|
||||||
expression: |
|
expression: |
|
||||||
last(/Domain Expiry/domain_check_expiry.days_left)<={$EXP_CRIT}
|
last(/Domain Expiry/check_domain.state)="CRITICAL"
|
||||||
and
|
and
|
||||||
last(/Domain Expiry/domain_check_expiry.expire_date)<>0
|
last(/Domain Expiry/check_domain.days_left)<={$EXP_CRIT}
|
||||||
name: 'Domain Expiry: {HOST.NAME} will expire soon'
|
and
|
||||||
opdata: 'in {ITEM.LASTVALUE1} days on {ITEM.LASTVALUE2}'
|
last(/Domain Expiry/check_domain.expire_date)<>0
|
||||||
|
name: 'Domain Expiry: {HOST.HOST} will expire soon'
|
||||||
|
opdata: 'in {ITEM.LASTVALUE2} days on {ITEM.LASTVALUE3}'
|
||||||
priority: HIGH
|
priority: HIGH
|
||||||
|
description: 'Raise alert if number of days remaining before expiry is below critical threshold ({$EXP_CRIT}).'
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: 'Domain Expiry: {HOST.NAME} has expired'
|
- name: 'Domain Expiry: {HOST.HOST} has expired'
|
||||||
expression: |
|
expression: |
|
||||||
find(/Domain Expiry/domain_check_expiry.status,#1,"like","EXPIRED")=1
|
last(/Domain Expiry/check_domain.state)="CRITICAL"
|
||||||
and
|
and
|
||||||
last(/Domain Expiry/domain_check_expiry.days_since_expired)>=0
|
last(/Domain Expiry/check_domain.days_since_expired)>0
|
||||||
and
|
and
|
||||||
last(/Domain Expiry/domain_check_expiry.expire_date)<>0
|
last(/Domain Expiry/check_domain.expire_date)<>0
|
||||||
tags:
|
tags:
|
||||||
- tag: domain
|
- tag: domain
|
||||||
value: expiry
|
value: expiry
|
||||||
- uuid: ff152c25e3114727ad0a34ccd2a1640e
|
- uuid: 68e36957e56b4d95860b6a8c131a9e1b
|
||||||
expression: |
|
expression: |
|
||||||
last(/Domain Expiry/domain_check_expiry.days_left)<={$EXP_WARN}
|
last(/Domain Expiry/check_domain.state)="WARNING"
|
||||||
and
|
and
|
||||||
last(/Domain Expiry/domain_check_expiry.expire_date)<>0
|
last(/Domain Expiry/check_domain.days_left)<={$EXP_WARN}
|
||||||
name: 'Domain Expiry: {HOST.NAME} will expire soon'
|
and
|
||||||
opdata: 'in {ITEM.LASTVALUE1} days on {ITEM.LASTVALUE2}'
|
last(/Domain Expiry/check_domain.expire_date)<>0
|
||||||
|
name: 'Domain Expiry: {HOST.HOST} will expire soon'
|
||||||
|
opdata: 'in {ITEM.LASTVALUE2} days on {ITEM.LASTVALUE3}'
|
||||||
priority: WARNING
|
priority: WARNING
|
||||||
|
description: 'Raise alert if number of days remaining before expiry is below warning threshold ({$EXP_WARN}).'
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: 'Domain Expiry: {HOST.NAME} will expire soon'
|
- name: 'Domain Expiry: {HOST.HOST} will expire soon'
|
||||||
expression: |
|
expression: |
|
||||||
last(/Domain Expiry/domain_check_expiry.days_left)<={$EXP_CRIT}
|
last(/Domain Expiry/check_domain.state)="CRITICAL"
|
||||||
and
|
and
|
||||||
last(/Domain Expiry/domain_check_expiry.expire_date)<>0
|
last(/Domain Expiry/check_domain.days_left)<={$EXP_CRIT}
|
||||||
|
and
|
||||||
|
last(/Domain Expiry/check_domain.expire_date)<>0
|
||||||
tags:
|
tags:
|
||||||
- tag: domain
|
- tag: domain
|
||||||
value: expiry
|
value: expiry
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue