-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathTemplate Domain check via file.yaml
83 lines (83 loc) · 3.17 KB
/
Template Domain check via file.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
zabbix_export:
version: '6.2'
date: '2023-03-26T10:25:27Z'
template_groups:
-
uuid: 7df96b18c230490a9a0a9e2307226338
name: Templates
templates:
-
uuid: b16bf4e6b1e645a49ff061a83647f2ad
template: 'Template Domain check via file'
name: 'Template Domain check via file'
groups:
-
name: Templates
discovery_rules:
-
uuid: f0f5caf81a9a4ba7aa16b5ccc4296e8c
name: 'Domains discovery via file'
type: EXTERNAL
key: 'list.sh["ssl_check.json","1"]'
delay: 1h
lifetime: 60d
item_prototypes:
-
uuid: 6df79ee6939244d5a1d854063dde8d8f
name: 'Domain {#DOMAIN_NAME} expire in'
type: EXTERNAL
key: 'whois_expire.sh[{#DOMAIN_NAME}]'
delay: 1d
trends: 730d
units: day(s)
tags:
-
tag: Application
value: 'Domain checks'
trigger_prototypes:
-
uuid: 72ce8aaf74364d66893b7f2f9bcd4ac7
expression: 'last(/Template Domain check via file/whois_expire.sh[{#DOMAIN_NAME}])<=0'
name: 'Domain {#DOMAIN_NAME} expired'
priority: DISASTER
-
uuid: 7803bdf2ade94f02ad74c140c0631148
expression: 'last(/Template Domain check via file/whois_expire.sh[{#DOMAIN_NAME}])<14'
name: 'Domain {#DOMAIN_NAME} will expire in 14 days'
priority: HIGH
dependencies:
-
name: 'Domain {#DOMAIN_NAME} expired'
expression: 'last(/Template Domain check via file/whois_expire.sh[{#DOMAIN_NAME}])<=0'
-
uuid: dd7366cd97a4408196d48b74745cd4a6
expression: 'last(/Template Domain check via file/whois_expire.sh[{#DOMAIN_NAME}])<30'
name: 'Domain {#DOMAIN_NAME} will expire in 30 days'
priority: WARNING
dependencies:
-
name: 'Domain {#DOMAIN_NAME} will expire in 14 days'
expression: 'last(/Template Domain check via file/whois_expire.sh[{#DOMAIN_NAME}])<14'
lld_macro_paths:
-
lld_macro: '{#DOMAIN_NAME}'
path: $.domain_name
preprocessing:
-
type: JAVASCRIPT
parameters:
- |
var urls = JSON.parse(value);
var dom_names = [];
for (var i = 0; i < urls.length; i++) {
var j = urls[i].url.split('.');
var dn = j[j.length - 2] + '.' + j[j.length - 1];
if (dom_names.indexOf(dn) == -1) {
dom_names.push(dn);
}
}
var dnames = [];
for (var i = 0; i < dom_names.length; i++) {
dnames.push({'domain_name': dom_names[i]});
}
return JSON.stringify(dnames);