IBM Support

Must Gather documentation for SNTP / NTP on IBM i

Troubleshooting


Problem

This document provides information on how to troubleshoot SNTP / NTP on IBM i

Resolving The Problem

  • Function Description: Simple Network Time Protocol (SNTP) is a simplified version of Network Time Protocol (NTP) that is used to synchronize computer clocks on a network, and generally to keep system clocks synchronized with a reliable external time source.  From IBM i R730, it is also possible to configure the IBM i as an NTP client.

IBM i SNTP is based on Request for Comments (RFC) 2030.  You can view RFC 2030 by searching for the number with the RFC index search engine located on the RFC editor website.  Before working with SNTP, you must be familiar with the concepts of SNTP client and SNTP server.

SNTP client
When Simple Network Time Protocol (SNTP) is configured as a client, the IBM i operating system retrieves a time value from an external time source.

SNTP server
When you configure the IBM i operating system as an SNTP server, your system acts as a time server for other devices.  The attributes of SNTP on System i5 can be found through the CL command CHGNTPA F4 as shown below, or by using the IBM i Navigator:
 
                      Change SNTP Attributes (CHGNTPA)

Type choices, press Enter.

Remote system  . . . . . . . . .   'TIME.EXAMPLE.COM'
Client autostart . . . . . . . .   *YES          *SAME, *NO, *YES
Client poll interval . . . . . .   60            1-1440 minutes, *SAME
Client minimum adjustment  . . .   20            0-300000 milliseconds...
Client maximum adjustment  . . .   20            1-120 minutes, *SAME
Client adjustment threshold  . .   *MAXADJ       1-7200 seconds, *SAME, *MAXADJ
Client activity log  . . . . . .   *POLL         *SAME, *NONE, *CHANGE, *POLL
Server autostart . . . . . . . .   *NO           *SAME, *NO, *YES
Server activity log  . . . . . .   *ALL          *SAME, *NONE, *ALL, *ERROR
Synchronization required . . . .   *NO           *SAME, *NO, *YES

For IBM i R730 and above, if using NTP client, configuration for this is mainly done using the IBM i Navigator Web GUI.

Client requests are made using UDP port 123; therefore, this port must be open between the clients and server.

Related Jobs/Tasks

The command WRKJOB QTOTNTP can be issued to verify that the SNTP client job is active.  The command WRKJOB QTOTNTPD can be issued to verify that the NTP client job is active.

Materials Most Often Required for Analysis


The IBM System i products system has an SNTP client at releases from V5R2M0.  Logging for the client is enabled through the CHGNTPA CL command or through IBM i Navigator.  Logging can be set to *NONE, *CHANGE, or *POLL.  When logging is set to *CHANGE or *POLL, a new log file is created for each new day.  The created log files will grow in number until they are deleted from the system.  It is suggested that *CHANGE or *POLL be used only during initial testing or for problem determination.  After SNTP functionality has been verified, the logging level should be set to *NONE.  If the logging level is left at *CHANGE or *POLL, it is advisable to determine the number of log files that are existing and delete them as necessary.  There is no automated cleanup of log files.

From V5R3M0, it is also possible to have an SNTP server that can also produce a log.  Logging can be set to *NONE, *ERROR, or *ALL.  Logging for the server acts in the same manner as the client.  If logging is enabled, it must be managed to control the number of logs that exist on the system.

The client logs are located in directory /QIBM/USERDATA/OS400/TCPIP/NTP. The files are named QTOTxxxxxxxx (where x = the date).

The server logs are located in directory /QIBM/USERDATA/OS400/TCPIP/NTP/SERVER. The server log files are also named QTOTxxxxxxxx (where x = the date).

The directory path information can be found in the SNTP (QTOTNTP) or NTP (QTOTNTPD) job log.

To view the Client log file, on the operating system command-line type the following:
1. WRKLNK '/QIBM/USERDATA/OS400/TCPIP/NTP'

Press the Enter key.
2. Type 5 next to NTP, and press the Enter key.
3. Type 5 next to the client log that you would like view, and press the Enter key.

To view the Server log file, on the operating system command line type the following:
1. WRKLNK '/QIBM/USERDATA/OS400/TCPIP/NTP/SERVER'

Press the Enter key.
2. Type 5 next to Server, and press the Enter key.
3. Type 5 next to the server log that you would like view, and press the Enter key.

Other Materials that may be Required for Analysis
MustGather Information for a SNTP/NTP issue
 
Screenshots of the CHGNTPA screen and IBM i Navigator properties screen for the Client tab.
Change the client activity log value to *POLL via CHGNTPA or IBM i Navigator. (For an SNTP server issue, also change the Server Activity log value to *ALL)
ENDTCPSVR *NTP

TRCCNN SET(*ON) TRCTYPE(*IP) TRCTBL(TCPIP) SIZE(400 *MB)

-
If using the SNTP client, run:
TRCTCPAPP APP(*NTP) SET(*ON)

STRTRC SSNID(NTPTRACE) JOB((*ALL/QTCP/QTOTNTP *ALL)) MAXSTG(200000)
If using the NTP client, run:
CRTDTAARA DTAARA(QUSRSYS/QTOTDBG) TYPE(*CHAR) LEN(5)

CHGDTAARA DTAARA(QUSRSYS/QTOTDBG *ALL) VALUE('100')

TRCTCPAPP APP(*NTP) SET(*ON)

STRTRC SSNID(NTPTRACE) JOB((*ALL/QTCP/QTOTNTPD *ALL)) MAXSTG(200000)


-----------------------------------------------------------------------------
Then let the problem re-create.
=====> Start the NTP server... STRTCPSVR *NTP and wait for the error to occur

-
Once the issue has been re-created, end the traces.
End the communications trace:
TRCCNN SET(*OFF) TRCTBL(TCPIP) OUTPUT(*STMF) TOSTMF('/path/filename.pcap' *YES)
replacing '/path/filename.pcap' with your own path and filename, e.g. '/home/usera/ftp_failure.pcap'
End the TRCTCPAPP trace:
TRCTCPAPP APP(*NTP) SET(*OFF)
- this will create a spooled file called NTPLOG if using the SNTP or NTP client, and an IFS stream file '/QIBM/UserData/OS400/TCPIP/NTP/log' if using the NTP client. 
 
End the job trace:
SBMJOB CMD(ENDTRC SSNID(NTPTRACE) DTALIB(*CURLIB) PRTTRC(*YES))
-the resulting spooled file will be called QPSRVTRCJ ... (which can be found doing a WRKSBMJOB, find the job, and Work with spooled files)
Collect the QTIMADJ system value:
DSPSYSVAL SYSVAL(QTIMADJ) OUTPUT(*PRINT)
Collect the current job log for the active QTOTNTP (SNTP client) or QTOTNTPD (NTP client) jobs using the WRKJOB command to collect the job name, user and number, and then using the DSPJOBLOG JOB(nnnnnn/user/name) OUTPUT(*PRINT) to produce a spooled output of the job.
Delete the data area created earlier
DLTDTAARA DTAARA(QUSRSYS/QTOTDBG)
Send all the resulting output to IBM Support

Documentation and Further Reading
 
o www.ntp.org/
o V7R3 Knowledge Center topic on Network Time Protocol
o Time drift on Power 8 and Power 9 Servers

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Communications-TCP","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Historical Number

491090272

Document Information

Modified date:
19 August 2020

UID

nas8N1013598