Bind 9: Queries and Zone Statistics
Moderators: Developers, Moderators
Bind 9: Queries and Zone Statistics
I will post templates as soon as I get the graphs converted, until then....
You may need to modify the script defaults they assume named.stats is /var/named/named.stats and query.log is /var/named/query.log. You will also need to modify your named.conf to reflect the following changes
logging {
channel query_logging {
file "/var/named/query.log";
print-category yes;
print-severity yes;
print-time yes;
};
category queries {
query_logging;
};
unix_named_statistics.php has no arguments
unix_named_zone_statistics.php will take no arguments or domain name as configured in named.conf i.e. cacti.net If no arguments are specified it will display statistics of cache "." zone.
You may need to modify the script defaults they assume named.stats is /var/named/named.stats and query.log is /var/named/query.log. You will also need to modify your named.conf to reflect the following changes
logging {
channel query_logging {
file "/var/named/query.log";
print-category yes;
print-severity yes;
print-time yes;
};
category queries {
query_logging;
};
unix_named_statistics.php has no arguments
unix_named_zone_statistics.php will take no arguments or domain name as configured in named.conf i.e. cacti.net If no arguments are specified it will display statistics of cache "." zone.
- Attachments
-
- graph_78_1.png (51.81 KiB) Viewed 37281 times
-
- graph_79_1.png (45.85 KiB) Viewed 37281 times
Last edited by Leddy on Tue May 24, 2005 3:57 pm, edited 2 times in total.
Here are the scripts
- Attachments
-
- unix_named_statistics.php.txt
- (1.28 KiB) Downloaded 2255 times
-
- unix_dns_queries.php.txt
- (1.26 KiB) Downloaded 2912 times
Last edited by Leddy on Tue May 24, 2005 9:09 am, edited 1 time in total.
DNS Queries Template
- Attachments
-
- cacti_data_template_unix_dns_queries.xml
- (11.42 KiB) Downloaded 1660 times
-
- cacti_graph_template_unix_dns_queries.xml
- (39.34 KiB) Downloaded 2129 times
I am using bind 9.3.1 and dont exist category statistics.
In logs i receive this:
named.conf.local:27: unknown logging category 'statistics' ignored
BIND 9 Configuration Reference show this categories:
default, general, database, security, config, resolver, xfer-in, xfer-out, notify, client, unmatched, network, update, update-security, queries, dispatch, dnssec, lame-servers and delegation-only.
Nothing about statistics.
Any help ?
In logs i receive this:
named.conf.local:27: unknown logging category 'statistics' ignored
BIND 9 Configuration Reference show this categories:
default, general, database, security, config, resolver, xfer-in, xfer-out, notify, client, unmatched, network, update, update-security, queries, dispatch, dnssec, lame-servers and delegation-only.
Nothing about statistics.
Any help ?
You are absolutely correct. It looks like "statistics" is deprecated as of bind 9. It is not needed as we are only concerned with queries. I'll modify original post to reflect that.
piccilli wrote:I am using bind 9.3.1 and dont exist category statistics.
In logs i receive this:
named.conf.local:27: unknown logging category 'statistics' ignored
BIND 9 Configuration Reference show this categories:
default, general, database, security, config, resolver, xfer-in, xfer-out, notify, client, unmatched, network, update, update-security, queries, dispatch, dnssec, lame-servers and delegation-only.
Nothing about statistics.
Any help ?
I think you might be able to do it over SNMP if you use the exec part of the snmpd.conf
Here's the comments in mine
So probably you could use
exec .1.3.6.1.4.1.2021.51 DNSQuery /path/to/file.php
This might have to be done as a shell script which just contains
so that it can execute it instead.
Please note I haven't tested it yet!!! But I'll gladly help out anyone that does.
-P
Here's the comments in mine
Code: Select all
###############################################################################
# Extensible sections.
#
# This alleviates the multiple line output problem found in the
# previous executable mib by placing each mib in its own mib table:
# Run a shell script containing:
#
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
#
# Note: this has been specifically commented out to prevent
# accidental security holes due to someone else on your system writing
# a /tmp/shtest before you do. Uncomment to use it.
#
# exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest
# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.50
# enterprises.ucdavis.50.1.1 = 1
# enterprises.ucdavis.50.2.1 = "shelltest"
# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
# enterprises.ucdavis.50.100.1 = 35
# enterprises.ucdavis.50.101.1 = "hello world."
# enterprises.ucdavis.50.101.2 = "hi there."
# enterprises.ucdavis.50.102.1 = 0
# Now the Output has grown to two lines, and we can see the 'hi
# there.' output as the second line from our shell script.
#
# Note that you must alter the mib.txt file to be correct if you want
# the .50.* outputs above to change to reasonable text descriptions.
# Other ideas:
#
# exec .1.3.6.1.4.1.2021.51 ps /bin/ps
# exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top
# exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq
exec .1.3.6.1.4.1.2021.51 DNSQuery /path/to/file.php
This might have to be done as a shell script which just contains
Code: Select all
#!/bin/sh
/path/to/phpcommandline /path/to/file.php
Please note I haven't tested it yet!!! But I'll gladly help out anyone that does.
-P
uname -a
unlike mailgraph.pl for postfix log grapher
i assume this php script is counting the output of query log ..entirely..
we need to rotate that log file every minute to gain fast log check and fast snmp trapping with this script (with my query log for 5 minutes containing 35MBytes of file).
mailgraph.pl script is counting log check and pass it to another file continously with daemon mode. So that other file can be read real time with other script that snmpd.conf put into.
It would be great if there is a new update about the script for query zone statistics with this kind of query logging
we need to rotate that log file every minute to gain fast log check and fast snmp trapping with this script (with my query log for 5 minutes containing 35MBytes of file).
mailgraph.pl script is counting log check and pass it to another file continously with daemon mode. So that other file can be read real time with other script that snmpd.conf put into.
It would be great if there is a new update about the script for query zone statistics with this kind of query logging
-
- Posts: 22
- Joined: Sun Sep 04, 2005 3:30 am
- Location: Belgium
hi people,
i'm using this and i have a little problem.The graph is created but it stays blank.I have successfully configurerd bind for the logging thing and if i run the script from the command line i get a correct result my question is why on earth does that graph stays blank ? my log shows several dns queries
i'm using this and i have a little problem.The graph is created but it stays blank.I have successfully configurerd bind for the logging thing and if i run the script from the command line i get a correct result my question is why on earth does that graph stays blank ? my log shows several dns queries
- Attachments
-
- dns_queries.png (9.89 KiB) Viewed 35766 times
Few things to try. Turn on debug level in cacti and see if you are getting a result or "U". Make sure the user running the poller.ph has permissions to read the query.log. Chances are you are testing with "root" and running cmd.php with "cactiuser".i'm using this and i have a little problem.The graph is created but it stays blank.I have successfully configurerd bind for the logging thing and if i run the script from the command line i get a correct result my question is why on earth does that graph stays blank ? my log shows several dns queries
Those would be the 2 most common reasons
-
- Posts: 22
- Joined: Sun Sep 04, 2005 3:30 am
- Location: Belgium
yes tat's true on my shell i run it with root and the poller is running under th cacti user now how to change thatLeddy wrote:Few things to try. Turn on debug level in cacti and see if you are getting a result or "U". Make sure the user running the poller.ph has permissions to read the query.log. Chances are you are testing with "root" and running cmd.php with "cactiuser".i'm using this and i have a little problem.The graph is created but it stays blank.I have successfully configurerd bind for the logging thing and if i run the script from the command line i get a correct result my question is why on earth does that graph stays blank ? my log shows several dns queries
Those would be the 2 most common reasons
-
- Posts: 22
- Joined: Sun Sep 04, 2005 3:30 am
- Location: Belgium
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.
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.
Who is online
Users browsing this forum: No registered users and 4 guests