BIND 8/9 based DNS monitoring

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

Moderators: Developers, Moderators

User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

try this

Post by egarnel »

snmpwalk -v 1 -c COMM HOST .1.3.6.1.4.1.2021.55

use version 1 instead of 2
Guest

Re: try this

Post by Guest »

egarnel wrote:snmpwalk -v 1 -c COMM HOST .1.3.6.1.4.1.2021.55

use version 1 instead of 2
I've run that command, without any output. But when I ran it in Cacti (after setting the SNMP version in "device" to 1), I'd got this:

Code: Select all

+ Running data query [11].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/www/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'
+ Located input field 'bindIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2021.55.1'
+ Located input field 'bindName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2021.55.2'
And when I ran it again (5 sec. later) I'd got this:

Code: Select all

+ Running data query [11].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/www/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
While the named.stats file contains 62 lines ... (10 different domains/groups)

I'll start all over again, and let it know if something has changed...

Greetz.
RattleSn@ke
Posts: 17
Joined: Tue Aug 10, 2004 5:44 pm

Sorry

Post by RattleSn@ke »

Sorry, forgot my name in the message above ...

It was my message.

Greetz,
RattleSn@ke.
RattleSn@ke
Posts: 17
Joined: Tue Aug 10, 2004 5:44 pm

Local works

Post by RattleSn@ke »

Ok, i've finally got the 'local' version working.

Now i need to try the 'remote' (snmp) version get working.
Any help is really appriciated !!

Greetz.
RattleSn@ke.
Guest

Post by Guest »

RattleSn@ke wrote:Damn ... I still can't figure out why it won't work ...

I placed this in snmpd.conf

Code: Select all

pass .1.3.6.1.4.1.2021.55 /usr/bin/perl /custom/bin/bind9-stats-snmpd.pl
And when I then restart snmpd and run this command:

Code: Select all

snmpwalk -v 2c -c COMM HOST .1.3.6.1.4.1.2021.55
I get this as result ...:

Code: Select all

UCD-SNMP-MIB::ucdavis.55 = No Such Instance currently exists at this OID
Somebody any idea whats going wrong?

Thanks.

Greetz.
I have a similar problem. I cannot, for the life of me get snmp to return values even though all the scripts run fine independently.

Code: Select all

pass .1.3.6.1.4.1.2021.55 /usr/bin/perl /var/named/scripts/bind9-stats-snmpd.pl

Code: Select all


[root@ns1 scripts]# snmpwalk -v2c -c myRoCommunity 127.0.0.1 .1.3.6.1.4.1.2021.55
UCD-SNMP-MIB::ucdavis.55.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.55.2.1 = STRING: "GLOBAL"


User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

that was me :/

here's the v1 output just to show it makes no diff

snmpwalk -v1 -c toto 127.0.0.1 .1.3.6.1.4.1.2021.55
UCD-SNMP-MIB::ucdavis.55.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.55.2.1 = STRING: "GLOBAL"
Last edited by Morgan on Tue Aug 29, 2006 8:42 am, edited 1 time in total.
RattleSn@ke
Posts: 17
Joined: Tue Aug 10, 2004 5:44 pm

Post by RattleSn@ke »

Hi Morgan,

It's almost funny, since you already get more info out of snmp than me!

In my earlier post I said that the local version worked ... well, didn't think so ... I even can't get the damn local version to work ....

Code: Select all

perl /www/cacti/scripts/bind9-stats.pl index
lists the domains nicely, but when I run:

Code: Select all

perl /www/cacti/scripts/bind9-stats.pl query zone
it displays things like this:

Code: Select all

GLOBAL:GLOBAL
domainA:domainA
domainB:domainB
is that correct?

When I manually run for example:

Code: Select all

perl /www/cacti/scripts/bind9-stats.pl getall GLOBAL
it returns the right data:

Code: Select all

recursion:2214 success:29570 failure:13 nxrrset:1020 referral:0 nxdomain:6100
So has ANYone ANY idea whats going wrong?

Thank you.
muh

Post by muh »

I'm seeing exactly the same outputs here and all graphs are coming up with nan :(

would really like to get this working
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

i can't seem to get it to work. i keep tryign and trying and it doesnt get me anywhere.

:/
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

ok enough complicated scripts.
bash is your friend

step 1

add the following to your snmpd.conf

Code: Select all

exec .1.3.6.1.4.1.2021.50 /bin/bash /var/named/scripts/test.sh
replace with your path to bash and your path to the script you're goign to create below.


step 2

create the script!!!

Code: Select all


#!/bin/sh
#
#
rm /var/named/stats/named.stats
/usr/sbin/rndc stats
cat /var/named/stats/named.stats | grep -v Statistics | awk '{ print $2 }'


again, change the paths for your stats file, your and your rndc

step 3

kill -HUP of your snmpd process

step 4

Code: Select all

snmpwalk -v2c -c community serverip  .1.3.6.1.4.1.2021.50
UCD-SNMP-MIB::ucdavis.50.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.2.1 = STRING: "/bin/bash"
UCD-SNMP-MIB::ucdavis.50.3.1 = STRING: "/var/named/scripts/test.sh"
UCD-SNMP-MIB::ucdavis.50.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.50.101.1 = STRING: "64273"
UCD-SNMP-MIB::ucdavis.50.101.2 = STRING: "67"
UCD-SNMP-MIB::ucdavis.50.101.3 = STRING: "2541"
UCD-SNMP-MIB::ucdavis.50.101.4 = STRING: "22163"
UCD-SNMP-MIB::ucdavis.50.101.5 = STRING: "1814"
UCD-SNMP-MIB::ucdavis.50.101.6 = STRING: "589471"
UCD-SNMP-MIB::ucdavis.50.102.1 = INTEGER: 0


over and done with, now on to doing the cacti work.


ps: bash, grep and awk = friends

Morgan
rgordey
Posts: 7
Joined: Thu Sep 02, 2004 12:34 pm

Post by rgordey »

Greetings All

This script is running fine on Fedora Core2 and is in my crontab as:
*/5 * * * * /usr/local/bind9-genstats.sh > /dev/null 2>&1

I get this from running the local script, everything seems ok...

[root@host bin]# /root/bind9-stats.pl index
GLOBAL
my-domain.com
1.168.192.in-addr.arpa
localhost

But, I get nada from the snmp version of the script run locally... (I am wanting to check this server via snmp - remote)

[root@host bin]# ./bind9-stats-snmpd.pl .1.3.6.1.4.1.2021.55
[root@host bin]#

Anybody care to point me in a reasonable direction?

Thanks in advance. Forgive my ignorance please.


Kind Regards,
Randy Gordey
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

RattleSn@ke wrote:Damn ... I still can't figure out why it won't work ...

....

Code: Select all

UCD-SNMP-MIB::ucdavis.55 = No Such Instance currently exists at this OID
Somebody any idea whats going wrong?

Thanks.
I had this problem last night on two Solaris 8 servers. The solution was to upgrade to the latest version of net-snmp.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
ilja

net-snmp 5.1.1 pass timeout

Post by ilja »

Hi,

Apparently, net-snmp 5.1.1 has problems with pass timeout.

I was able to reproduce this timeout problem by adding a simple "sleep 1" to my pass script.

Ilja
UKStroller

Post by UKStroller »

I've managed to get the display-bindstats.pl and dns_stats.pl scripts to work and pull DNS stats from a remote box running BIND 9 on RedHat 5. However when I try to run the same thing to another box also running BIND 9 on RedHat 5 i just get End of MIB returned.

Any ideas why this might be happening?????
Guest

Post by Guest »

I know this is a slightly old thread, but I'm having some problems with the script as well.

The data seems to return fine when using the bind9-stats.pl script manually, and the stat generation script is running perfectly in crontab, and the poller seems to be working (all my other graphs are fine.)

But my bind graphs continue to show nothing but nan as values.

Any suggestions or insight?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests