Anyone have a template for djbdns(dnscache)with dnsstats.pl?

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

Moderators: Moderators, Developers

Post Reply
Author
Message
Buckbeak
Posts: 14
Joined: Tue Nov 15, 2005 8:57 am

Anyone have a template for djbdns(dnscache)with dnsstats.pl?

#1 Post by Buckbeak » Fri Dec 16, 2005 3:11 pm

I'm using Jeremy Kister's dnsstats tool at:

http://jeremy.kister.net/code/djbdns-stats/

I've got the everything setup on the dns server, and snmpd is presenting the data in one OID like this:

A:80 NS:0 CNAME:0 SOA:33 PTR:3 MX:4 TXT:0 AAAA:0 SRV:1 NAPTR:0 A6:0 IXFR:0 AXFR:0 ANY:0 effectiveness:109 other:0 total:121

I need to parse the data somehow in cacti, but don't know how.

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Anyone have a template for djbdns(dnscache)with dnsstats

#2 Post by gandalf » Fri Dec 16, 2005 4:38 pm

Buckbeak wrote:A:80 NS:0 CNAME:0 SOA:33 PTR:3 MX:4 TXT:0 AAAA:0 SRV:1 NAPTR:0 A6:0 IXFR:0 AXFR:0 ANY:0 effectiveness:109 other:0 total:121

I need to parse the data somehow in cacti, but don't know how.
Well, to be honest, you won't need any parsing in cacti cause this is _exactly_ the format cacti requires (never seen that before). You may define a simple one-liner that queries this OID and returns the string literally. Define a Data Input Method that refers to that one liner and define an output var for each value A, NS, CNAME etc. you want to have.
Then, it goes as usual
- define a Data Template for storing all wanted readings
- define a Graph Template for presentating the readings
Associate the Graph Template to your device (directly or indirectly using a Host Template)
Reinhard

Buckbeak
Posts: 14
Joined: Tue Nov 15, 2005 8:57 am

#3 Post by Buckbeak » Mon Dec 19, 2005 2:35 pm

I simple one liner what? Can you be more specific? I'm brand new to Cacti.

Buckbeak
Posts: 14
Joined: Tue Nov 15, 2005 8:57 am

#4 Post by Buckbeak » Tue Dec 20, 2005 9:46 am

Here's what I came up with in case anyone else needs it:

#!/bin/sh

/usr/local/bin/snmpget -v1 -Ovqa -c communityname $1 .1.3.6.1.4.1.18689.0.1.3.1.1.14.100
.110.115.99.97.99.104.101.45.115.116.97.116.115 | sed 's/"//;s/"$//'


The last bit chops off the quotes at the beginning and end.
The OID is one continuous string (the message board is splitting it up).

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#5 Post by gandalf » Tue Dec 20, 2005 1:23 pm

Congratulations!
Did you make it with the other steps? If not, please post.
Reinhard

Buckbeak
Posts: 14
Joined: Tue Nov 15, 2005 8:57 am

#6 Post by Buckbeak » Tue Dec 20, 2005 4:41 pm

I'm making progress, but still no go.

I've created an input method, (shown below), and a data source with multiple data source items, but the graphs aren't working and the correct rrd file is not even in the rra directory. I have been able to get the graph working with a single datasource item (A), but not with multiple items. It's strange that the datasource appear to be created but there is no rrd file.
Attachments
cacti1.gif
cacti1.gif (18.02 KiB) Viewed 31593 times
cacti2.gif
cacti2.gif (24.86 KiB) Viewed 31593 times
cacti3.gif
cacti3.gif (2.23 KiB) Viewed 31593 times

Buckbeak
Posts: 14
Joined: Tue Nov 15, 2005 8:57 am

#7 Post by Buckbeak » Tue Dec 20, 2005 5:02 pm

one more...
Attachments
cacti4.gif
cacti4.gif (13.2 KiB) Viewed 31590 times

giovanni
Posts: 17
Joined: Sat May 20, 2006 8:06 pm

#8 Post by giovanni » Wed May 31, 2006 6:44 pm

Working great on gentoo linux!!!

jkister
Posts: 1
Joined: Tue Sep 11, 2007 8:40 pm

#9 Post by jkister » Tue Sep 11, 2007 8:46 pm

Funny as it may sound, I created djbdns-stats to work with cacti, but I haven't a clue how to configure cacti for it.

I've created simple objects in cacti, but haven't the first clue on how to efficiently integrate the djbdns stats.

Can someone give me a step-by-step (every needed click) to get cacti polling a host with djbdns-stats ?

I will include the howto along with credit in an upcoming release of djbdns-stats.

Thanks,

Jeremy

User avatar
eecue
Posts: 27
Joined: Thu Nov 07, 2002 7:11 pm
Location: Los Angeles, CA USA
Contact:

djbdns-stats template

#10 Post by eecue » Sun Jun 15, 2008 1:05 pm

I have created a template for graphing all of the data returned by the excellent djbdns-stats scripts. Please let me know if you have any questions.

Thanks!

-Dave
Attachments
djbdns-stats_cacti.zip
The template.
(10.51 KiB) Downloaded 898 times
graph_image.php.png
A screenshot (I just got it working so not much data, but you get the idea. Also I need to make the colors prettier. =]
graph_image.php.png (57.85 KiB) Viewed 26329 times

byunique
Posts: 1
Joined: Thu Aug 21, 2008 2:01 pm

Re: djbdns-stats template

#11 Post by byunique » Thu Aug 21, 2008 2:14 pm

eecue wrote:I have created a template for graphing all of the data returned by the excellent djbdns-stats scripts. Please let me know if you have any questions.

Thanks!

-Dave
---

Thanks again for the template, that saved a lot of work. I think I found a problem with the djbdns-stats.sh script though.

Your query within that script,
/usr/local/bin/snmpget -v1 -Oaqv -c public $1 .1.3.6.1.4.1.18689.1.2.3.1.1.13.116.105.110.121.100.110.115.45.115.116.97.116.115 | sed 's/"//;s/"$//'

returned:

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: SNMPv2-SMI::enterprises.18689.1.2.3.1.1.13.116.105.110.121.100.110.115.45.115.116.97.116.115

The prior snmget that BuckBeak did prior on this page worked fine.
#!/bin/sh

/usr//bin/snmpget -v1 -Ovqa -c communityname $1 .1.3.6.1.4.1.18689.0.1.3.1.1.14.100.110.115.99.97.99.104.101.45.115.116.97.116.115 | sed 's/"//;s/"$//'

returned:
A:5187 NS:0 CNAME:0 SOA:0 PTR:55 MX:7 TXT:0 AAAA:480 SRV:0 NAPTR:0 A6:0 IXFR:0 AXFR:0 ANY:0 effectiveness:190 other:0 total:5729

ps. I am on a Redhat Clone

SecuringStuff
Posts: 35
Joined: Thu Jun 05, 2008 8:53 pm

#12 Post by SecuringStuff » Sat Feb 07, 2009 6:21 am

Hi Everyone,

I am trying to get this script to work. It is currently configured on the DNS server and running the stat script gives me the following output

Code: Select all

# sh /var/www/html/scripts/djbdns-stats.sh the-dns
A:1 NS:5 ME:0 SOA:0 PTR:0 MX:0 TXT:120 AAAA:0 SRV:0 NAPTR:0 A6:0 IXFR:0 AXFR:0 ANY:0 effectiveness:0 other:0 total:130
The output seems fine but yet the graph is empty and the rrd file has UNKN values

Code: Select all

rrd_version = "0003"
step = 60
last_update = 1234004832
ds[tinydns_A].type = "GAUGE"
ds[tinydns_A].minimal_heartbeat = 120
ds[tinydns_A].min = 0.0000000000e+00
ds[tinydns_A].max = 1.0000000000e+04
ds[tinydns_A].last_ds = "UNKN"
ds[tinydns_A].value = 0.0000000000e+00
ds[tinydns_A].unknown_sec = 12
ds[tinydns_NS].type = "GAUGE"
ds[tinydns_NS].minimal_heartbeat = 120
ds[tinydns_NS].min = 0.0000000000e+00
ds[tinydns_NS].max = 1.0000000000e+04
ds[tinydns_NS].last_ds = "UNKN"
Could you kindly assist me getting this to work

Thank you

pbroyce
Posts: 5
Joined: Wed Apr 04, 2007 10:31 am

#13 Post by pbroyce » Wed Feb 24, 2010 1:21 pm

Thanks for all the input which got me going.
If you're on CentOS 5.4 with 5.3 net-snmp, then this will work for you and it is working for me.

It seems to me that with different version of net-snmp, you will likely have to tweak the OID in /etc/snmp/snmpd.conf.
Attachments
cacti-djbdns.tar.gz
tinydns & dnscache template.
(7.34 KiB) Downloaded 591 times

Post Reply