BIND 9 Statistics for Cacti

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

Moderators: Developers, Moderators

Post Reply
cpowers
Posts: 2
Joined: Mon Jan 05, 2004 12:11 pm

BIND 9 Statistics for Cacti

Post by cpowers »

I have created an addon that will enable Cacti to create graphs on BIND 9 statistics. This package can be setup to retrieve the statistics remotely via SNMP or locally via a script.

I have provided complete instructions and Cacti templates in the package so installation is very easy.

You can download the package at http://uversaconsulting.net/download/bi ... 1.0.tar.gz

Please provide any feedback to me directly at cory@uversaconsulting.net
mneddy
Posts: 4
Joined: Fri Feb 13, 2004 3:17 pm

RH 9 fails to show any graphs

Post by mneddy »

Hello guys, has anyone got it working on RH 9 with Perl 5.8.0
I spoke to the guy who made the script and he said that the problem reported with the version of Perl that RH 9 is using. For me to upgrade 12 servers to the Perl 5.8.0 would be a huge hasle. Please reply to mneddy@REMOVEkleyn.net with any suggestions.
Thank you
mneddy
Posts: 4
Joined: Fri Feb 13, 2004 3:17 pm

No replies?

Post by mneddy »

Hmm, seems like nobody is using that addon with RH 9 or RHEL 3.
shorvath

Bind and dodgy perl version...

Post by shorvath »

Does anyone have a solution here.
This is the first reasonably straight forward solution I have seen for graphing bind with SNMP. It is a pity that this is the cause....
skol
Posts: 41
Joined: Mon Nov 10, 2003 3:06 pm

much better bind9 graphing solution

Post by skol »

just use a script that parses the output of rndc stats which dumps the named.stats file.

Code: Select all

#!/bin/bash

if [ -z "$2" ] ; then 
        echo "usage: $0 [nameserver] [request type]"
        exit 1
fi

> /var/named.$1/named.stats

# get the last octect of the loopback interface for the specified
# nameserver
DIRECTORY=`grep directory /etc/named.$1.conf | perl -pe 's/^.*directory (.*);$/$1/'`
LOIFLASTOCT=`grep 'inet 127\.0\.0' /etc/named.$1.conf  | perl -pe 's/^.*inet 127\.0\.0\.([0-9]+) .*$/$1/'`
LOIF="127.0.0.$LOIFLASTOCT"

# zero out any old stats files
rm -f $DIRECTORY/named.stats

# generate new stats
/usr/sbin/rndc -s $LOIF stats

grep "^$2 " /var/named.$1/named.stats | perl -pe 's/^.* ([0-9]+)$/$1/'
But, you'll have to modifiy it some to fit your architecture, and you can use the exec function of /etc/snmp.conf to query the script :

Code: Select all

exec .1.3.6.1.4.1.15102.1.2.1.3.3.1 ns /usr/share/snmp/plugins/namestats ns success
exec .1.3.6.1.4.1.15102.1.2.1.3.3.2 ns /usr/share/snmp/plugins/namestats ns referral
exec .1.3.6.1.4.1.15102.1.2.1.3.3.3 ns /usr/share/snmp/plugins/namestats ns nxrrset
exec .1.3.6.1.4.1.15102.1.2.1.3.3.4 ns /usr/share/snmp/plugins/namestats ns nxdomain
exec .1.3.6.1.4.1.15102.1.2.1.3.3.5 ns /usr/share/snmp/plugins/namestats ns recursion
exec .1.3.6.1.4.1.15102.1.2.1.3.3.6 ns /usr/share/snmp/plugins/namestats ns failure
exec .1.3.6.1.4.1.15102.1.2.1.3.3.7 ns /usr/share/snmp/plugins/namestats ns query-a
exec .1.3.6.1.4.1.15102.1.2.1.3.3.8 ns /usr/share/snmp/plugins/namestats ns query-ns
exec .1.3.6.1.4.1.15102.1.2.1.3.3.9 ns /usr/share/snmp/plugins/namestats ns query-cname
exec .1.3.6.1.4.1.15102.1.2.1.3.3.10 ns /usr/share/snmp/plugins/namestats ns query-soa
again this was not wrote for everyone's network... so you'll have to fix it.
mneddy
Posts: 4
Joined: Fri Feb 13, 2004 3:17 pm

Re: Bind and dodgy perl version...

Post by mneddy »

Recompiled Perl to 5.8.0 and everything works perfectly.
shorvath wrote:Does anyone have a solution here.
This is the first reasonably straight forward solution I have seen for graphing bind with SNMP. It is a pity that this is the cause....
shorvath

Perl 5.8.0

Post by shorvath »

Sorry, I don't follow.
I thought you said you had 5.8.0 installed and it didn't work.

I am using perl-5.8.0-88.3 on redhat 9 and it definitly doesn't work
When doing an snmpwalk all I get is the following:

UCD-SNMP-MIB::ucdavis.55.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.55.2.1 = STRING: "GLOBAL"
Thats it...
I would REALLY like to get this working
User avatar
Khan
Posts: 48
Joined: Mon Nov 03, 2003 11:08 am
Location: Madtown, WI

Re: BIND 9 Statistics for Catci

Post by Khan »

cpowers wrote:I have created an addon that will enable Cacti to create graphs on BIND 9 statistics. This package can be setup to retrieve the statistics remotely via SNMP or locally via a script.

I have provided complete instructions and Cacti templates in the package so installation is very easy.

You can download the package at http://uversaconsulting.net/download/bi ... 1.0.tar.gz

Please provide any feedback to me directly at cory@uversaconsulting.net
Does anyone have a copy of this addon that they can upload here? I can't get a hold of Cory and the website is not responding. Thanks.
skol
Posts: 41
Joined: Mon Nov 10, 2003 3:06 pm

Re: BIND 9 Statistics for Catci

Post by skol »

Khan wrote:
cpowers wrote:I have created an addon that will enable Cacti to create graphs on BIND 9 statistics. This package can be setup to retrieve the statistics remotely via SNMP or locally via a script.

I have provided complete instructions and Cacti templates in the package so installation is very easy.

You can download the package at http://uversaconsulting.net/download/bi ... 1.0.tar.gz

Please provide any feedback to me directly at cory@uversaconsulting.net
Does anyone have a copy of this addon that they can upload here? I can't get a hold of Cory and the website is not responding. Thanks.
Attachments
bind9-stats-1.0.tar.gz
(10.53 KiB) Downloaded 11687 times
User avatar
Khan
Posts: 48
Joined: Mon Nov 03, 2003 11:08 am
Location: Madtown, WI

Post by Khan »

Thanks, skol.
kalto

Post by kalto »

Well, just wanted to say that it's a great addon you made... it went quite well for me on one machine, but i can't get it to work on the other :P

I'm getting the data via snmp.
On machine 1 it works well, it's a FreeBSD 4.9 running a port made net-snmp.
On machine 2 tough, i can't get the data at all, it's a Slackware 9.1 running a compiled from source net-snmp.

I did everything the same on machine 1 and on machine 2, as i said, everything works fine on machine 1, but i get this on machine 2:

# snmpwalk -v 2c -c my_community_name machine_2 .1.3.6.1.4.1.2021.55
UCD-SNMP-MIB::ucdavis.55 = No Such Instance currently exists at this OID
(where my_community_name is what it says...)

I've checked everything i could think of... the crontab... files permission... snmpd.conf... i also did a "cat /usr/local/share/snmp/mibs/* | grep ucdavis" on both host to see if there was a difference between the mibs and there was none...

# snmpwalk -v 2c -c my_community_name machine_1 .1.3.6.1.4.1.2021
and
# snmpwalk -v 2c -c my_community_name machine_2 .1.3.6.1.4.1.2021
reports some difference, the most remarkable one being the fact that my bind stats aren't reported on machine 2....

both machine use perl 5.8.0

any1 got any clue? i'm kinda helpless...
bpenland

Post by bpenland »

I've been able to get the configuration setup for SNMP and am able to query the data through SNMPwalk. I am not able to get the configuration together in Cacti though. It seems as though my data source is never added to the poller to have data gathered.

I'm running cacti 0.8.5a.

Any help is appreciated.
cacti_newbie

Almost working!

Post by cacti_newbie »

Hello all,

I've managed to get everything working pretty much, but my graph is not showing any data - I can see that SNMP is working ok and rrds are being created / updated.

I'm running Redhat 9 with bind 9.2.1 and Perl 5.8.0 on my name server.

My Cacti server is Fedora Core 1 with Perl 5.8.3 and Cacti 0.8.5a.

I'm a newbie when it comes to Cacti - I only just heard of it yesterday. When snmpwalking, I also only get two values returned (like shorvath) - could this be why the graph is empty?

Any suggestions would be much appreciated! I've attached the graph that is generated.
Attachments
This is my BIND graph
This is my BIND graph
graph_image.php.png (3.69 KiB) Viewed 159920 times
kiko84
Posts: 15
Joined: Mon May 17, 2004 4:06 am

Zone : GLOBAL

Post by kiko84 »

hi,


I have just installed bin9 for Cacti. To generate the graph, there is a field that I don't understand:

Zone : GLOBAL ??

I have tried with the GLOBAL name nut I have no graph, "nan" in all legends.

Somebody can help me please ?

Regards.
Guest

Post by Guest »

I'm having some strange issues with SNMP..

once in a while i'll get the full read out with snmpwalk, but most of the time i just get an abbreviated one:

oberon:/usr/bin# snmpwalk -Os -v 1 -c community localhost .1.3.6.1.4.1.2021.55
ucdavis.55.1.1 = INTEGER: 1
ucdavis.55.2.1 = STRING: "GLOBAL"
ucdavis.55.3.1 = INTEGER: 109
ucdavis.55.4.1 = INTEGER: 0
ucdavis.55.5.1 = INTEGER: 15

any idea why this could be happening?
is this an issue with my snmpd setup?
-d
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest