BIND 9 stats remote with SSH ( without using SNMP )

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

BIND 9 stats remote with SSH ( without using SNMP )

Post by gagadget »

I made a script to graph BIND 9 stats through SSH for people like me who don't have access to their servers via SNMP.

See the perl script and the host template attached.

What does the script ?
The script open a SSH connection to the remote machine, execute "rndc stats", parse it to grab needed counters and remove it. Nothing have to be installed on the server except BIND 9 ;)

How to configure the script ?
You must put the script in the directory <path_cacti>/scripts/AF on the cacti server. You also should edit and modify it especially for PATHs like perl interpreter, local SSH binary and remote rndc and named.stats locations.
The cacti user must havec access to a user on the remote DNS machine via SSH with private/public key ( without password ).

What is in the template ?
See the two graphs attached

How to configure the template ?
Just import the template, and apply it to a device. Feel free to translate titles and labels that are in French.
When creting the graphs, you will be asked for a user, the user is the remote user though which cacti will open a ssh connection on the remote machine.

Where is the last version ?
The last version is now always attached in this post.

Please, tell me how I should improve the script and the template and I also would be glad if someone send me improvements.
Attachments
1.png
1.png (26 KiB) Viewed 53391 times
2.png
2.png (21.73 KiB) Viewed 53391 times
ssh-dns-bind95-stats.pl
(3.39 KiB) Downloaded 4854 times
cacti_host_template_af-dns-bind_9_5.xml
(66.44 KiB) Downloaded 4359 times
Last edited by gagadget on Fri Jan 14, 2011 4:37 am, edited 3 times in total.
chossced
Posts: 2
Joined: Thu Jul 03, 2008 10:45 am

Post by chossced »

Previous Cacti template for BIND monitoring doesn't work anymore with BIND 9.5

So I'm trying this new plugin ;-)

I'm using Cacti 0.8.6i

when import template => Error: XML parse error.

how to deal with that ?

Thanks.

PS: Impossible to upgrade to 0.8.7b actually
gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

Post by gagadget »

Made some translations, reposted it.
Last edited by gagadget on Wed Oct 15, 2008 8:39 am, edited 1 time in total.
chossced
Posts: 2
Joined: Thu Jul 03, 2008 10:45 am

Post by chossced »

hé hé,

New error :-(

Error: XML: Hash version does not exist.

What is your version of Cacti for exporting this template.
gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

Post by gagadget »

Using 0.8.7a
erekose
Posts: 12
Joined: Tue Sep 16, 2008 7:55 pm

Empty Values

Post by erekose »

I've recently installed this util and think it has great potential.
My only problem at the moment is that my stats come back empty, even though the named_stats file is populated with data.

Any pointers????

Stats:
+++ Statistics Dump +++ (1221613094)
success 14125070
referral 18177
nxrrset 2114660
nxdomain 9273951
recursion 6622010
failure 704197
duplicate 56451
dropped 109120
--- Statistics Dump --- (1221613094)


Results from running perl script:
A:0 AAAA:0 ANY:0 AXFR:0 CNAME:0 IXFR:0 MX:0 NS:0 PTR:0 SOA:0 SRV:0 TXT:0 success:0 nonauthoritative:0 errors:0 nxdomain:0 recursion:0 dropped:0
gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

Post by gagadget »

The script is for BIND 9.5 and the last version of BIND 9.4 and looking at the named.stats file, it seems you are using an older version of BIND 9.4.

I can send/post an old version of the script that can parse this file if you want.

What version of BIND are you using ?
erekose
Posts: 12
Joined: Tue Sep 16, 2008 7:55 pm

Post by erekose »

gagadget wrote:The script is for BIND 9.5 and the last version of BIND 9.4 and looking at the named.stats file, it seems you are using an older version of BIND 9.4.

I can send/post an old version of the script that can parse this file if you want.

What version of BIND are you using ?
Hi, I am using BIND 9.4.2-P1...I actually thought we had installed 9.5.
I'd love to see that script if I may.
gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

Post by gagadget »

I'll post the script next week as I am in vacation. But the 9.4 is very limited concerning the stats.

Move to 9.5 in production only if you don't have many ACLs in many zones because BIND can eat up several gigas of RAM due to a bug that will be corrected in 9.5.1 versions ( already included in 9.5.1b1 ), here is the line in the release notes :

2373. [bug] Default values of zone ACLs were re-parsed each time a new zone was configured, causing an overconsumption of memory. [RT #18092]
erekose
Posts: 12
Joined: Tue Sep 16, 2008 7:55 pm

Post by erekose »

gagadget wrote:I'll post the script next week as I am in vacation. But the 9.4 is very limited concerning the stats.

Move to 9.5 in production only if you don't have many ACLs in many zones because BIND can eat up several gigas of RAM due to a bug that will be corrected in 9.5.1 versions ( already included in 9.5.1b1 ), here is the line in the release notes :

2373. [bug] Default values of zone ACLs were re-parsed each time a new zone was configured, causing an overconsumption of memory. [RT #18092]

No worries on waiting till next week. I appreciate your help.
gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

Post by gagadget »

Here is the script and the template. You can get only the global stats in 9.4 not the details of the queries.
Attachments
ssh-dns-bind94-stats.pl
(1.88 KiB) Downloaded 3592 times
cacti_host_template_af-dns-bind_9_4.xml
(20.69 KiB) Downloaded 3533 times
erekose
Posts: 12
Joined: Tue Sep 16, 2008 7:55 pm

Post by erekose »

Thanks so much!
shamrock
Posts: 3
Joined: Wed Sep 24, 2008 3:57 am

Re: BIND 9.5 stats remote with SSH ( without SNMP )

Post by shamrock »

Hi,

I've imported your script and it seems doesn't work properly.
When it get data I see it does "rrdtool update --template ...' with only few values (it doesn't get A record nor nxdomain ). But graph trying to draw using this variables. What may goes wrong ?

Best regards,

Shamrock
gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

Post by gagadget »

What version of BIND are you using ?
shamrock
Posts: 3
Joined: Wed Sep 24, 2008 3:57 am

Post by shamrock »

gagadget wrote:What version of BIND are you using ?
9.5.-p2
Everything looks ok in logs but not with graph
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests