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 for more information about timedatectl.
This template is part of RaBe's Zabbix template and helpers collection.
NTP service status
rabe.timedatectl.status.ntp_service
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"] |
Is the RTC in local TZ?
rabe.timedatectl.status.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"] |
Is the system clock synchronized?
rabe.timedatectl.status.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"] |
Time zone
rabe.timedatectl.status.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"] |
Get output from timedatectl status.
system.run[/usr/bin/timedatectl show]
Settings:
Item Setting | Value |
---|---|
Type | ZABBIX_ACTIVE |
Value type | TEXT |
The NTP service is not active, check timedatectl status
for more info.
Settings:
Trigger Setting | Values |
---|---|
Priority | WARNING |
last(/timedatectl/rabe.timedatectl.status.ntp_service)<>1
The RTC not in local TZ, check timedatectl status
for more info.
Settings:
Trigger Setting | Values |
---|---|
Priority | INFO |
last(/timedatectl/rabe.timedatectl.status.rtc_in_local_tz)<>0
NTP is not in sync, check timedatectl status
for more info.
Settings:
Trigger Setting | Values |
---|---|
Priority | INFO |
last(/timedatectl/rabe.timedatectl.status.system_clock_synchronized)<>1
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
The following Zabbix macros are configured via this template.
How long can time be out if sync before we care?
Default:
60m
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 (c) 2017 - 2024 Radio Bern RaBe