Hello Anssi
On 28.07.2012 00:41, Anssi Johansson wrote:
And ntppackets.pl looks like this:
my $status = `/usr/sbin/ntpdc -c iostats`;
if($status =~ m!received packets:\s*(-?\d+)!) {
$received=$1 + 2147483648;
}
if($status =~ m!packets sent:\s*(-?\d+)!) {
$sent=$1 + 2147483648;
}
I use a simple shell script (sorry for some line breaks):
---8<----------------------------------------------------------
#!/usr/local/bin/bash
RESULT="`ntpdc -c sysstats -c iostats $1`"
OUTPUT1="`echo "$RESULT" | grep 'packets received' | awk '{ print
$3 }'`"
OUTPUT2="`echo "$RESULT" | grep 'packets sent' | awk '{ print $3 }'`"
echo -e "$OUTPUT1\n$OUTPUT2"
exit
---8<----------------------------------------------------------
But I use the 'packets received' from the 'ntpdc -c sysstat'
instead of 'received packet' from the 'ntpdc -c iostats'. I do
see a quite large difference, which somehow is strange:
$ ntpdc -c sysstat -c iostats ntp1.home4u.ch | grep packets
packets received: 15297017
packets processed: 245203
dropped packets: 29715
ignored packets: 0
received packets: 65153970
packets sent: 15087587
packets not sent: 16
When I check with tcpdump, I usualy see as many requests as
answers, so this is why I do use the 'packets received' and
'packets sent' values for my graphs. I am not sure, but I guess,
that 'packets received' are only valid ntp request, and that
'received packets' are all packets (probably also from port
scanning) which arrive at the ntpd. Does anybody know more about
this?
bye
Fabian
_______________________________________________
pool mailing list
[email protected]
http://lists.ntp.org/listinfo/pool