How do I install bindgraph to make pretty query statistics about BIND servers?
Bindgraph was derived from well-known mailgraph package. It is a tool that makes pretty graphs about queries (such as A, MX, AAAA, TXT and so on) sent to your BIND name server. It will create graph for:
- Last Hours Graph
- Day Graph
- Week Graph
- Month Graph
- Year Graph
There are two steps to create graphs:
a] You need enable query logging under bind by updating named.conf file itself. You can log queries to /var/log/query.log file.
b] Create bindgraph.rrd database by enabling bindgraph service.
Install bindgraph
Type the following commands:
# portsnap fetch update
# cd /usr/ports/dns/bindgraph
# make install clean
Configure BIND (named) logging
Open named.conf file, enter:
# vi /etc/namedb/named.conf
Append something as follows to logging options:
channel "querylog" { file "/var/log/query.log"; print-time yes; };
category queries { querylog; };
Here is my sample logging entry:
# Configure the logging options logging { channel security_channel { # Send log messages to the specified file file "/var/log/security.log"; # Log all messages severity debug; # Log the date and time of the message print-time yes; # Log the category of the message print-category yes; # Log the severity level of the message print-severity yes; }; channel default { # Send logs to the syslog 'local0' facility syslog local0; # Log messages of severity 'info' or higher severity info; print-category yes; print-severity yes; }; # Logs about approval and denial of requests category security { security_channel; default; }; # Ignore logs about misconfigured remote servers category lame-servers { null; }; # Default logging options category default { default; }; channel "querylog" { file "/var/log/query.log"; print-time yes; }; category queries { querylog; }; };
Save and close the file. Restart bind server:
# /etc/rc.d/named restart
Configure bindgraph
Enable bindgraph service, enter:
echo 'bindgraph_enable="YES"' >> /etc/rc.conf
Finally, start bindgraph, enter:
# /usr/local/etc/rc.d/bindgraph start
How do I view bindgrap rrd graphs?
By default Perl cgi script is installed at /usr/local/www/cgi-bin/bindgraph.cgi location. You can use the same or copy the script to your cgi-bin location. You also need to configure Apache or other web server to run Perl via cgi-bin. Once done, fire up a webbrowser and type the url
http://yourdomain.com/cgi-bin/bindgraph.cgi
OR
http://server.ip.add.ress/cgi-bin/bindgraph.cgi
You should see sample graphs:
Updated for accuracy!
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop















{ 5 comments… read them below or add one }
It’s really cool and indeed one.
Thanks for sharing,
Liju
Nice! I just set up dlog (http://dlog.gal.dk/), the tinydns equivalent, last week.
Hey Joe,
Nice to see after a long time and thanks for sharing dlog.
b] Create bindgraph.rrd database by enabling bindgraph service.
how create database?
// I have 500 – Internal Server Error
when
# rrdtool create bindgraph.rrd –start 09:35 –step 600 DS:bind:COUNTER:600:U:U RRA:MAX:0.5:1:600
sorry for my english
Is there a way to get this to work on a Debian system? I have been at it for more than a few hours and can’t seem to get any graphs to show up.