Re: BIND9 statistics-server: JSON?

2013-03-15 Thread Shane Kerr
On Fri, 15 Feb 2013 06:57:10 +0100
Jan-Piet Mens jpmens@gmail.com wrote:

 As a fan of BIND's statistics-server I was tempted to see if I could
 reduce the size of the data (XML) named produces by adding an option
 to produce JSON. The patch [1] (which is terribly quick and dirty)
 does that.
 
 [1] https://gist.github.com/jpmens/4958763

I used to say:

snip/

But in this case I'll say:

{ text: snipped }

 If I cleaned this up appropriately and attempted to add some (all?) of
 the counters (I'm mostly interested in the list of zones which is why
 I started with that) would there be a chance of ISC adding this to
 stock BIND9? Even better: would ISC take on the work of doing it? ;-)

Evan has merged this into master, and it will go out in 9.10, sometime
later this year. (We're also putting it into our new subscription
branch, which should be available for subscription customers in a few
weeks.)

Thanks Jan-Piet!!!

--
Shane
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: BIND9 statistics-server: JSON?

2013-03-15 Thread Jan-Piet Mens

 { text: snipped }

;-)

 Evan has merged this into master

I know -- he's kept me busy looking and testing, and it looks very good.

 and it will go out in 9.10, sometime
 later this year. (We're also putting it into our new subscription
 branch, which should be available for subscription customers in a few
 weeks.)

I pleaded and begged for it to be in 9.9.3b3, but, oh, well. (No
worries: I'm grossly exaggerating.)

 Thanks Jan-Piet!!!

Thank you all for accepting the idea and implementing it cleanly!
Looking very much forward to seeing this.

-JP
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: BIND9 statistics-server: JSON?

2013-02-15 Thread Niall O'Reilly

On 15 Feb 2013, at 05:57, Jan-Piet Mens wrote:

 would there be a chance of ISC adding this to stock
 BIND9? Even better: would ISC take on the work of doing it? ;-)

FWIW: +1

/Niall

___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: BIND9 statistics-server: JSON?

2013-02-15 Thread Mike Hoskins (michoski)
-Original Message-

From: Jan-Piet Mens jpmens@gmail.com
Date: Friday, February 15, 2013 12:57 AM
To: bind-users@lists.isc.org bind-users@lists.isc.org
Subject: BIND9 statistics-server: JSON?

As a fan of BIND's statistics-server I was tempted to see if I could
reduce the size of the data (XML) named produces by adding an option to
produce JSON. The patch [1] (which is terribly quick and dirty) does that.

[1] https://gist.github.com/jpmens/4958763

Just wanted to say thanks for this, and hope it becomes official at some
point.  Many here prefer JSON anywhere it is available...sounds like we
are not alone.

___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


BIND9 statistics-server: JSON?

2013-02-14 Thread Jan-Piet Mens
As a fan of BIND's statistics-server I was tempted to see if I could
reduce the size of the data (XML) named produces by adding an option to
produce JSON. The patch [1] (which is terribly quick and dirty) does that.

[1] https://gist.github.com/jpmens/4958763

Accessing the URI /json on named would produce something like this:

{
views: {
_default: [
{
name: 0.IN-ADDR.ARPA,
class: IN,
serial: 0
},
{
name: B.E.F.IP6.ARPA,
class: IN,
serial: 0
},
[...]
{
name: ww.mens.de,
class: IN,
serial: 201211565
}
],
_bind: [
{
name: authors.bind,
class: CH,
serial: 0
},
[...]
]
}
}

Which of course is trivial to parse, with say,

#!/usr/bin/env python

import sys, json urllib2

BINDURI = 'http://127.0.0.1:8053/json'

f = urllib2.urlopen(BINDURI)

# print f.headers

doc = json.loads(f.read())

views = doc['views']
for viewname, zonelist in views.iteritems():
print viewname
for zone in zonelist:
print \t%s %-40s %s % (zone['class'], zone['name'], 
zone['serial'])

which in turn makes this:

_default
IN 0.IN-ADDR.ARPA   0
IN B.E.F.IP6.ARPA   0
IN ww.mens.de   201211565
[...]
_bind
CH authors.bind 0
[...]

I haven't yet conducted tests as to which is actually faster to
produce/transport/consume, but I _suspect_ it's JSON. :)

If I cleaned this up appropriately and attempted to add some (all?) of
the counters (I'm mostly interested in the list of zones which is why I
started with that) would there be a chance of ISC adding this to stock
BIND9? Even better: would ISC take on the work of doing it? ;-)

Regards,

-JP
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users