Anyone have a template for djbdns(dnscache)with dnsstats.pl?
Moderators: Developers, Moderators
Anyone have a template for djbdns(dnscache)with dnsstats.pl?
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.
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.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Anyone have a template for djbdns(dnscache)with dnsstats
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.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.
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
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).
#!/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).
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.
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 (18.02 KiB) Viewed 34970 times
-
- cacti2.gif (24.86 KiB) Viewed 34970 times
-
- cacti3.gif (2.23 KiB) Viewed 34970 times
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
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
djbdns-stats template
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!
-Dave
- Attachments
-
- djbdns-stats_cacti.zip
- The template.
- (10.51 KiB) Downloaded 1204 times
-
- 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 29706 times
Re: djbdns-stats template
---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
-
- Posts: 35
- Joined: Thu Jun 05, 2008 8:53 pm
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
The output seems fine but yet the graph is empty and the rrd file has UNKN values
Could you kindly assist me getting this to work
Thank you
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
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"
Thank you
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.
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 897 times
Who is online
Users browsing this forum: No registered users and 0 guests