plugins/inputs/openntpd/README.md
This plugin gathers metrics from OpenNTPD using the ntpctl
command.
[!NOTE] The
ntpctlbinary must be present on the system and executable by Telegraf. The plugin supports usingsudofor execution.
⭐ Telegraf v1.12.0 🏷️ server, network 💻 all
Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See CONFIGURATION.md for more details.
# Get standard NTP query metrics from OpenNTPD.
[[inputs.openntpd]]
## Run ntpctl binary with sudo.
# use_sudo = false
## Location of the ntpctl binary.
# binary = "/usr/sbin/ntpctl"
## Maximum time the ntpctl binary is allowed to run.
# timeout = "5s"
It's important to note that this plugin references ntpctl, which may require
additional permissions to execute successfully. Depending on the user/group
permissions of the telegraf user executing this plugin, you may need to alter
the group membership, set facls, or use sudo.
$ groups telegraf
telegraf : telegraf
$ usermod -a -G ntpd telegraf
$ groups telegraf
telegraf : telegraf ntpd
If you use this method, you will need the following in your telegraf config:
[[inputs.openntpd]]
use_sudo = true
You will also need to update your sudoers file:
$ visudo
# Add the following lines:
Cmnd_Alias NTPCTL = /usr/sbin/ntpctl
telegraf ALL=(ALL) NOPASSWD: NTPCTL
Defaults!NTPCTL !logfile, !syslog, !pam_session
Please use the solution you see as most appropriate.
float)float)float)int)int)int)int)openntpd,remote=194.57.169.1,stratum=2,host=localhost tl=10i,poll=1007i,
offset=2.295,jitter=3.896,delay=53.766,next=266i,wt=1i 1514454299000000000