Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Bind 9: Queries and Zone Statistics
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
Leddy
Cacti User


Joined: 15 May 2005
Posts: 67

PostPosted: Mon May 23, 2005 9:00 pm    Post subject: Bind 9: Queries and Zone Statistics Reply with quote

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.



graph_79_1.png
 Description:
 Filesize:  45.85 KB
 Viewed:  20880 Time(s)

graph_79_1.png



graph_78_1.png
 Description:
 Filesize:  51.81 KB
 Viewed:  20880 Time(s)

graph_78_1.png




Last edited by Leddy on Tue May 24, 2005 3:57 pm; edited 2 times in total
Back to top
Leddy
Cacti User


Joined: 15 May 2005
Posts: 67

PostPosted: Mon May 23, 2005 9:04 pm    Post subject: Reply with quote

Here are the scripts


unix_dns_queries.php.txt
 Description:

Download
 Filename:  unix_dns_queries.php.txt
 Filesize:  1.28 KB
 Downloaded:  1762 Time(s)


unix_named_statistics.php.txt
 Description:

Download
 Filename:  unix_named_statistics.php.txt
 Filesize:  1.28 KB
 Downloaded:  1348 Time(s)



Last edited by Leddy on Tue May 24, 2005 9:09 am; edited 1 time in total
Back to top
Leddy
Cacti User


Joined: 15 May 2005
Posts: 67

PostPosted: Mon May 23, 2005 9:06 pm    Post subject: Reply with quote

DNS Queries Template


cacti_graph_template_unix_dns_queries.xml
 Description:

Download
 Filename:  cacti_graph_template_unix_dns_queries.xml
 Filesize:  39.34 KB
 Downloaded:  1350 Time(s)


cacti_data_template_unix_dns_queries.xml
 Description:

Download
 Filename:  cacti_data_template_unix_dns_queries.xml
 Filesize:  11.42 KB
 Downloaded:  1016 Time(s)

Back to top
Leddy
Cacti User


Joined: 15 May 2005
Posts: 67

PostPosted: Tue May 24, 2005 9:13 am    Post subject: Reply with quote

Reserved for Zone Statistics Templates
Back to top
piccilli



Joined: 24 May 2005
Posts: 5

PostPosted: Tue May 24, 2005 2:13 pm    Post subject: Reply with quote

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 ?
Back to top
Leddy
Cacti User


Joined: 15 May 2005
Posts: 67

PostPosted: Tue May 24, 2005 3:56 pm    Post subject: Reply with quote

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 ?
Back to top
aleto



Joined: 25 May 2005
Posts: 37

PostPosted: Wed May 25, 2005 3:58 am    Post subject: Reply with quote

Hi!

Does anyone have any information or HOWTO's on howto implement this over SNMP ?

Thnx in advance!
Back to top
pbulteel
Cacti User


Joined: 05 Sep 2003
Posts: 150
Location: London

PostPosted: Fri May 27, 2005 6:51 am    Post subject: Reply with quote

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

Code:

###############################################################################
# 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


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

Code:

#!/bin/sh
/path/to/phpcommandline /path/to/file.php


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
Back to top
irfandp



Joined: 27 Jun 2005
Posts: 11

PostPosted: Thu Aug 18, 2005 7:09 am    Post subject: unlike mailgraph.pl for postfix log grapher Reply with quote

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
Back to top
Linuxfreak_be



Joined: 04 Sep 2005
Posts: 22
Location: Belgium

PostPosted: Mon Sep 05, 2005 2:25 am    Post subject: Reply with quote

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



dns_queries.png
 Description:
 Filesize:  9.89 KB
 Viewed:  19365 Time(s)

dns_queries.png


Back to top
Leddy
Cacti User


Joined: 15 May 2005
Posts: 67

PostPosted: Mon Sep 05, 2005 2:38 pm    Post subject: Reply with quote

Quote:

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


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".

Those would be the 2 most common reasons
Back to top
Linuxfreak_be



Joined: 04 Sep 2005
Posts: 22
Location: Belgium

PostPosted: Tue Sep 06, 2005 7:04 am    Post subject: Reply with quote

Leddy wrote:
Quote:

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


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".

Those would be the 2 most common reasons


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 that
Back to top
Linuxfreak_be



Joined: 04 Sep 2005
Posts: 22
Location: Belgium

PostPosted: Fri Sep 09, 2005 9:13 am    Post subject: Reply with quote

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



dns_queries_fixed.png
 Description:
 Filesize:  11.63 KB
 Viewed:  19001 Time(s)

dns_queries_fixed.png


Back to top
akashah



Joined: 29 May 2006
Posts: 29
Location: Malaysia

PostPosted: Tue Jul 25, 2006 12:40 am    Post subject: Reply with quote

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.
Back to top
akashah



Joined: 29 May 2006
Posts: 29
Location: Malaysia

PostPosted: Tue Jul 25, 2006 10:15 pm    Post subject: Reply with quote

any suggestion?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 



Powered by phpBB © 2001, 2005 phpBB Group