TimeKeeper client with SNMP and syslog alerting based on accuracy

Below is an example of clients with 2 sources:

  1. PTP to a local GM on domain 0
  2. NTP to a nearby NTP server

Source 0 should always be accurate to 1 microsecond, and source 1 should always be accurate to 5 microseconds. Anything beyond those values should trigger an immediate alert so action can be taken.

SNMP alerts and syslog messages are one way to send these alerts. Syslog (and Event Log on Windows) messages are automatically triggered without any configuration, and the normal syslog configuration on the host will transmit TimeKeeper data to the remote syslog server. For SNMP, the list of SNMP trap hosts are defined in the TimeKeeper configuration.

For the above configuration where a remote syslog server should get messages along with 2 SNMP hosts, the network layout might look like:

and the TimeKeeper client’s timekeeper.conf file reflecting this would have:

# Get PTP locally from Grandmaster A, alert when accuracy is worse than 1us
SOURCE0() { PTPCLIENTVERSION=2; PTPDOMAIN=0; SYNCERRORTHRESHOLD=0.000001; }
# Get NTP locally from Grandmaster B, alert when accuracy is worse than 5us
SOURCE1() { NTPSERVER=grandmaster_b_hostname; SYNCERRORTHRESHOLD=0.000005; }
SNMPTRAPHOST=snmp_management_host_1,snmp_management_host_2;

Any local syslog configuration will automatically send data to the remote syslog server and the SNMPTRAPHOST option will cause TimeKeeper to send accuracy alerts to both snmp_management_host_1 and snmp_management_host_2 if the accuracy exceeds those thresholds.

SNMPv3 messages (encrypted SNMP) can also be used with the SNMPTRAPPASSPHRASE and SNMPTRAPEID options, detailed in the “SNMP” section.