ntpd_status

1.0.0 • Public • Published

ntpd-status build status

Ask the local ntpd for status data, using ntpdc.

Example

var ntpd = require('./lib/ntpd_status');
 
/*
 * Get the results of 'ntpdc -c loopinfo'.
 *
 * Prints something along the lines of:
 *
 * offset: 0.00261 s
 * frequency: -19.605 ppm
 * poll_adjust: 9 
 * watchdog_timer: 1309 s
*/
 
ntpd.ntpdc('loopinfo', function (err, result) {
    if (err)
        throw err;
 
    for (var key in result) {
        /*
         * 'key' is the underscored variable name as reported by ntpdc
         * 'value' is the value, as a number
         * 'unit' is the unit as string, or the empty string
         */
        console.log(key + '' + result[key].value + ' ' + result[key].unit);
    }
});

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ntpd_status

Weekly Downloads

1

Version

1.0.0

License

none

Last publish

Collaborators

  • calmh