{"id":2093,"date":"2015-04-29T18:02:01","date_gmt":"2015-04-29T17:02:01","guid":{"rendered":"https:\/\/ridgesolutions.ie\/?p=2093"},"modified":"2019-11-12T16:07:41","modified_gmt":"2019-11-12T15:07:41","slug":"python-script-to-query-ntp-status-and-return-it-as-json","status":"publish","type":"post","link":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/","title":{"rendered":"Python script to query NTP status and return it as JSON"},"content":{"rendered":"<p>Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art.  A  common way to query NTP status is to run:<\/p>\n<pre>\r\nntpq -p\r\n<\/pre>\n<p>This returns some NTP status information.  It&#8217;s output can be a bit difficult to work with from your software, so I have included a small python 3 script which runs runs &#8220;ntpq -p&#8221; parses, and prints the output in Json format.  So instead of shelling out to ntpq you can shell out to this script and deal with the resulting json string instead&#8230;  This can be handy if you don&#8217;t have access to a Python NTP library.<\/p>\n<pre>\r\n\r\n#!\/usr\/bin\/python\r\n\r\n#   Copyright 2018 Kevin Godden\r\n#\r\n#   Licensed under the Apache License, Version 2.0 (the \"License\");\r\n#   you may not use this file except in compliance with the License.\r\n#   You may obtain a copy of the License at\r\n#\r\n#       http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n#\r\n#   Unless required by applicable law or agreed to in writing, software\r\n#   distributed under the License is distributed on an \"AS IS\" BASIS,\r\n#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n#   See the License for the specific language governing permissions and\r\n#   limitations under the License.\r\n\r\nimport subprocess\r\nimport json\r\nimport re\r\nimport sys\r\n\r\n# Shell out to 'ntpq -p'\r\nproc = subprocess.Popen(['ntpq', '-p'], stdout=subprocess.PIPE)\r\n\r\n# Get the output\r\nstdout_value = proc.communicate()[0].decode(\"utf-8\")\r\n\r\n#remove the header lines\r\nstart = stdout_value.find(\"===\\n\")\r\n\r\nif start == -1:\r\n    # We may be running on windows (\\r\\n), try \\r...\r\n    start = stdout_value.find(\"===\\r\")\r\n\r\n    if start == -1:\r\n        # No, go, exit with error\r\n        result = {'query_result': 'failed', 'data': {}}\r\n        print(json.dumps(result))\r\n        sys.exit(1)\r\n\r\n# Get the data part of the string\r\n#pay_dirt = stdout_value[start+4:]\r\npay_dirt = stdout_value[start:]\r\n\r\n# search for NTP line starting with * (primary server)\r\nexp = (\"\\*((?P<remote>\\S+)\\s+)\"\r\n       \"((?P<refid>\\S+)\\s+)\"\r\n       \"((?P<st>\\S+)\\s+)\"\r\n       \"((?P<t>\\S+)\\s+)\"\r\n       \"((?P<when>\\S+)\\s+)\"\r\n       \"((?P<poll>\\S+)\\s+)\"\r\n       \"((?P<reach>\\S+)\\s+)\"\r\n       \"((?P<delay>\\S+)\\s+)\"\r\n       \"((?P<offset>\\S+)\\s+)\"\r\n       \"((?P<jitter>\\S+)\\s+)\")\r\n\r\nregex = re.compile(exp, re.MULTILINE)\r\nr = regex.search(pay_dirt)\r\n\r\n# Did we get anything?\r\nif not r:\r\n    # No, try again without the * at the beginning, get\r\n    # the first entry instead\r\n    exp = (\" ((?P<remote>\\S+)\\s+)\"\r\n           \"((?P<refid>\\S+)\\s+)\"\r\n           \"((?P<st>\\S+)\\s+)\"\r\n           \"((?P<t>\\S+)\\s+)\"\r\n           \"((?P<when>\\S+)\\s+)\"\r\n           \"((?P<poll>\\S+)\\s+)\"\r\n           \"((?P<reach>\\S+)\\s+)\"\r\n           \"((?P<delay>\\S+)\\s+)\"\r\n           \"((?P<offset>\\S+)\\s+)\"\r\n           \"((?P<jitter>\\S+)\\s+)\")\r\n\r\n    regex = re.compile(exp, re.MULTILINE)\r\n    r = regex.search(pay_dirt)\r\n\r\ndata = {}\r\n\r\nif r:\r\n    data = r.groupdict()\r\n\r\n# Output Result\r\nresult = {'query_result': 'ok' if r else 'failed', 'data': data}\r\n\r\nprint(json.dumps(result))\r\n\r\n<\/pre>\n<p>GitHub repo is <a href=\"https:\/\/github.com\/kgodden\/query_ntp_status\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art. A common way to query NTP status is to run: ntpq -p This returns some NTP status information. It&#8217;s output can be a bit difficult to work with from your software, so I have [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[358,149],"class_list":["post-2093","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ntp","tag-python"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art. A common way to query NTP status is to run: ntpq -p This returns some NTP status information. It&#039;s output can be a bit difficult to work with from your software, so I have\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Kevin Godden\"\/>\n\t<meta name=\"google-site-verification\" content=\"Kyj52YLp6GOPA44PVBffo9fjW8rgWHYYRF0ZYjfy6ss\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Systems and Embedded Software Engineering, Ireland. | Some thoughts of a busy Computer Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Python script to query NTP status and return it as JSON\" \/>\n\t\t<meta property=\"og:description\" content=\"Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art. A common way to query NTP status is to run: ntpq -p This returns some NTP status information. It&#039;s output can be a bit difficult to work with from your software, so I have\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2015-04-29T17:02:01+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-11-12T15:07:41+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Python script to query NTP status and return it as JSON\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art. A common way to query NTP status is to run: ntpq -p This returns some NTP status information. It&#039;s output can be a bit difficult to work with from your software, so I have\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#article\",\"name\":\"Python script to query NTP status and return it as JSON\",\"headline\":\"Python script to query NTP status and return it as JSON\",\"author\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/wp-content\\\/uploads\\\/2013\\\/09\\\/ridge_logo1.jpg\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#articleImage\",\"width\":400,\"height\":81},\"datePublished\":\"2015-04-29T18:02:01+00:00\",\"dateModified\":\"2019-11-12T16:07:41+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#webpage\"},\"articleSection\":\"Uncategorized, ntp, python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.ridgesolutions.ie\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/uncategorized\\\/#listItem\",\"position\":2,\"name\":\"Uncategorized\",\"item\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/uncategorized\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#listItem\",\"name\":\"Python script to query NTP status and return it as JSON\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#listItem\",\"position\":3,\"name\":\"Python script to query NTP status and return it as JSON\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#organization\",\"name\":\"Ridge Solutions, Software Development and Software Engineering, Ireland.\",\"description\":\"Some thoughts of a busy Computer Engineer\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/wp-content\\\/uploads\\\/2013\\\/09\\\/ridge_logo1.jpg\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#organizationLogo\",\"width\":400,\"height\":81},\"image\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#organizationLogo\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/\",\"name\":\"Kevin Godden\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2833f41e59a25cf2a9741a05ec383bfdd278762a5e0798a90940e7ab0a107a2?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kevin Godden\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#webpage\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/\",\"name\":\"Python script to query NTP status and return it as JSON\",\"description\":\"Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art. A common way to query NTP status is to run: ntpq -p This returns some NTP status information. It's output can be a bit difficult to work with from your software, so I have\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/2015\\\/04\\\/29\\\/python-script-to-query-ntp-status-and-return-it-as-json\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/index.php\\\/author\\\/kgodden\\\/#author\"},\"datePublished\":\"2015-04-29T18:02:01+00:00\",\"dateModified\":\"2019-11-12T16:07:41+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#website\",\"url\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/\",\"name\":\"Ridge Solutions, Software Development and Software Engineering, Ireland.\",\"description\":\"Some thoughts of a busy Computer Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.ridgesolutions.ie\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Python script to query NTP status and return it as JSON","description":"Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art. A common way to query NTP status is to run: ntpq -p This returns some NTP status information. It's output can be a bit difficult to work with from your software, so I have","canonical_url":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"Kyj52YLp6GOPA44PVBffo9fjW8rgWHYYRF0ZYjfy6ss","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#article","name":"Python script to query NTP status and return it as JSON","headline":"Python script to query NTP status and return it as JSON","author":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author"},"publisher":{"@id":"https:\/\/www.ridgesolutions.ie\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.ridgesolutions.ie\/wp-content\/uploads\/2013\/09\/ridge_logo1.jpg","@id":"https:\/\/www.ridgesolutions.ie\/#articleImage","width":400,"height":81},"datePublished":"2015-04-29T18:02:01+00:00","dateModified":"2019-11-12T16:07:41+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#webpage"},"isPartOf":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#webpage"},"articleSection":"Uncategorized, ntp, python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie#listItem","position":1,"name":"Home","item":"https:\/\/www.ridgesolutions.ie","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/#listItem","name":"Uncategorized"}},{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/#listItem","position":2,"name":"Uncategorized","item":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#listItem","name":"Python script to query NTP status and return it as JSON"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#listItem","position":3,"name":"Python script to query NTP status and return it as JSON","previousItem":{"@type":"ListItem","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/#listItem","name":"Uncategorized"}}]},{"@type":"Organization","@id":"https:\/\/www.ridgesolutions.ie\/#organization","name":"Ridge Solutions, Software Development and Software Engineering, Ireland.","description":"Some thoughts of a busy Computer Engineer","url":"https:\/\/www.ridgesolutions.ie\/","logo":{"@type":"ImageObject","url":"https:\/\/www.ridgesolutions.ie\/wp-content\/uploads\/2013\/09\/ridge_logo1.jpg","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#organizationLogo","width":400,"height":81},"image":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#organizationLogo"}},{"@type":"Person","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author","url":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/","name":"Kevin Godden","image":{"@type":"ImageObject","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2833f41e59a25cf2a9741a05ec383bfdd278762a5e0798a90940e7ab0a107a2?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kevin Godden"}},{"@type":"WebPage","@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#webpage","url":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/","name":"Python script to query NTP status and return it as JSON","description":"Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art. A common way to query NTP status is to run: ntpq -p This returns some NTP status information. It's output can be a bit difficult to work with from your software, so I have","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.ridgesolutions.ie\/#website"},"breadcrumb":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/#breadcrumblist"},"author":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author"},"creator":{"@id":"https:\/\/www.ridgesolutions.ie\/index.php\/author\/kgodden\/#author"},"datePublished":"2015-04-29T18:02:01+00:00","dateModified":"2019-11-12T16:07:41+00:00"},{"@type":"WebSite","@id":"https:\/\/www.ridgesolutions.ie\/#website","url":"https:\/\/www.ridgesolutions.ie\/","name":"Ridge Solutions, Software Development and Software Engineering, Ireland.","description":"Some thoughts of a busy Computer Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.ridgesolutions.ie\/#organization"}}]},"og:locale":"en_US","og:site_name":"Systems and Embedded Software Engineering, Ireland. | Some thoughts of a busy Computer Engineer","og:type":"article","og:title":"Python script to query NTP status and return it as JSON","og:description":"Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art. A common way to query NTP status is to run: ntpq -p This returns some NTP status information. It's output can be a bit difficult to work with from your software, so I have","og:url":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/","article:published_time":"2015-04-29T17:02:01+00:00","article:modified_time":"2019-11-12T15:07:41+00:00","twitter:card":"summary","twitter:title":"Python script to query NTP status and return it as JSON","twitter:description":"Setting up and automatically keeping an eagle eye on NTP from software can be a bit of a (difficult) black art. A common way to query NTP status is to run: ntpq -p This returns some NTP status information. It's output can be a bit difficult to work with from your software, so I have"},"aioseo_meta_data":{"post_id":"2093","title":null,"description":null,"keywords":[{"label":"python","value":"python"},{"label":"NTP","value":"NTP"},{"label":"software","value":"software"},{"label":"code","value":"code"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-09-13 21:31:47","updated":"2025-07-15 22:59:20","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ridgesolutions.ie\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/\" title=\"Uncategorized\">Uncategorized<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tPython script to query NTP status and return it as JSON\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.ridgesolutions.ie"},{"label":"Uncategorized","link":"https:\/\/www.ridgesolutions.ie\/index.php\/category\/uncategorized\/"},{"label":"Python script to query NTP status and return it as JSON","link":"https:\/\/www.ridgesolutions.ie\/index.php\/2015\/04\/29\/python-script-to-query-ntp-status-and-return-it-as-json\/"}],"_links":{"self":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/posts\/2093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/comments?post=2093"}],"version-history":[{"count":0,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/posts\/2093\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/media?parent=2093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/categories?post=2093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ridgesolutions.ie\/index.php\/wp-json\/wp\/v2\/tags?post=2093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}