On 28 Aug 2018, at 00:33, Job Snijders via db-wg <db-wg@ripe.net> wrote:Hi all,
It appears there currently is no easy way to retrieve the current serial
from the RIPE DB. We're implementing some software to monitor whether
our local mirror is wildly out of sync with the RIPE DB or not.
I kind of expected th serial to be listed in the --list-sources command,
but that field is set to 0.
hanna:~ job$ whois -h whois.ripe.net -- --list-sources | grep RIPE
% This is the RIPE Database query service.
% The RIPE Database is subject to Terms and Conditions.
RIPE:3:N:0-0
RIPE-GRS:3:N:0-0
% This query was served by the RIPE Database Query Service version 1.91.2 (HEREFORD)
In comparison, IRRd will display the current serial when the !j query is
issued:
hanna:~ job$ whois -h rr.ntt.net -- '!jNTTCOM'
A25
NTTCOM:N:0-978492:978492
C
hanna:~ job$
I came up with a really ugly oneliner:
$ whois -h 193.0.6.135 -p 4444 -- \
"-g RIPE:3:$(curl -s https://ftp.ripe.net/ripe/dbase/RIPE.CURRENTSERIAL)-LAST" | \
grep -v : | sed '/^$/d' | tail -n 2 | head -1 | awk '{ print $NF }'
42486238
Depending on the time of day that oneliner may be quite quick, or take
several minutes to complete... obviously not ideal.
Can --list-sources perhaps be improved to list the current serial?
Kind regards,
Job