From b24d0c3a475b88d9ccf1a8fe29715ee60972fcad Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 10 Mar 2020 18:00:26 -0700 Subject: [PATCH] ntpq docs --- README.md | 33 +++++++++++++++++++++++++++++++++ jc/parsers/ntpq.py | 3 +-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4c6d4118..79c55443 100755 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio - `--lsof` enables the `lsof` command parser - `--mount` enables the `mount` command parser - `--netstat` enables the `netstat` command parser +- `--ntpq` enables the `ntpq -p` command parser - `--passwd` enables the `/etc/passwd` file parser - `--pip-list` enables the `pip list` command parser - `--pip-show` enables the `pip show` command parser @@ -1484,6 +1485,38 @@ $ sudo netstat -apee | jc --netstat -p # or: sudo jc -p netstat -apee ... ] ``` +### ntpq +``` +$ ntpq -p | jc --ntpq -p # or: jc -p ntpq -p +[ + { + "selection_state": null, + "remote": "44.190.6.254", + "refid": "127.67.113.92", + "st": 2, + "t": "u", + "when": 1, + "poll": 64, + "reach": 1, + "delay": 23.399, + "offset": -2.805, + "jitter": 2.131 + }, + { + "selection_state": null, + "remote": "mirror1.sjc02.s", + "refid": "216.218.254.202", + "st": 2, + "t": "u", + "when": 2, + "poll": 64, + "reach": 1, + "delay": 29.325, + "offset": 1.044, + "jitter": 4.069 + } +] +``` ### /etc/passwd file ``` $ cat /etc/passwd | jc --passwd -p diff --git a/jc/parsers/ntpq.py b/jc/parsers/ntpq.py index 466dbcd9..64322c30 100644 --- a/jc/parsers/ntpq.py +++ b/jc/parsers/ntpq.py @@ -184,10 +184,9 @@ import jc.parsers.universal class info(): version = '1.0' - description = 'ntpq command parser' + description = 'ntpq -p command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' - # details = 'enter any other details here' # compatible options: linux, darwin, cygwin, win32, aix, freebsd compatible = ['linux']