Processing "BIND8-like" statistics

I wonder how to process the statistics logged by nsd. We compile with
--enable-bind8-stats and I thought we would be able to reuse the Perl
script that translated our BIND8 statistics to MRTG.

But the script has problems, probably because nsd has several daemons,
not just one, and each one is logging statistics.

Aug 4 10:34:01 ns2 nsd[24573]: NSTATS 1059986041 1059979224 A=292259 NS=4886 CNAME=256 SOA=5340 PTR=196322 HINFO=1 MX=37851 TXT=504 AAAA=19385 LOC=2 SRV=1154 A6=22919 ANY=8555
Aug 4 10:34:01 ns2 nsd[24573]: XSTATS 1059986041 1059979224 RR=0 RNXD=0 RFwdR=0 RDupR=0 RFail=0 RFErr=0 RErr=0 RAXFR=0 RLame=0 ROpts=0 SSysQ=0 SAns=590234 SFwdQ=0 SDupQ=0 SErr=0 RQ=590178 RIQ=0 RFwdQ=2369 RDupQ=0 RTCP=0 SFwdR=0 SFail=2369 SFErr=704 SNaAns=477690 SNXD=90844 RUQ=0 RURQ=0 RUXFR=0 RUUpd=26
Aug 4 10:34:01 ns2 nsd[24574]: NSTATS 1059986041 1059979224 NS=3 SOA=2 AXFR=3
Aug 4 10:34:01 ns2 nsd[24574]: XSTATS 1059986041 1059979224 RR=0 RNXD=0 RFwdR=0 RDupR=0 RFail=0 RFErr=0 RErr=0 RAXFR=0 RLame=0 ROpts=0 SSysQ=0 SAns=0 SFwdQ=0 SDupQ=0 SErr=0 RQ=8 RIQ=0 RFwdQ=0 RDupQ=0 RTCP=16 SFwdR=0 SFail=0 SFErr=0 SNaAns=0 SNXD=0 RUQ=0 RURQ=0 RUXFR=0 RUUpd=0

Here, I assume that 24573 is the UDP daemon, working at full speed and
24574 is the TCP daemon, much less active (I have also the master
daemon, 24570, which apparently does not log).

Is there a way to get the stats only from the UDP daemon?

* I do not see any difference in the logs,
* I do not see any difference in 'ps auxwww' output.

So, the script has to implement AI to guess which is the right
daemon. How do people who maintains
<URL:http://k.root-servers.org/ktotal/-daily.html&gt; do?

Stephane Bortzmeyer wrote:

I wonder how to process the statistics logged by nsd. We compile with
--enable-bind8-stats and I thought we would be able to reuse the Perl
script that translated our BIND8 statistics to MRTG.

But the script has problems, probably because nsd has several daemons,
not just one, and each one is logging statistics.

Isn't it easiest to add up the stats in your script? Especially if you decide to run multiple UDP daemons later on to take advantage of multiple CPUs on ns2.nic.fr.

Erik

a message of 13 lines which said:

Isn't it easiest to add up the stats in your script?

The problem is to find all the relevant lines belonging to a single
run of nsd. If I stop nsd and start it again, I do not want the script
to add all the lines it finds, only those of the last instance.

Since "instance" does not mean "process" for nsd, I cannot use the PID
to find out.

Stephane Bortzmeyer wrote:

a message of 25 lines which said:

What kind of statistics gathering are you doing?

Our MRTG service is not public but we do very much like
<URL:http://k.root-servers.org/ktotal/-daily.html&gt;\.