BIND 9 stats remote with SSH ( without using SNMP )
Moderators: Developers, Moderators
BIND 9 stats remote with SSH ( without using SNMP )
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.
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 (26 KiB) Viewed 53470 times
-
- 2.png (21.73 KiB) Viewed 53470 times
-
- ssh-dns-bind95-stats.pl
- (3.39 KiB) Downloaded 4855 times
-
- cacti_host_template_af-dns-bind_9_5.xml
- (66.44 KiB) Downloaded 4360 times
Last edited by gagadget on Fri Jan 14, 2011 4:37 am, edited 3 times in total.
Empty Values
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
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
Hi, I am using BIND 9.4.2-P1...I actually thought we had installed 9.5.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 ?
I'd love to see that script if I may.
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]
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]
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.
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 3596 times
-
- cacti_host_template_af-dns-bind_9_4.xml
- (20.69 KiB) Downloaded 3533 times
Re: BIND 9.5 stats remote with SSH ( without SNMP )
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
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
Who is online
Users browsing this forum: No registered users and 0 guests