Skip to content

Commit

Permalink
Prepare v2.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgear committed Dec 22, 2023
1 parent 1558bfa commit 5fb43e9
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 45 deletions.
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,33 @@ Notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [2.1.0] - 2023-12-22

### Changed

- Readme updated to reflect PPA installation.
- Changed Debian dependency on python3-prometheus-client to a recommendation,
because it is only required when using the prometheus exporter.

### Removed

- Metrics with no values are no longer displayed via the Nagios check, because
[they break icinga2's
GraphiteWriter](https://github.com/paulgear/ntpmon/pull/26). Whilst this is
technically a breaking change, it only affects the deprecated trace-related
metrics, which are disabled by default, so I'm declaring this a minor release.
Removal of the trace-related metrics will be completed in a future release of
the 2.x series.
- Removed warning about lack of IPv6 support in python3-prometheus-client, since
a fixed version is shipped in the PPA.

## [2.0.2] - 2023-10-05

### Added

- Proper changelog entries like this one.

### Fixed
### Changed

- The Ubuntu PPA includes a backported python3-prometheus-client package which
fixes the lack of IPv6 support in the prometheus client.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PREFIX=/usr/local
SHAREDIR=share/$(NAME)
SYSTEMD_SERVICE_DIR=/lib/systemd/system
USER=$(NAME)
VERSION=2.0.2+repack1
VERSION=2.1.0

test: pytest datatest

Expand Down
71 changes: 36 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Juju layer copyright (c) 2017-2018 Canonical Ltd <https://charmhub.io/ntp>

GPLv3 - see COPYING.txt for details


## Introduction

NTPmon is a program which is designed to report on essential health metrics for
Expand All @@ -17,26 +16,41 @@ including support for Nagios performance data. NTPmon can also run as a daemon
for sending metrics to collectd, prometheus, or telegraf. It supports both
`ntpd` and `chronyd`.

## Installation

On Ubuntu (and possibly other Debian derivatives) NTPmon and its prerequisites
can be installed from [its
PPA](https://launchpad.net/~paulgear/+archive/ubuntu/ntpmon/) using:

sudo add-apt-repository ppa:paulgear/ntpmon
sudo apt install chrony ntpmon

`chrony` is the preferred NTP server on Ubuntu; you can also use `ntp` or
`ntpsec` from the universe pool, although the are not guaranteed to receive
security updates unless you use Ubuntu Pro.

If you wish to use something other than the prometheus exporter by default, you
must edit `/etc/default/ntpmon` to configure the command-line options. Run
`/opt/ntpmon/bin/ntpmon --help` for details of all available options.

## Prerequisites

NTPmon is written in python, and requires python 3.8 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).
is available from pypi or your operating system repositories. It requires `ntpq`
or `chronyc` to retrieve metrics from the running NTP daemon. If you intend to
run the prometheus exporter, the [prometheus python
client](https://pypi.org/project/prometheus-client/) is also required.

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

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.)
sudo apt-get install chrony python3-prometheus-client python3-psutil
# or substitute ntp for the traditional NTP server

## Usage

To start running NTPmon, run:
To run NTPmon directly from source after manually installing the prerequisites:

cd /opt
git clone https://github.com/paulgear/ntpmon
Expand Down Expand Up @@ -100,39 +114,26 @@ 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
the original check_ntpmon are:

- Requires python 3.

- Removed dependency on GNU coreutils.

- Added support for detecting ntptrace loops.

- Added support for Nagios performance data:
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/perfdata.html

- Added collectd daemon.
expose it on untrusted networks, and are reminded that - as stated in the
license terms - this software comes with no warranty.

- Added telegraf daemon.
### Telegraf integration

- Removed support for changing thresholds; if the one person on the Internet
who actually uses this really wants it, I might add it back. :-)
When run in telegraf mode, NTPmon requires the telegraf [socket
listener](https://docs.influxdata.com/telegraf/v1/plugins/#input-socket_listener)
input plugin to be enabled. Use the `--connect` command-line option if you
configure this to listen on a host and/or port other than the default
(127.0.0.1:8094).

## 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).
By default, until the NTP server 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.
- Better/more unit tests.
- Create installer.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ntpmon (2.1.0-1) focal; urgency=medium

* New upstream release.

-- Paul Gear <[email protected]> Fri, 22 Dec 2023 14:47:31 +1000

ntpmon (2.0.2+repack1-2) focal; urgency=medium

* Rebuild with /opt/ntpmon as install directory so as not to clash with
Expand Down
2 changes: 1 addition & 1 deletion debian/check_ntpmon-man.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:Version: 2.0.2
:Version: 2.1.0
:Date: 2023-09-28
:Copyright: 2015-2023 Paul Gear
:Title: check_ntpmon
Expand Down
5 changes: 3 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ Rules-Requires-Root: no

Package: ntpmon
Architecture: all
Depends: ${misc:Depends}, ${python3:Depends}, adduser, chrony | ntp, python3-prometheus-client (>= 0.16.0), python3-psutil
Depends: ${misc:Depends}, ${python3:Depends}, adduser, chrony | ntp, python3-psutil
Recommends: python3-prometheus-client (>= 0.16.0)
Suggests: collectd, nagios-nrpe-server, telegraf
Description: Monitor/check NTP metrics
This application is a flexible monitor/checker for the health of an
NTP daemon, supporting chronyd and ntpd. It supports reporting metrics
to collectd, Nagios, prometheus, and telegraf.
to collectd, Nagios, prometheus (the default), and telegraf.
2 changes: 1 addition & 1 deletion debian/ntpmon-man.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:Version: 2.0.2
:Version: 2.1.0
:Date: 2023-09-28
:Copyright: 2015-2023 Paul Gear
:Title: ntpmon
Expand Down
4 changes: 1 addition & 3 deletions src/ntpmon.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
# To listen on an address other than loopback, add the --listen-address option
# to DAEMON_ARGS as follows:
# DAEMON_ARGS="--interval 60 --mode prometheus --listen 192.0.2.34"
# To listen on all addresses, use 0.0.0.0 as the listen address.
# At the moment IPv6 is not supported due to a bug in the underlying
# prometheus_client library.
# To listen on all addresses, use 0.0.0.0 or :: as the listen address.

# For other available command line options, see the {{ NAME }}(8) man page.

Expand Down

0 comments on commit 5fb43e9

Please sign in to comment.