Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Mon May 21, 2012 8:46 am


ATTENTION: All users passwords have been cleared.
Please use the "Forgot Password" feature to reset your password.


All times are UTC - 5 hours




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: BIND 9 stats remote with SSH ( without using SNMP )
PostPosted: Sat Jun 21, 2008 4:34 pm 
Offline
Cacti User

Joined: Tue Feb 21, 2006 9:40 am
Posts: 68
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:
cacti_host_template_af-dns-bind_9_5.xml [66.44 KiB]
Downloaded 1083 times
ssh-dns-bind95-stats.pl [3.39 KiB]
Downloaded 1415 times
2.png
2.png [ 21.73 KiB | Viewed 19428 times ]
1.png
1.png [ 26 KiB | Viewed 19428 times ]


Last edited by gagadget on Fri Jan 14, 2011 4:37 am, edited 3 times in total.
Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 03, 2008 10:47 am 
Offline

Joined: Thu Jul 03, 2008 10:45 am
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 07, 2008 10:10 am 
Offline
Cacti User

Joined: Tue Feb 21, 2006 9:40 am
Posts: 68
Made some translations, reposted it.


Last edited by gagadget on Wed Oct 15, 2008 8:39 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 08, 2008 5:26 am 
Offline

Joined: Thu Jul 03, 2008 10:45 am
Posts: 2
hé hé,

New error :-(

Error: XML: Hash version does not exist.

What is your version of Cacti for exporting this template.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 08, 2008 3:52 pm 
Offline
Cacti User

Joined: Tue Feb 21, 2006 9:40 am
Posts: 68
Using 0.8.7a


Top
 Profile  
 
 Post subject: Empty Values
PostPosted: Tue Sep 16, 2008 7:59 pm 
Offline

Joined: Tue Sep 16, 2008 7:55 pm
Posts: 12
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2008 9:21 pm 
Offline
Cacti User

Joined: Tue Feb 21, 2006 9:40 am
Posts: 68
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 ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2008 10:10 pm 
Offline

Joined: Tue Sep 16, 2008 7:55 pm
Posts: 12
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2008 10:24 pm 
Offline
Cacti User

Joined: Tue Feb 21, 2006 9:40 am
Posts: 68
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]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 18, 2008 2:42 am 
Offline

Joined: Tue Sep 16, 2008 7:55 pm
Posts: 12
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 23, 2008 4:26 am 
Offline
Cacti User

Joined: Tue Feb 21, 2006 9:40 am
Posts: 68
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 476 times
cacti_host_template_af-dns-bind_9_4.xml [20.69 KiB]
Downloaded 393 times
Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 23, 2008 9:51 pm 
Offline

Joined: Tue Sep 16, 2008 7:55 pm
Posts: 12
Thanks so much!


Top
 Profile  
 
 Post subject: Re: BIND 9.5 stats remote with SSH ( without SNMP )
PostPosted: Wed Sep 24, 2008 4:04 am 
Offline

Joined: Wed Sep 24, 2008 3:57 am
Posts: 3
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 01, 2008 7:22 am 
Offline
Cacti User

Joined: Tue Feb 21, 2006 9:40 am
Posts: 68
What version of BIND are you using ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 01, 2008 11:11 am 
Offline

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

9.5.-p2
Everything looks ok in logs but not with graph


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group