I've been meaning to write my own script to pull those stats from bind, but seem to always end up doing something different when i try. Looks great and was easy to add. only thing you may want to add is that if they are using the easy mrtg howto is they will need to add some html to the cfg file too. add this to the html section called pagetop ^
add
- DNS Queries
just before the ending tag. so it looks like this.
.....(cut for space )
- DNS Queries| |
then do service mrtg restart.
nice work.
doug357
Oct 6 2003, 05:58 PM
I am using it and it seems to work great.
JamesC
Oct 6 2003, 09:03 PM
Great how to night-red
It works great just one little catch tho where the pico -w mrtg.cnf It should read pico -w mrtg.cfg
Once I figured that out it worked great be sure to restart mrtg like phatblink said so it can create the logs for it. Also I added the html code that phatblink suggested not sure if it was needed but I did it just to make sure there was a link for it.
Wako
Oct 6 2003, 09:46 PM
I have the following error after running mrtg :
Rateup WARNING: /usr/bin/rateup Can't remove dns.old updating log file
Any idea?
JamesC
Oct 6 2003, 10:43 PM
QUOTE Originally posted by Wako
I have the following error after running mrtg :
Rateup WARNING: /usr/bin/rateup Can't remove dns.old updating log file
Any idea? :)
That happened to me the first time it updated the web stats page but after that it did not happen again that i noticed. But I think I will keep an eye on it and see.
CobaltConn
Oct 6 2003, 10:44 PM
Trying to do some debugging...I think this is problem.
root@bigbird [/etc/mrtg]# /usr/sbin/rndc stats
rndc: connect failed: connection refused
any suggestions?
thanks in advance.
night-red
Oct 7 2003, 12:18 AM
Sorry for the 2 or three mistakes in it, but it keeps you on your feet.
And yes you should restart after like they said. I left out adding a link to it since I do not know how everyone has there mrtg pages created so I wanted it to be universal but very good of you to add it. (I think I just forgot it)
As for this problem.
QUOTE Rateup WARNING: /usr/bin/rateup Can't remove dns.old updating log file
That should happen restart 3 times and it will go away it is just a new log file that it is making and has no data to run on it.
night-red
Oct 7 2003, 12:22 AM
QUOTE Originally posted by CobaltConn
Trying to do some debugging...I think this is problem.
root@bigbird [/etc/mrtg]# /usr/sbin/rndc stats
rndc: connect failed: connection refused
any suggestions?
thanks in advance.
This is created to run with I belive it is Bind 9 (the latest ver) the old setup had a different stats read out and needed a completly different program to run.
In short this only works with bind 9 I belive.
(sorry for one or two blanks in the howto first one.)
Wako
Oct 7 2003, 12:43 AM
QUOTE Originally posted by JamesC
That happened to me the first time it updated the web stats page but after that it did not happen again that i noticed. But I think I will keep an eye on it and see.
Yes, in my situation it is the same, I only saw three errors, but afterward everything is fine.
phenx
Oct 7 2003, 05:42 AM
wonder if we can get gpan to add this to his rpm
CobaltConn
Oct 7 2003, 09:58 AM
I am running Bind9 --any other Ideas?
CobaltConn
Oct 7 2003, 10:04 AM
my original error was:
root@bigbird [~]# rndc: connect failed: connection refused
tail: /var/named/named.stats: No such file or directory
phatblink
Oct 7 2003, 10:21 AM
if your using an ensim box then rndc should already be setup and working correctly. if not then you may have to set it up your self.
Be warned messing with your named.conf can easily mess up your name server and you should probably make a back up of it first.
so are you using ensim or a plain RH box?.
CobaltConn
Oct 7 2003, 02:38 PM
Using CPanel7/RedHat 7.3 ...
phatblink
Oct 7 2003, 03:03 PM
while I could offer you assistance with keys and peices of configs. the issue of rndc not working has already been discussed in the forums for cpanel servers. ( -plus i dont have a cpanel box and would feel bad if i helped break yours)
I can tell you this though.
In the named.conf you need a section that looks like this
##################
key "rndc-key" {
algorithm hmac-md5;
secret "fu91wVAO2dam53RyGBqmvg==";
};
##################
and in your /etc/rndc.conf you need something like this
##################
key "rndc-key" {
algorithm hmac-md5;
secret "fu91wVAO2dam53RyGBqmvg==";
};
options {
default-key "rndc-key";
default-server 127.0.0.1;
default-port 953;
};
##################
and in a file called /etc/rndc.key
##################
key "rndc-key" {
algorithm hmac-md5;
secret "fu91wVAO2dam53RyGBqmvg==";
};
##################
you can do a search in the cpanel section for "rndc" and come up with others who have had the issue, suck as this link below.
http://forum.ev1servers.net/showthread.php...&highlight=rndc
You should be able to get it going with this info. ( you could use the examples above and get it working on most boxes.)
CobaltConn
Oct 7 2003, 03:52 PM
thanks.
CobaltConn
Oct 7 2003, 04:02 PM
Hmm...only thing I was missing (was just blank) was rndc.key
Filled it in with my info--now get this error:
root@bigbird [~]# /usr/sbin/rndc stats
rndc: 'stats' failed: permission denied
any ideas?
thank you so much..
phatblink
Oct 7 2003, 04:09 PM
specify this line in your options section of your named.conf file.
and be sure that the directory /var/named/ exists and is writable by the owner that the name server is running as. usually (named)
statistics-file "/var/named/named.stats";
CobaltConn
Oct 7 2003, 04:10 PM
That was resolved...now:
root@bigbird [~]# /usr/sbin/rndc stats
rndc: connect failed: connection refused
I've got a firewall--but that shouldn't matter through localhost--should it?
CobaltConn
Oct 7 2003, 04:14 PM
Yea I've screwed something up...named is down (which i assume it why connection is refused)
CobaltConn
Oct 7 2003, 04:17 PM
Got it--I think.
/usr/sbin/rndc stats
returns nothing...that good?
CobaltConn
Oct 7 2003, 04:19 PM
root@bigbird [~]# tail /var/named/named.stats
failure 0
--- Statistics Dump --- (1065565188)
+++ Statistics Dump +++ (1065565234)
success 13
referral 0
nxrrset 4
nxdomain 0
recursion 1
failure 0
--- Statistics Dump --- (1065565234)
I'd assume thats good
Thanks for your help. I truly appreciate it.
phatblink
Oct 7 2003, 05:44 PM
glad to help!!
night-red
Oct 7 2003, 08:08 PM
The is the corret output
vagos161182
Aug 27 2009, 04:59 AM
Greetings from sunny(this period) Greece   After a longgg search for a suitable and easy-to-use script for monitoring the DNS server(using mrtg),I found your script. The problem is that it shows me the following errors(when trying to run manually the mrtg with LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok ) Thursday, 27 August 2009 at 12:48: WARNING: Could not get any data from external command '/etc/mrtg/bind.pl' Maybe the external command did not even start. (Illegal seek) Thursday, 27 August 2009 at 12:48: WARNING: Problem with External get '/etc/mrtg/bind.pl': Expected a Number for 'in' but nothing' Thursday, 27 August 2009 at 12:48: WARNING: Problem with External get '/etc/mrtg/bind.pl': Expected a Number for 'out' but nothing' Thursday, 27 August 2009 at 12:48: ERROR: Target[dns][_IN_] ' $target->[4]{$mode} ' did not eval into defined data Thursday, 27 August 2009 at 12:48: ERROR: Target[dns][_OUT_] ' $target->[4]{$mode} ' did not eval into defined data
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
|