By statistics I mean amount of queries, and maybe in a graph. Have seen it around just not sure how to do it
How much āniceā it have to be ?
You can setup some full āblownā monitoring with fany UI and a database server as backend or you can setup something simple.
Iām using Munin to monitor my server. For the NTP Server iām using the ntp_packets plugin.
Thereāre also some Chrony Plugins (with example graphs)
Sounds good, thanks! I saw a couple options for ntpd but not for chrony so nice to see someone else that uses chrony
for load curves - when i configured munin for this years ago there was no ntp load plugin, so we did a firewall rule doing the counting and let munin graph that one.
Alternatively you could use packages like rrdtool and make your own graphs with them.
And if ānice guiā also means administration and configuration of your ntp, companies like Meinberg will happily sell you boxes that have all that.
If you are ok with ansible and running Fedora or similar, there is an ansible role I use for public NTP servers, which installs and configures chrony, collectd, iptables and rrdgraph to collect and plot some statistics, including NTP packet rates.
I tend to agree, performance plots with chrony
are not obvious or easy.
munin is and netdata are both good with their respective plugins for chrony
but they only provide general statistics output from chronyc
.
Iām working a bit on something for myself, to see ālive numbersā or analyze a pcap quickly in an ad hoc fashion. Perhaps it is of use to you as well:
Let me know if you have suggestions.
Off course a good tshark
(or tcpdump
) and iptraf-ng
(with appropriate filter), can also give you a quick rough idea of whatās happening.
For long term statistics I prefer Grafana with a home made Prometheus exporter. Hereās an example of what it looks like:
hey, Iām doing sudo tcpdump -i eth0 -n "udp and port 123" -p --immediate-mode -U -s110 -w - 2> /dev/null | ./ntptraf2 -
, but getting pcap file [-] with error truncated dump file; tried to read 4 file header bytes, only got 0
.
also, from where does prometheus get itās data?
Please check your interface name; it is probably not eth0 but something else.
Prometheus gets itās data from a simple homemade exporter. Basically nothing more than an HTTP-server written in Go that serves a file in the right format. The file is generated with a couple of bash scripts on a regular interval. Itās a bit ugly, but works. When I have time Iāll clean up the code and put it on Github.