-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
timedatectl.yaml
200 lines (197 loc) · 7.05 KB
/
timedatectl.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
zabbix_export:
version: '7.0'
template_groups:
- uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
name: Templates/Applications
templates:
- uuid: 6d986f76224c4737991379018a5053df
template: timedatectl
name: timedatectl
description: |
Keeps track of the time and date subsystem by running timedatectl status.
Needs the following configuration:
```
AllowKey=system.run[/usr/bin/timedatectl show]
```
See [here](https://www.freedesktop.org/software/systemd/man/latest/timedatectl.html)
for more information about timedatectl.
This template is part of [RaBe's Zabbix template and helpers
collection](https://github.com/radiorabe/rabe-zabbix).
vendor:
name: RaBe
version: '7.0'
groups:
- name: Templates/Applications
items:
- uuid: f99cb96f1a434eb0a18695b599be6aa2
name: 'timedatectl: NTP service status'
type: DEPENDENT
key: rabe.timedatectl.status.ntp_service
delay: '0'
history: 7d
description: 'NTP service status'
valuemap:
name: 'Service status'
preprocessing:
- type: REGEX
parameters:
- 'NTP=(.*)'
- \1
- type: JAVASCRIPT
parameters:
- 'return {"yes": 1, "no": 0}[value]'
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 5m
master_item:
key: 'system.run[/usr/bin/timedatectl show]'
tags:
- tag: component
value: timedatectl
triggers:
- uuid: 60519a0277a346359eb813d619835bea
expression: last(/timedatectl/rabe.timedatectl.status.ntp_service)<>1
name: 'timedatectl: NTP not active'
priority: WARNING
description: 'The NTP service is not active, check `timedatectl status` for more info.'
tags:
- tag: scope
value: notice
- uuid: 2e27ec62a973426a9dfbf2ee6ec80df5
name: 'timedatectl: RTC in local TZ'
type: DEPENDENT
key: rabe.timedatectl.status.rtc_in_local_tz
delay: '0'
history: 7d
description: 'Is the RTC in local TZ?'
valuemap:
name: Status
preprocessing:
- type: REGEX
parameters:
- 'LocalRTC=(.*)'
- \1
- type: JAVASCRIPT
parameters:
- 'return {"yes": 1, "no": 0}[value]'
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 5m
master_item:
key: 'system.run[/usr/bin/timedatectl show]'
tags:
- tag: component
value: timedatectl
triggers:
- uuid: fd6e89cd7a284eb09fb98f15ed011a04
expression: last(/timedatectl/rabe.timedatectl.status.rtc_in_local_tz)<>0
name: 'timedatectl: RTC not in local TZ'
priority: INFO
description: 'The RTC not in local TZ, check `timedatectl status` for more info.'
tags:
- tag: scope
value: notice
- uuid: c5e288f97d6d4a52959358a890409fd4
name: 'timedatectl: System clock synchronized'
type: DEPENDENT
key: rabe.timedatectl.status.system_clock_synchronized
delay: '0'
history: 7d
description: 'Is the system clock synchronized?'
valuemap:
name: Status
preprocessing:
- type: REGEX
parameters:
- 'NTPSynchronized=(.*)'
- \1
- type: JAVASCRIPT
parameters:
- 'return {"yes": 1, "no": 0}[value]'
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 5m
master_item:
key: 'system.run[/usr/bin/timedatectl show]'
tags:
- tag: component
value: timedatectl
triggers:
- uuid: 8b917fa2bc904bfcba0467a968819020
expression: last(/timedatectl/rabe.timedatectl.status.system_clock_synchronized)<>1
name: 'timedatectl: NTP not synchronized'
priority: INFO
description: 'NTP is not in sync, check `timedatectl status` for more info.'
dependencies:
- name: 'timedatectl: NTP not synchronized for more than {$TIMEDATECTL_MAX_NO_SYNC_TIME}'
expression: 'last(/timedatectl/rabe.timedatectl.status.system_clock_synchronized,{$TIMEDATECTL_MAX_NO_SYNC_TIME})<1'
tags:
- tag: scope
value: availability
- tag: scope
value: notice
- uuid: 40264d8d024b4a7c8e7eceadf719f43b
expression: 'last(/timedatectl/rabe.timedatectl.status.system_clock_synchronized,{$TIMEDATECTL_MAX_NO_SYNC_TIME})<1'
name: 'timedatectl: NTP not synchronized for more than {$TIMEDATECTL_MAX_NO_SYNC_TIME}'
priority: WARNING
description: 'NTP is not in sync, check `timedatectl status` for more info.'
tags:
- tag: scope
value: availability
- uuid: f4af343dc2c14673b8439c197f909239
name: 'timedatectl: Time zone'
type: DEPENDENT
key: rabe.timedatectl.status.time_zone
delay: '0'
history: 7d
value_type: TEXT
trends: '0'
description: 'Time zone'
preprocessing:
- type: REGEX
parameters:
- 'Timezone=(.*)'
- \1
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1d
master_item:
key: 'system.run[/usr/bin/timedatectl show]'
tags:
- tag: component
value: timedatectl
- uuid: 913f9a76ee83464886433833455bd83f
name: 'timedatectl: Get status'
type: ZABBIX_ACTIVE
key: 'system.run[/usr/bin/timedatectl show]'
history: '0'
value_type: TEXT
trends: '0'
description: 'Get output from timedatectl status.'
tags:
- tag: component
value: raw
tags:
- tag: class
value: software
- tag: target
value: timedatectl
macros:
- macro: '{$TIMEDATECTL_MAX_NO_SYNC_TIME}'
value: 60m
description: 'How long can time be out if sync before we care?'
valuemaps:
- uuid: b2a114b092954391a1d6828f7b1f8bc0
name: 'Service status'
mappings:
- value: '1'
newvalue: active
- type: DEFAULT
newvalue: inactive
- uuid: 53732806df7e4a8aa9263ee9f928badc
name: Status
mappings:
- value: '1'
newvalue: 'yes'
- value: '0'
newvalue: 'no'