TrueNAS SCALETrueNAS SCALE Nightly Development Documentation
This content follows experimental early release software. Use the Product and Version selectors above to view content specific to a stable software release.

NTP_Server

The SCALE CLI guide is a work in progress! New namespace and command documentation is continually added and maintained, so check back here often to see what is new!

Ntp_Server Namespace

The ntp_server namespace has five commands and is based on NTP server management functions found in the SCALE API and web UI. It provides access to system ntp server methods through the ntp_server commands.

Ntp_Server Commands

The following ntp-server commands allow you to run jobs related to adding and managing NTP servers.

You can enter commands from the main CLI prompt or from the ntp_server namespace prompt.

Interactive Argument Editor (TUI)

Enter the -- flag following any CLI command to open the interactive arguments editor text-based user interface (TUI).

Click for more information

The interactive argument editor is a text user interface (TUI) that can help enter complex commands with multiple configurable properties. It shows expected properties, defaults, input types (string, boolean, integer, or array), and can include command instructions or warnings.

Optional properties, indicated by the # symbol, are disabled by default. Required properties are enabled. Do not disable properties that are enabled by default.

To configure required properties, enter a space after the colon then add the value.

To enable optional properties, delete # from the corresponding line.

Some required properties are disabled if they are part of a pair of properties where one or the other is required. Select one property to enable and enter a value.

Press F2 or click Save to save the modified file.

Press F10, Esc, or click Quit to exit the TUI. The command automatically executes upon exit.

Create Command

Use the create command to add an NTP time server to the system and configure server properties.

Using the Create Command

Description

The create command has one required property, address, and six optional properties (see Create Properties below for details.) Enter property arguments using the = delimiter to separate property and value. Double-quote values with special characters. Enter the command string then press Enter. The command returns an empty line when successful. If unable to reach the server, use force=true to continue.

Create Properties
PropertyRequiredDescriptionSyntax Example
addressYesEnter the hostname or IP address of the NTP server.address="ntpServerHostname"
burstNoEnter true to enable and make sure that the server is reachable and send a burst of eight packets instead of one. This is designed to improve timekeeping quality with the server command. Recommended when maxpoll is greater than 10. Only use on personal NTP servers or those under direct control. Do not enable when using public NTP servers.burst=true or burst=false
iburstNoEnter true to speed up the initial synchronization to take seconds rather than minutes.iburst=true or iburst=false
preferNoEnter true to mark the specified server as preferred. When all other things are equal, this host is chosen for synchronization acquisition with the server command. We recommend using this for servers with time monitoring hardware. Should only be used for highly accurate NTP servers, such as those with time monitoring hardware.prefer=true or prefer=false
minpollNoEnter a numeric value to specify minimum polling time in seconds. Value must be a power of 2 and less than the maxpoll value. For example, 6 means 2^6, or 64 seconds. The default is 6, minimum value is 4.minpoll=6
maxpollNoEnter a numeric value to specify the maximum polling time in seconds. It must be a power of 2 and greater than the minpoll value. For example, 10 means 2^10, or 1024 seconds. The default is 10, maximum value is 17.maxpoll=10
forceNoEnter true to force the addition of the NTP server, even if it is currently unreachable.force=true

Usage

From the CLI prompt, enter:

system ntp_server create address="0.uk.pool.ntp.org"

Where 0.uk.pool.ntp.org is the hostname for an NTP time server.

Command Example
system ntp_server create address="0.uk.pool.ntp.org" force=true

Delete Command

The delete command removes the NTP server matching the system-assigned id.

Use the system ntp_server query command to get the ID numbers for all NTP servers configured on the system.

Using the Delete Command

Description

The delete command has one required property, id. id is the system-assigned number for the NTP server. Enter the command string then press Enter. The command returns an empty line when successful.

Use the system ntp_server query command to verify the server is deleted.

Usage

From the CLI prompt, enter:

system ntp_server delete id=4

Where 4 is the system-assigned ID number for an NTP server.

Command Example
system ntp_server delete id=4

Get_Instance Command

The get_instance command returns the system-assigned ID number, address, and settings for the id entered.

Use the system ntp_server query command to obtain the NTP server ID numbers.

Using the Get_Instance Command

Description

The get_instance command has one required property, id. id is the system-assigned number for the NTP server. Enter the command string then press Enter. The command returns the system-assigned ID number, server address, and the burst, iburst, prefer, min and max poll settings.

Usage

From the CLI prompt, enter:

system ntp_server get_instance id=1

Where 1 is the system-assigned ID number for an NTP server.

Command Example
system ntp_server get_instance id=1
+---------+-----------------------+
|      id | 1                     |
| address | 0.debian.pool.ntp.org |
|   burst | false                 |
|  iburst | true                  |
|  prefer | false                 |
| minpoll | 6                     |
| maxpoll | 10                    |
+---------+-----------------------+

Query Command

The query command lists the system-assigned ID number, address, and settings for all NTP servers configured on the system.

Using the Query Command

Description

The query command does not require entering a property argument, but you can specify one property to list only that information. Enter the command then press Enter. The command returns a table with the system-assigned ID number(s), server address(es), and the burst, iburst, prefer, min and max poll settings.

Usage

From the CLI prompt, enter:

system ntp_server query

Command Example
system ntp_server query
+----+-----------------------+-------+--------+--------+---------+---------+
| id | address               | burst | iburst | prefer | minpoll | maxpoll |
+----+-----------------------+-------+--------+--------+---------+---------+
| 1  | 0.debian.pool.ntp.org | false | true   | false  | 6       | 10      |
| 2  | 1.debian.pool.ntp.org | false | true   | false  | 6       | 10      |
| 3  | 2.debian.pool.ntp.org | false | true   | false  | 6       | 10      |
| 4  | 0.uk.pool.ntp.org     | false | true   | false  | 6       | 10      |
+----+-----------------------+-------+--------+--------+---------+---------+

Update Command

Use the update command to change the settings for an existing NTP server.

Use the system ntp_server query command to get the server ID.

Using the Update Command

Description

The Update command has one required property, id, and seven optional properties (see Update Properties below for details.) id is the system-assigned number for an NTP server. Use the system ntp_server query command to get NTP server system IDs.

Enter property arguments using the = delimiter to separate property and value. Double-quote values with special characters. Enter the command string then press Enter. The command returns an empty line when successful. If unable to reach the server, use force=true to continue.

Update Properties
PropertyRequiredDescriptionSyntax Example
addressNoEnter the hostname or IP address of the NTP server.address="ntpServerHostname"
burstNoEnter true to enable and make sure that the server is reachable and send a burst of eight packets instead of one. This is designed to improve timekeeping quality with the server command. Recommended when maxpoll is greater than 10. Only use on personal NTP servers or those under direct control. Do not enable when using public NTP servers.burst=true or burst=false
iburstNoEnter true to speed up the initial synchronization to take seconds rather than minutes.iburst=true or iburst=false
preferNoEnter true to mark the specified server as preferred. When all other things are equal, this host is chosen for synchronization acquisition with the server command. We recommend using this only for highly accurate NTP servers, such as those with time monitoring hardware.prefer=true or prefer=false
minpoll*YesRequired when setting maxpoll. Enter a numeric value to specify minimum polling time in seconds. Value must be a power of 2 and less than the maxpoll value. For example, 6 means 2^6, or 64 seconds. The default is 6, minimum value is 4.minpoll=6
maxpoll*YesRequired when setting minpoll. Enter a numeric value to specify the maximum polling time in seconds. It must be a power of 2 and greater than the minpoll value. For example, 10 means 2^10, or 1024 seconds. The default is 10, maximum value is 17.maxpoll=10
forceNoEnter true to force the addition of the NTP server, even if it is currently unreachable.force=true

Usage

From the CLI prompt, enter:

system ntp_server update id=1 prefer=true

Where:

  • 1 is the system-assigned ID for the NTP server.
  • true makes this the preferred server.

Command Example
system ntp_server update id=4 prefer=true