BIND 9 Statistics for Cacti

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

Moderators: Developers, Moderators

Post Reply
rpingar
Cacti User
Posts: 86
Joined: Mon Jun 07, 2004 8:17 am

Post by rpingar »

any comment on how to increase the nxdoamin max limit?

seems that the ds max doens't fix my problem

regards
Liszek
Posts: 8
Joined: Tue Apr 22, 2008 2:54 am

debian lenny

Post by Liszek »

Hi I have problem to execute Your script on Debian Lenny OS.

I have the foloowing error:

ns:~# /usr/bin/perl /usr/local/bin/bind9-stats-snmpd.pl
Can't locate SNMP/Extension/PassPersist.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0
/usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/local/bin/bind9-stats-snmpd.pl line 48.
BEGIN failed--compilation aborted at /usr/local/bin/bind9-stats-snmpd.pl line 48.
ns:~#

I cant find PassPersist.pm lib in repsository
Liszek
Posts: 8
Joined: Tue Apr 22, 2008 2:54 am

Post by Liszek »

Ok

I resolved the problem. I had to compile by myself SNMP PassPersist MOdule form http://search.cpan.org/~saper/SNMP-Exte ... sist-0.03/

I have one more question about CACTI aplication.

Before Debian update in old version of bind9 statistic, I had counted NXDomain Queries. But now after update I have only Success and Failure Queries.

Is it correct?
akos.maroy
Posts: 9
Joined: Tue Jul 14, 2009 2:47 am

Post by akos.maroy »

I'm trying to local setup version of this thing, and even though the scripts seem to run fine, it still doesn't seem to work from within cacti.

the cacti 'run verbose query' feature says:

Code: Select all

+ Running data query [13].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/bind9-stats.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /usr/share/cacti/site/scripts/bind9-stats.pl index'
+ Executing script query 'perl /usr/share/cacti/site/scripts/bind9-stats.pl query zone'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/bind9-stats.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/bind9-stats.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/bind9-stats.xml'
while from the command line, I get:

Code: Select all

# perl /usr/share/cacti/site/scripts/bind9-stats.pl index
GLOBAL
kormanybeszerzo.hu
maroy.hu
# perl /usr/share/cacti/site/scripts/bind9-stats.pl query zone
GLOBAL:GLOBAL
kormanybeszerzo.hu:kormanybeszerzo.hu
maroy.hu:maroy.hu
still, in the data queries line in cacti, I get:

Code: Select all

1) BIND 9 Statistics  	 (Verbose Query)  	 Uptime Goes Backwards  	 Success [0 Items, 0 Rows] 
what am I doing wrong?
ursal
Posts: 6
Joined: Thu Aug 20, 2009 6:52 am

Post by ursal »

For those who has

Code: Select all

+ No SNMP data returned 
Just increase maximum OID number for snmp-walk. Globaly or in host settings
akos.maroy
Posts: 9
Joined: Tue Jul 14, 2009 2:47 am

Post by akos.maroy »

ursal wrote:For those who has

Code: Select all

+ No SNMP data returned 
Just increase maximum OID number for snmp-walk. Globaly or in host settings
how would I do that? can you be a bit more specific?
aleu
Cacti User
Posts: 216
Joined: Mon Dec 11, 2006 10:17 am

Post by aleu »

akos.maroy wrote:I'm trying to local setup version of this thing, and even though the scripts seem to run fine, it still doesn't seem to work from within cacti.

the cacti 'run verbose query' feature says:

Code: Select all

+ Running data query [13].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/bind9-stats.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /usr/share/cacti/site/scripts/bind9-stats.pl index'
+ Executing script query 'perl /usr/share/cacti/site/scripts/bind9-stats.pl query zone'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/bind9-stats.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/bind9-stats.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/bind9-stats.xml'
while from the command line, I get:

Code: Select all

# perl /usr/share/cacti/site/scripts/bind9-stats.pl index
GLOBAL
kormanybeszerzo.hu
maroy.hu
# perl /usr/share/cacti/site/scripts/bind9-stats.pl query zone
GLOBAL:GLOBAL
kormanybeszerzo.hu:kormanybeszerzo.hu
maroy.hu:maroy.hu
still, in the data queries line in cacti, I get:

Code: Select all

1) BIND 9 Statistics  	 (Verbose Query)  	 Uptime Goes Backwards  	 Success [0 Items, 0 Rows] 
what am I doing wrong?
Well, I have somehow similar results, yet different:

Code: Select all

+ Running data query [13].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/cacti/resource/script_queries/bind9-stats.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /var/www/cacti/scripts/bind9-stats.pl index'
+ Executing script query 'perl /var/www/cacti/scripts/bind9-stats.pl query zone'
+ Found item [bindName='GLOBAL'] index: GLOBAL
+ Found item [bindName=xxx.xxx'] index: xxx.xxx
...
+ Found item [bindName='yyy.yyy'] index: yyy.yyy
+ Found data query XML file at '/var/www/cacti/resource/script_queries/bind9-stats.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/bind9-stats.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/bind9-stats.xml'
I can also see that my data query was sucessful:

Code: Select all

1) BIND 9 Statistics  (Verbose Query)  Uptime Goes Backwards  Success [30 Items, 30 Rows]  
, but when I try to graph any of the zones I get page where I can customize graph title, Data Source name and finally custom data field called zone which is populated with string "GLOBAL. No matter whether I leave GLOBAL or substitute it with actual index name e.g. xxx.xxx my graphs do not render (I get RED cross).

If I run the script from the command line, I get correct results:

Code: Select all

perl bind9-stats.pl getall xxx.xxx
recursion:22 success:48877 nxrrset:36637 referral:101494 nxdomain:5373 name:90874
Please advice.
ziontrash
Posts: 1
Joined: Wed Sep 23, 2009 8:04 am

BIND 9.6 stats

Post by ziontrash »

Hi!

I,am testing to make some cacti stats,
The GLOBAL stats constantly disappear.

Does somebody know why?
Mike Adolphs
Posts: 3
Joined: Wed Nov 04, 2009 6:04 am
Location: Berlin, Germany

Post by Mike Adolphs »

Hi guys,

it seems a lot of people have the following issue with the 'no snmp data returned' error message:

Code: Select all

+ Running data query [15].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/opt/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2021.55.1'
+ No SNMP data returned
+ Found data query XML file at '/opt/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
+ Found data query XML file at '/opt/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
+ Found data query XML file at '/opt/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
This has not just something to do with increasing the amount of OIDs per snmpwalk but rather with the snmp timeout configuration variable. Simply increase the timeout value within your host configuration from 500ms to several seconds and you're set.

Best regards,
Mike Adolphs
aleu
Cacti User
Posts: 216
Joined: Mon Dec 11, 2006 10:17 am

Post by aleu »

Mike Adolphs wrote:This has not just something to do with increasing the amount of OIDs per snmpwalk but rather with the snmp timeout configuration variable. Simply increase the timeout value within your host configuration from 500ms to several seconds and you're set.
Can someone point me to the working template? I see plenty of posts on BIND 9.5 but none of them seems to work for me (I am getting a timeout when executing snmpwalk against the remote BIND server. When I do not specify the OID ".1.3.6.1.4.1.2021.55" I get the results, but no DNS information, of course.
I need to query a remote BIND server via SNMP. Please advise which template works for you (or upload the most recent version one more time).

Thanks a lot.
Mike Adolphs
Posts: 3
Joined: Wed Nov 04, 2009 6:04 am
Location: Berlin, Germany

Post by Mike Adolphs »

aleu wrote:
Mike Adolphs wrote:This has not just something to do with increasing the amount of OIDs per snmpwalk but rather with the snmp timeout configuration variable. Simply increase the timeout value within your host configuration from 500ms to several seconds and you're set.
Can someone point me to the working template? I see plenty of posts on BIND 9.5 but none of them seems to work for me (I am getting a timeout when executing snmpwalk against the remote BIND server. When I do not specify the OID ".1.3.6.1.4.1.2021.55" I get the results, but no DNS information, of course.
I need to query a remote BIND server via SNMP. Please advise which template works for you (or upload the most recent version one more time).

Thanks a lot.
There you go. The attached version works just fine. Stick to the documentation which can be found within the archive.

Generally it works like this:
1.) Copy the bind9-genstats.sh and the bind9-stats-snmp.pl script on your BIND server.
2.) Alter the bind9-stats-snmp.pl script in line 52 to fit your named.stats file's location
3.) Same with bind9-genstats.sh in line 16.
4.) Create the cronjob which frequently runs bind9-genstats.sh every 5min
5.) Alter your /etc/snmp/snmpd.conf so that it's able to serve the BIND information via the perl script
6.) Restart the SNMP daemon
7.) Do a manual snmpwalk -v2c -c <whather community string you have put in here> IP .1.3.6.1.4.1.2021.55 and you should get results. Otherwise you've messed something up in the first place and Cacti won't be able to pull data either.
8.) Integrate the template into Cacti and configure your data sources, graphs and so on via the web-interface.

Possible downfalls could be file or directory permissions, not sufficient rights to run rndc stats or else, but these are the most common.

Best regards,
Mike Adolphs
Attachments
bind9-stats-2.0.tar
(80 KiB) Downloaded 5689 times
aleu
Cacti User
Posts: 216
Joined: Mon Dec 11, 2006 10:17 am

Post by aleu »

Mike Adolphs wrote:There you go. The attached version works just fine. Stick to the documentation which can be found within the archive.
Hmm, this is the one I have. It used to work just fine for me, but recently I did perform the OS upgrade on my BIND server and since then the graphs stopped rendering. I am sure it must have to do with the permissions, but I do not know what could be causing this. Generally speaking my stats file is being created correctly every 5 minutes. It's permissions are 644 so everyone can read them. I have not changed the snmp settings at all and in the past all used to work just fine. Now when I snmpwalk the BIND server for the stats OID I get timeout which kind of implies that the perl script does not retrieve/parse the data correctly or my snmp daemon does not export this data correctly (if I snmpwalk the BIND server on .1 I am getting some other data like system name, uptime, disk usage etc. So this is not caused by an access control list or something like this. BTW. with the recent system upgrade my perl base has been upgraded as well. At first I have noticed that "SNMP::Extension::PassPersist" module was missing so I have downloaded it from CPAN and installed it. I am not sure what else I could check. If anyone has an idea, I would appreciate.

Thanks,
AL
Mike Adolphs
Posts: 3
Joined: Wed Nov 04, 2009 6:04 am
Location: Berlin, Germany

Post by Mike Adolphs »

aleu wrote:
Mike Adolphs wrote:There you go. The attached version works just fine. Stick to the documentation which can be found within the archive.
Hmm, this is the one I have. It used to work just fine for me, but recently I did perform the OS upgrade on my BIND server and since then the graphs stopped rendering. I am sure it must have to do with the permissions, but I do not know what could be causing this. Generally speaking my stats file is being created correctly every 5 minutes. It's permissions are 644 so everyone can read them. I have not changed the snmp settings at all and in the past all used to work just fine. Now when I snmpwalk the BIND server for the stats OID I get timeout which kind of implies that the perl script does not retrieve/parse the data correctly or my snmp daemon does not export this data correctly (if I snmpwalk the BIND server on .1 I am getting some other data like system name, uptime, disk usage etc. So this is not caused by an access control list or something like this. BTW. with the recent system upgrade my perl base has been upgraded as well. At first I have noticed that "SNMP::Extension::PassPersist" module was missing so I have downloaded it from CPAN and installed it. I am not sure what else I could check. If anyone has an idea, I would appreciate.

Thanks,
AL
Which BIND version are you running and did you implement "zone statistics yes;" in your named.conf (under options) or named.conf.options?
I'm running 9.4 and 9.5 with the new named.stats output and it works just fine. There was a major change to the output from BIND 9.3 to 9.4, keep that in mind.
Different dibstributions bring along different BIND versions. Gentoo for example only provides 9.3.xx if you don't unmask BIND via /etc/portage/package.keywords.

I assume it only works with BIND 9.4 or higher, but that's just a quick guess. I haven't looked into it.


Best regards,
Mike Adolphs
aleu
Cacti User
Posts: 216
Joined: Mon Dec 11, 2006 10:17 am

Post by aleu »

Mike Adolphs wrote:Which BIND version are you running and did you implement "zone statistics yes;" in your named.conf (under options) or named.conf.options?
I am running BIND 9.5. As I have mentioned earlier, it used to work just fine for me. During the latest upgrade perl got upgraded, as well as some permission could have changed. Unfortunately, I am at lost right now and cannot figure out how to debug this further.
h1d
Posts: 3
Joined: Wed May 13, 2009 10:17 pm

Post by h1d »

Does anyone know if this can be used for nsd3 or unbound too?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests