Zabbix Template: timedatectl
Keeps track of the time and date subsystem by running timedatectl status.
Needs the following configuration:
See here for more information about timedatectl.
This template is part of RaBe's Zabbix template and helpers collection.
Items
Item: timedatectl: NTP service status
NTP service status
Settings:
Item Setting | Value |
---|---|
Type | DEPENDENT |
History | 7d |
Source item | system.run[/usr/bin/timedatectl show] |
Preprocessing steps:
Type | Parameters |
---|---|
REGEX | ["NTP=(.*)", "\\1"] |
JAVASCRIPT | ["return {\"yes\": 1, \"no\": 0}[value]"] |
DISCARD_UNCHANGED_HEARTBEAT | ["5m"] |
Item: timedatectl: RTC in local TZ
Is the RTC in local TZ?
Settings:
Item Setting | Value |
---|---|
Type | DEPENDENT |
History | 7d |
Source item | system.run[/usr/bin/timedatectl show] |
Preprocessing steps:
Type | Parameters |
---|---|
REGEX | ["LocalRTC=(.*)", "\\1"] |
JAVASCRIPT | ["return {\"yes\": 1, \"no\": 0}[value]"] |
DISCARD_UNCHANGED_HEARTBEAT | ["5m"] |
Item: timedatectl: System clock synchronized
Is the system clock synchronized?
Settings:
Item Setting | Value |
---|---|
Type | DEPENDENT |
History | 7d |
Source item | system.run[/usr/bin/timedatectl show] |
Preprocessing steps:
Type | Parameters |
---|---|
REGEX | ["NTPSynchronized=(.*)", "\\1"] |
JAVASCRIPT | ["return {\"yes\": 1, \"no\": 0}[value]"] |
DISCARD_UNCHANGED_HEARTBEAT | ["5m"] |
Item: timedatectl: Time zone
Time zone
Settings:
Item Setting | Value |
---|---|
Type | DEPENDENT |
Value type | TEXT |
History | 7d |
Source item | system.run[/usr/bin/timedatectl show] |
Preprocessing steps:
Type | Parameters |
---|---|
REGEX | ["Timezone=(.*)", "\\1"] |
DISCARD_UNCHANGED_HEARTBEAT | ["1d"] |
Item: timedatectl: Get status
Get output from timedatectl status.
Settings:
Item Setting | Value |
---|---|
Type | ZABBIX_ACTIVE |
Value type | TEXT |
Triggers
Trigger: timedatectl: NTP not active
The NTP service is not active, check timedatectl status
for more info.
Settings:
Trigger Setting | Values |
---|---|
Priority | WARNING |
Trigger: timedatectl: RTC not in local TZ
The RTC not in local TZ, check timedatectl status
for more info.
Settings:
Trigger Setting | Values |
---|---|
Priority | INFO |
Trigger: timedatectl: NTP not synchronized
NTP is not in sync, check timedatectl status
for more info.
Settings:
Trigger Setting | Values |
---|---|
Priority | INFO |
Trigger: timedatectl: NTP not synchronized for more than {$TIMEDATECTL_MAX_NO_SYNC_TIME}
NTP is not in sync, check timedatectl status
for more info.
Settings:
Trigger Setting | Values |
---|---|
Priority | WARNING |
last(/timedatectl/rabe.timedatectl.status.system_clock_synchronized,{$TIMEDATECTL_MAX_NO_SYNC_TIME})<1
Macros
The following Zabbix macros are configured via this template.
Macro: {$TIMEDATECTL_MAX_NO_SYNC_TIME}
How long can time be out if sync before we care?
Default:
License
This template is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.
Copyright
Copyright (c) 2017 - 2024 Radio Bern RaBe