# Bind9 monitoring and statistics?

## jsosic

Hi!

I'm trying to write a script/whatever that will monitor bind statistics and report it to Zabbix monitoring software.

I'm having troubles with Bind... It seems that only way to get statistics is by running "rndc stats"? I get output like this one: 

```
+++ Statistics Dump +++ (1208613573)

success 82186

referral 13491

nxrrset 20350

nxdomain 23704

recursion 57408

failure 17226

--- Statistics Dump --- (1208613573)
```

I've found somewhere on the internet, that Bind can report even greater level of details, like this: 

```
+++ Statistics Dump +++ (800708260) Wed May 17 03:57:40 1995

746683    time since boot (secs)

392768    time since reset (secs)

14        Unknown query types

268459    A queries

3044      NS queries

5680      CNAME queries

11364     SOA queries

1008934   PTR queries

44        HINFO queries

680367    MX queries

2369      TXT queries

40        NSAP queries

27        AXFR queries

8336      ANY queries
```

Was this some older version of Bind or can I get these lines from Bind9 too?

Also, another problem. I would like to get statistcs about queries and stuff in the last 10 minutes, and not since the last Bind9 restart... Is this achievable without scripting it (saving old values and then just decrementing the new ones)?

----------

## jsosic

Bump!

So, no one even has an idea or suggestion where to look for?

----------

## xces

 *jsosic wrote:*   

> Was this some older version of Bind

 

Yes.

 *jsosic wrote:*   

> or can I get these lines from Bind9 too?

 

No.

For a description, see http://www.isc.org/sw/bind/arm94/Bv9ARM.ch06.html#statsfile. You can also get the wanted information from your query/audit log, see http://munin.projects.linpro.no/browser/trunk/node/node.d/bind9.in for an example.

----------

## jsosic

That's nice, but this last perl script from munin that you've posted only gets me the information from 'named.stats' and not the AAA, AA, A, MX records and similar....

Well, I guess I'll have to be satisfied with avaliable stats  :Sad: 

----------

## xces

 *jsosic wrote:*   

> That's nice, but this last perl script from munin that you've posted only gets me the information from 'named.stats' and not the AAA, AA, A, MX records and similar....

 

You might have forgotten to activiate your query log for Bind and/or to point the script at it.

----------

