Skip to content
jc-rs
GitHub

ntpq

--ntpqv1.7.0

Converts `ntpq -p` command output to JSON

LinuxFreeBSDcommand
$ ntpq | jc-rs --ntpq

A real pair

From the reference corpus (centos-7.7/ntpq-pn.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. CI compares jc-rs with it field by field under the published differential. Hover a value to see where it came from.

ntpqcentos-7.7
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+44.190.6.254    127.67.113.92    2 u   66   64  377   22.690   -0.392   2.085
-108.59.2.24     130.133.1.10     2 u   63   64  377   90.805    2.840   1.908
+38.229.71.1     204.9.54.119     2 u   64   64  377   68.699   -0.610   2.576
*72.5.72.15      216.218.254.202  2 u   63   64  377   22.654    0.231   1.964
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
[
  {
    "state": "+",
    "remote": "44.190.6.254",
    "refid": "127.67.113.92",
    "st": 2,
    "t": "u",
    "when": 66,
    "poll": 64,
    "reach": 377,
    "delay": 22.69,
    "offset": -0.392,
    "jitter": 2.085
  },
  {
    "state": "-",
    "remote": "108.59.2.24",
    "refid": "130.133.1.10",
    "st": 2,
    "t": "u",
    "when": 63,
    "poll": 64,
    "reach": 377,
    "delay": 90.805,
    "offset": 2.84,
    "jitter": 1.908
  },
  {
    "state": "+",
    "remote": "38.229.71.1",
    "refid": "204.9.54.119",
    "st": 2,
    "t": "u",
    "when": 64,
    "poll": 64,
    "reach": 377,
    "delay": 68.699,
    "offset": -0.61,
    "jitter": 2.576
  },
  {
    "state": "*",
    "remote": "72.5.72.15",
    "refid": "216.218.254.202",
    "st": 2,
    "t": "u",
    "when": 63,
    "poll": 64,
    "reach": 377,
    "delay": 22.654,
    "offset": 0.231,
    "jitter": 1.964
  }
]

Fixture coverage

6/6oracle-valid pairs match under the published structural JSON comparison

Magic syntax

jc-rs ntpqjc-rs runs the command itself and parses what it prints. Recognised for: `ntpq`

Source: crates/jc-rs-parsers/src/misc/ntpq.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare