Score logs / json not showing most recent data

Hello Ask

I am using the Nagios check from GitHub - mj/nagios-ntp-pool
to check the scores of my servers. It does use this URL:
https://www.pool.ntp.org/scores/62.2.85.186/json?limit=1

It seems to constantly reporting a score of -0.1, but on
pool.ntp.org: Statistics for 62.2.85.186 the recentmedian score is
fine with ~20, the legacy score shows quite often different values. This
is an IP address which has a long history of often being difficult to
reach from the previous monitoring system. It seems that some of my ISPs
transit carriers are doing some filtering / DDoS protection. This can be
seen with around half of the scores in ā€œtestingā€ being negativ.

Another server (pool.ntp.org: Statistics for 62.12.173.11) is just
fine and also the json looks good with reporting a score of 20:
https://www.pool.ntp.org/scores/62.12.173.11/json?limit=1

Could it be, that the score in the json output still does use ā€œoldā€ (or
even stale) data? The IP 62.2.85.186 had a too low score since 13th
March 2023, so before the new monitoring system went into operation.

Best regards,
Fabian

2 Likes

That realy looks old data, the timestamps are 1679120256 and 1679120034 in the json, which means 18th of March.

Hello NTPman

Oh, you are right, I could have checked that on my own. :wink:

So I guess another thing for Ask to investigate and fix then. :frowning:

To enlighten people not familiar with such things. The timestamps are in
seconds since the Epoche (01.01.1970 00:00 UTC), to get an
understandable date use below commands depending on your OS.

On BSD-style systems (including macOS):
% date -r 1679120256
Sat Mar 18 07:17:36 CET 2023
% date -r 1679120034
Sat Mar 18 07:13:54 CET 2023

With GNU date (on Linux systems):
$ date -d @1679120256
Sat 18 Mar 2023 07:17:36 AM CET
$ date -d @1679120034
Sat 18 Mar 2023 07:13:54 AM CET

Best regards,
Fabian

How odd! Skimming the code I think I see the bug, maybe, but I donā€™t understand how it ever worked ā€“ many of the relevant bits are ~10 years old. Iā€™ll see if I can fix it this weekend. A github issue referencing this thread would be welcome.

1 Like

Hello Ask

Done, see Score logs / json not showing most recent data Ā· Issue #225 Ā· abh/ntppool Ā· GitHub

Best regards,
Fabian

1 Like

Thanks @fab23 ā€“ it should be fixed now (on the beta site and production site both).

The old monitoring system created a history with a NULL monitor_id for the scorer. What happened was that you before got the last value from the old scorer (until that expired into the archive history which isnā€™t currently available through the API). I fixed it so if you donā€™t specify a monitor_id itā€™ll choose the ā€˜recent medianā€™ scorer.

2 Likes

Hello Ask

Thanks, yes it looks fine now and all my Nagios checks report an OK
state again.

Best regards,
Fabian

2 Likes