Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgear committed Sep 25, 2023
1 parent e5c8d4c commit 6ad3b87
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 39 deletions.
22 changes: 0 additions & 22 deletions ChangeLog

This file was deleted.

44 changes: 27 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Copyright (c) 2015-2023 Paul D. Gear <https://libertysys.com.au/>

Juju layer copyright (c) 2017-2018 Canonical Ltd <https://charmhub.io/ntp>

## License

GPLv3 - see COPYING.txt for details
Expand All @@ -12,8 +14,8 @@ GPLv3 - see COPYING.txt for details
NTPmon is a program which is designed to report on essential health metrics for
NTP. It provides a Nagios check which can be used with many alerting systems,
including support for Nagios performance data. NTPmon can also run as a daemon
for sending metrics to collectd or telegraf. It supports both `ntpd` and
`chronyd`.
for sending metrics to collectd, prometheus, or telegraf. It supports both
`ntpd` and `chronyd`.


## Prerequisites
Expand All @@ -22,12 +24,15 @@ NTPmon is written in python, and requires python 3.3 or later. It uses modules
from the standard python library, and also requires the `psutil` library, which
is available from pypi or your operating system repositories. NTPmon also
requires `ntpq` and `ntptrace` from the NTP distribution (or `chronyc` if you're
using chrony instead).
using chrony).

On Ubuntu (and probably other Debian-based Linux distributions), you can install
all the prerequisites by running:

sudo apt-get install ntp python3-psutil
sudo apt-get install ntp python3-prometheus-client python3-psutil

(The python3-prometheus-client package is only needed if you intend to run in
prometheus exporter mode - see below.)

## Usage

Expand All @@ -38,7 +43,6 @@ To start running NTPmon, run:
cd ntpmon
./src/ntpmon.py --help


## Metrics

NTPmon alerts on the following metrics of the local NTP server:
Expand All @@ -62,19 +66,18 @@ than 75% total reachability of all configured peers.

#### offset

Is the clock offset from its sync peer (or other peers, if the sync peer
is not available) acceptable? Return CRITICAL for 50 milliseconds or more
average difference, WARNING for 10 ms or more average difference, and OK
for anything less.
Is the clock offset from its sync peer (or other peers, if the sync peer is not
available) acceptable? Return CRITICAL for 50 milliseconds or more average
difference, WARNING for 10 ms or more average difference, and OK for anything
less.

#### traceloop

Is there a sync loop between the local server and the stratum 1 servers?
If so, return CRITICAL. Most public NTP servers do not support tracing,
so for anything other than a loop (including a timeout), return OK.
Traceloop is disabled by default and may be deprecated in a future
release, since it produces additional NTP traffic which is not useful in
most cases.
Is there a sync loop between the local server and the stratum 1 servers? If so,
return CRITICAL; for anything other than a loop (including a timeout), return
OK. Most public NTP servers do not support tracing, so using this produces
additional NTP traffic which is not useful in most cases. Trace loop detection
is deprecated, disabled by default, and is not supported for prometheus.

### System metrics

Expand All @@ -91,6 +94,15 @@ server (using `ntpq -nc readvar`):
See the [NTP documentation](http://doc.ntp.org/current-stable/ntpq.html#system)
for the meaning of these metrics.

### Prometheus exporter

When run in prometheus mode, NTPmon uses the [prometheus python
client](https://pypi.python.org/pypi/prometheus_client) to expose metrics via
the HTTP server built into that library. No security testing or validation has
been performed on this library by the NTPmon author; users are suggested not to
expose it on untrusted networks, and are reminded that - as stated in the GNU
General Public License terms - this software comes with no warranty.

## Changes from previous version

NTPmon has been rewritten from version 1.0.0 of check_ntpmon. Changes from
Expand All @@ -112,15 +124,13 @@ the original check_ntpmon are:
- Removed support for changing thresholds; if the one person on the Internet
who actually uses this really wants it, I might add it back. :-)


## Startup delay

By default, until ntpd has been running for 512 seconds (the minimum time for
8 polls at 64-second intervals), check_ntpmon will return OK (zero return code).
This is to prevent false positives on startup or for short-lived VMs. To
ignore this safety precaution, use --run-time with a low number (e.g. 1 sec).


## To do

- Better/more documentation.
Expand Down

0 comments on commit 6ad3b87

Please sign in to comment.