Bind 9: Queries and Zone Statistics

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

Moderators: Developers, Moderators

Tekk
Posts: 34
Joined: Wed Aug 16, 2006 11:01 am
Location: France

Post by Tekk »

Hi everybody,

My cacti and my BIND run on FreeBSD. I added this to my named.conf :

Code: Select all

logging {
        channel query_logging {
                file "/var/stats/query.log";
                print-category yes;
                print-severity yes;
                print-time yes;
        };

        category queries {
                query_logging;
        };
};
The query.log file is created but there is nothing in it. I don't know why... Any idea please ?

Thanks
omoo
Posts: 6
Joined: Sun Aug 27, 2006 12:03 pm

Post by omoo »

Tekk wrote:Hi everybody,

My cacti and my BIND run on FreeBSD. I added this to my named.conf :

Code: Select all

logging {
        channel query_logging {
                file "/var/stats/query.log";
                print-category yes;
                print-severity yes;
                print-time yes;
        };

        category queries {
                query_logging;
        };
};
The query.log file is created but there is nothing in it. I don't know why... Any idea please ?

Thanks
Its probably because you dont have rights to the file. Just remove the path and leave the filename only, it will dump the file on the default named/bind9 directory, a little easier that way.
omoo
Posts: 6
Joined: Sun Aug 27, 2006 12:03 pm

Post by omoo »

I happen to have the same problem, my script is running, i can run the php script manually and get results, also when i run the script as cactiuser it works too. My query.log file is filling up and its 18 MB now, also named.stats is fine and updates every 5 minutes. For some reason my graphs are still empty.

I also get this error whenever my poller runs.....

"Aug 27 13:10:04 Omoo Cacti[27105]: CMDPHP: Host[41] DS[436] WARNING: Result from CMD not valid. Partial Result:
"


Any help please ?
Attachments
graph_image.php.png
graph_image.php.png (37.76 KiB) Viewed 10322 times
Tekk
Posts: 34
Joined: Wed Aug 16, 2006 11:01 am
Location: France

Post by Tekk »

omoo wrote:Its probably because you dont have rights to the file. Just remove the path and leave the filename only, it will dump the file on the default named/bind9 directory, a little easier that way.
Hi omoo,

I tried what you advised me to do, so I put :

Code: Select all

file "query.log";
instead of :

Code: Select all

file "/var/stats/query.log";
But now my query.log file is never created... :(

Can you put your "logging" and "options" parts of your named.conf here please ?

Thanks
omoo
Posts: 6
Joined: Sun Aug 27, 2006 12:03 pm

Post by omoo »

you also need to create the file using "touch"

below is my config.......
logging {
channel query_logging {
file "query.log" size 30m;
print-category yes;
print-severity yes;
print-time yes;
};

category queries {
query_logging;
};
};
omoo
Posts: 6
Joined: Sun Aug 27, 2006 12:03 pm

Post by omoo »

Here is my RRD stuff from the wrench icon....

Code: Select all


/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=1156787280 \
--end=1156830480 \
--title="Unix - DNS Queries" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 2006/08/28 13\:48\:00 To 2006/08/29 01\:48\:00\c" \
COMMENT:"  \n" \
--vertical-label="Requests Per Minute" \
--slope-mode \
DEF:a="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":a:AVERAGE \
DEF:b="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":aaaa:AVERAGE \
DEF:c="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":any:AVERAGE \
DEF:d="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":cname:AVERAGE \
DEF:e="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":mx:AVERAGE \
DEF:f="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":ns:AVERAGE \
DEF:g="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":ptr:AVERAGE \
DEF:h="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":soa:AVERAGE \
DEF:i="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":srv:AVERAGE \
DEF:j="/var/www/html/mrtg/cacti/rra/bind_9_server_txt_436.rrd":txt:AVERAGE \
CDEF:cdefa=a,60,* \
CDEF:cdefe=b,60,* \
CDEF:cdefi=c,60,* \
CDEF:cdefbc=d,60,* \
CDEF:cdefbg=e,60,* \
CDEF:cdefca=f,60,* \
CDEF:cdefce=g,60,* \
CDEF:cdefci=h,60,* \
CDEF:cdefdc=i,60,* \
CDEF:cdefdg=j,60,* \
LINE1:cdefa#FF6044:"A Records"  \
GPRINT:cdefa:LAST:"    Current\:%8.2lf"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf\n"  \
LINE1:cdefe#FF0000:"AAAA Records"  \
GPRINT:cdefe:LAST:" Current\:%8.2lf"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf\n"  \
LINE1:cdefi#F24AC8:"ANY Records"  \
GPRINT:cdefi:LAST:"  Current\:%8.2lf"  \
GPRINT:cdefi:AVERAGE:"Average\:%8.2lf"  \
GPRINT:cdefi:MAX:"Maximum\:%8.2lf\n"  \
LINE1:cdefbc#8D00BA:"CNAME Records"  \
GPRINT:cdefbc:LAST:"Current\:%8.2lf"  \
GPRINT:cdefbc:AVERAGE:"Average\:%8.2lf"  \
GPRINT:cdefbc:MAX:"Maximum\:%8.2lf\n"  \
LINE1:cdefbg#74C366:"MX Records"  \
GPRINT:cdefbg:LAST:"   Current\:%8.2lf"  \
GPRINT:cdefbg:AVERAGE:"Average\:%8.2lf"  \
GPRINT:cdefbg:MAX:"Maximum\:%8.2lf\n"  \
LINE1:cdefca#0D006A:"NS Records"  \
GPRINT:cdefca:LAST:"   Current\:%8.2lf"  \
GPRINT:cdefca:AVERAGE:"Average\:%8.2lf"  \
GPRINT:cdefca:MAX:"Maximum\:%8.2lf\n"  \
LINE1:cdefce#00FF00:"PTR Records"  \
GPRINT:cdefce:LAST:"  Current\:%8.2lf"  \
GPRINT:cdefce:AVERAGE:"Average\:%8.2lf"  \
GPRINT:cdefce:LAST:"Maximum\:%8.2lf\n"  \
LINE1:cdefci#837C04:"SOA Records"  \
GPRINT:cdefci:LAST:"  Current\:%8.2lf"  \
GPRINT:cdefci:AVERAGE:"Average\:%8.2lf"  \
GPRINT:cdefci:LAST:"Maximum\:%8.2lf\n"  \
LINE1:cdefdc#12B3B5:"SRV Records"  \
GPRINT:cdefdc:LAST:"  Current\:%8.2lf"  \
GPRINT:cdefdc:AVERAGE:"Average\:%8.2lf"  \
GPRINT:i:MAX:"Maximum\:%8.2lf\n"  \
LINE1:cdefdg#AFECED:"TXT Records"  \
GPRINT:cdefdg:LAST:"  Current\:%8.2lf"  \
GPRINT:cdefdg:AVERAGE:"Average\:%8.2lf"  \
GPRINT:cdefdg:MAX:"Maximum\:%8.2lf\n" 
Tekk
Posts: 34
Joined: Wed Aug 16, 2006 11:01 am
Location: France

Post by Tekk »

omoo wrote:you also need to create the file using "touch"

below is my config.......
logging {
channel query_logging {
file "query.log" size 30m;
print-category yes;
print-severity yes;
print-time yes;
};

category queries {
query_logging;
};
};
Hi omoo,

Well I don't think it's a rights problem with my query.log file.

My BIND stats file which is in /var/stats directory is created and is updated. I tried with chmod 777 query.log but there's still nothing in it.

I also tried to touch the file manually in my /etc/namedb BIND default directory (I suppose) and put chmod 777 to the query.log file. But query.log is never updated...

Maybe there is a bug in FreeBSD... Have you your BIND running on FreeBSD ?
omoo
Posts: 6
Joined: Sun Aug 27, 2006 12:03 pm

Post by omoo »

Tekk wrote:
omoo wrote:you also need to create the file using "touch"

below is my config.......
logging {
channel query_logging {
file "query.log" size 30m;
print-category yes;
print-severity yes;
print-time yes;
};

category queries {
query_logging;
};
};
Hi omoo,

Well I don't think it's a rights problem with my query.log file.

My BIND stats file which is in /var/stats directory is created and is updated. I tried with chmod 777 query.log but there's still nothing in it.

I also tried to touch the file manually in my /etc/namedb BIND default directory (I suppose) and put chmod 777 to the query.log file. But query.log is never updated...

Maybe there is a bug in FreeBSD... Have you your BIND running on FreeBSD ?
I am using Centos not FreeBSD
mmuse
Posts: 8
Joined: Fri Jan 26, 2007 6:43 pm

Zone Statistics Templates

Post by mmuse »

Can someone upload the Zone Statistics Templates?
kanada
Cacti User
Posts: 137
Joined: Sun Aug 28, 2005 12:51 pm

Post by kanada »

Hi guys,

I get this error when i try to get the graph.
07/24/2006 11:50:03 PM - CMDPHP: Poller[0] Host[2] DS[3] WARNING: Result from CMD not valid. Partial Result:

i run the cmd.php manually. And i get this error.
sh: /var/www/localhost/htdocs/cacti/scripts/unix_dns_queries.php: /usr/bin/php^M: bad interpreter: No such file or directory

How i can fix this problem? Any help is appreciated
In file are windows tags (^M) meaned hard returns/enter's. You must edit this file on linux console and remove it. If you have pico editor, just open this file, change something and write. He will automatic remove this tags.

Greetz,
Alex.
Korigon
Posts: 5
Joined: Tue Jul 26, 2005 7:09 pm

Post by Korigon »

Maybe /usr/local/bin/php ?
asakawa
Posts: 2
Joined: Tue Jul 31, 2007 9:39 pm

Post by asakawa »

Code: Select all

[pts]# ls -l
-rwxr-xr-x  1 root root 1308  8月  1 10:12 unix_dns_queries.php
-rwxr-xr-x  1 root root 1308  8月  1 10:12 unix_named_statistics.php

# php /var/www/cacti/poller.php
: bad interpreter: そのようなファイルやディレクトリはありません/php
CACTID: Host[1] ERROR: Empty result [61.12.46.55]: '/var/www/cacti/scripts/unix_dns_queries.php'
CACTID: Host[1] DS[14] WARNING: Result from SCRIPT not valid. Partial Result: ...

# php /var/www/cacti/scripts/unix_dns_queries.php
Content-type: text/html
X-Powered-By: PHP/4.3.9


a:6 ptr:6 any:1 mx:1 ns:0 cname:0 soa:0 srv:0 aaaa:0 TXT:0 total:14

No such file or directory = そのようなファイルやディレクトリはありません

Dag cacti0.86j
CentOS 2.6.9-55.0.2.ELsmp
Apache 2.0.52
MySQL 4.1.20
PHP PHP 4.3.9

I'll add detailed comment few hour later
Attachments
DNS.gif
DNS.gif (16.74 KiB) Viewed 8917 times
nebula
Posts: 5
Joined: Fri Mar 14, 2008 11:47 am

Post by nebula »

Linuxfreak_be wrote:hi,

That was true and the permissions issues have been relsolved seems like my directorypermissions and the permissions on *.php files where not setup correctly it looks like working now

peace :wink:
What did you fix permission wise?

When I run unix_dns_queries.php

I get...


./unix_dns_queries.php
Content-type: text/html
X-Powered-By: PHP/4.3.9

a:178430 ptr:458 any:44 mx:147317 ns:2176 cname:0 soa:15972
srv:39 aaaa:3049 TXT:0 total:347485


Numbers change as well so it is logging properly...

but on the graphs i get nan!
nebula
Posts: 5
Joined: Fri Mar 14, 2008 11:47 am

Post by nebula »

Anyone?
nebula
Posts: 5
Joined: Fri Mar 14, 2008 11:47 am

Post by nebula »

03/17/2008 10:40:04 AM - CMDPHP: Poller[0] Host[1] DS[11] SERVER: /var/www/cacti/scripts/unix_dns_queries.php, output: U
03/17/2008 10:40:04 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (11, '', '2008-03-17 10:40:01', 'U')"


Another Error!

Any help is appreciated
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests