Langsung ke konten utama

Bind DNS Graph in Cacti

In My Previous tutorial, Menampilkan hasil DNS query pada cacti I tried to graph my bind dns server in cacti. At the moment, I usedBind version 4.3. By the time, ISC (Consorcium that create bind) always update this software. Usually, they update because of found bug, improve perfomance, hardware support, and other.

Until now, Bind version is 10. but currently, I still use bind 9.8. it seems that, after bind 9.4, ISC change mayor update in thebind version. because of this, my tutorial for bind 9.3.4 did not compatible anymore for latest bind. I have tried to search in internet,googling, find the forum, but still not successfull. 

And fortunately, 5 days ago, I tried to access cacti forum. found the new way to graph new bind version in cacti. for the forum, you can see at this link : http://forums.cacti.net/viewtopic.php?f=12&t=45926&start=0
Because of my couriousity, I tried to make graph my bind. Oh ya, I run my dns server in Linux (RHEL 5.5) I think ou can run this step in other linux distros, as long as your bind is 9.7 or newer than that. Here is the step :
  1. download the script, and bind template in here :
  2.  unzip the file (bind97.zip) and it will extract 4 files :
    • bind-stats.sh
    • cacti_host_template_bind9_7.xml
    • dnsstats.pl
    • runstats.sh
  3. This 4 files, will separate in two system. two file to your cacti monitoring, and others three will be put in your dns server. i will explain how to install them all.
  4. First we will configure in our DNS Server. before that :
·         Make sure your selinux is disable 
 # more /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted
·         Make sure where is your zone statistics located. You can check it in you named.conf
options {
 directory "/var/named";
...
        statistics-file "/var/named/named.stats";
};
·         OK, now all pre-requist already fullfill.  Now we will configure snmp in our dns. Cacti will try to find oid base on this snmp.  Put this line in your snmpd.conf :
# more /etc/snmp/snmpd.conf
...
extend  .1.3.6.1.4.1.18689.0.1 dnscache-stats /bin/runstats.sh
Contains of runstats.sh
more /bin/runstats.sh
#!/bin/sh

rm -rf /var/named/named.stats
rndc stats
cat /var/named/named.stats | /bin/dnsstats.pl
Assosiate your runstats.sh.  the idea in runstats.sh is :
o   If exist, delete previous named.stats. if you bind statistics file not match with runstats.sh , you can replace it and assosiate your statistic file
o   After that, create named.stats using rndc command
o   View the named.stats file, and get the value using dnsstats.pl
·         After finish snmpd.conf, make your runstats.sh is executable and after that copy 2 files : runstats.sh and dnsstats.pl to /bin directory.
1.        Make executable :
Chmod +x runstats.sh
2.       Copy to files in /bin directory
# cp /root/runstats.sh /bin
#cp  /root/dnsstats.pl /bin
·         Finish copying two file, we need to restart snmpd daemon 
/etc/init.d/snmpd restart
·         Next step, we need to know, whether  our snmp able to get information of our bind:
snmpget -v1 –c your_community_name IP_ADDRESS_OF_YOUR_DNS_SERVER .1.3.6.1.4.1.18689.0.1.4.1.2.14.100.110.115.99.97.99.104.101.45.115.116.97.116.115.1
SNMPv2-SMI::enterprises.18689.0.1.4.1.2.14.100.110.115.99.97.99.104.101.45.115.116.97.116.115.1 = STRING: "a:846 a6:0 aaaa:412 any:344 cname:13 mx:1079 naptr:8358 ns:536 ptr:331 soa:307 spf:0 srv:488 txt:179 rsnx:194 rsfail:154 rserr:33 rsipv4qs:2894 rsipv4rr:1609 rsmismatch:97 rsqr:199 rsqt:133 rsrtt10:137 rsrtt100500:288 rsrtt10100:106 rsrtt1600:583 rsrtt500800:118 rsrtt8001600:245 sockopen:296 sockclosed:296 sockbf:800 consest:2888 recverr:115"
If you can see those result, then we can continue to configure our cacti. Otherwise,please check your snmp configuration, or your other system.
Bind use new OID :
.1.3.6.1.4.1.18689.0.1.4.1.2.14.100.110.115.99.97.99.104.101.45.115.116.97.116.115.1
 

       ·         OK, now we will configure our cacti. We will put 2 files inour cacti. Those files are :
o   cacti_host_template_bind9_7.xml
o   bind-stats.sh
·         First, we should import the template in your cacti. Open your cacti, and get import template :

·         After that copy bind-stats.sh in your cacti scripts directory.
Cp /root/bind97/bind-stats.sh /your/cacti/directory/scripts/

·         Finish with that, now we will create the graph. Choose your DNS in your cacti 






·         Add the graph then activate it:

·         Wait for 10 minutes. For good result, I suggest wait for 1 day. Here is the result in my cacti :

Komentar

Postingan populer dari blog ini

Menggunakan Modem ZTE MF 622 di Ubuntu

Setelah beberapa waktu lalu saya berhasil mengutak atik modem huawei 620, Sekarang saya akan menuliskan bagaimana menggunakan modem zte mf 622 di linux. Kebetulan, linux yang saya gunakan kali ini adalah Ubuntu 8.10. Mungkin lain waktu, saya akan mencoba langkah-langkah pada tulisan ini di Fedora (sebenernya, saya lebih terbiasa dengan Fedora daripada Ubuntu), namun karena ingin mencoba distro yang digadang-gadangkan banyak komunitas sebagai distro termudah, dan terbanyak penggunanya, maka saya pun akhirnya tak dapat menahan rayuan untuk mencoba ubuntu versi terbaru ini. Oh ya, sebelumnya, saya menggunakannya di laptop saya, acer aspire 4520. dan ini adalah foto dari modem saya OK, segera kita mulai. Untuk menggunakan modem ZTE MF 622 ini, tidak banyak aplikasi yang dilibatkan. Aplikasi yang dibutuhkan antara lain wvdial, dmesg, pptp. * wvdial ini digunakan untuk memudahkan kita menggunakan modem ini. * dmesg digunakan untuk memeriksa message pada kernel apakah ketika modem ditancapkan...

Cara membangun DNS Filter (mari berantas pornografi)

Kebutuhan : 1. dns server, pilihan yang baik menggunakan powerdns, karena saya rpm base, maka silakan di download di : http://downloads.powerdns.com/releases/rpm/pdns-static-2.9.22-1.i386.rpm download powerdns sebagai authoritative server 2. linux box, pastinya. 3. database situs-situs yang ingin di blok, bisa didownload di http://urlblacklist.com/cgi-bin/commercialdownload.pl?type=download&file=bigblacklist pilih situs porno 4. web server saya asumsikan di sini, kita akan menyimpan databasenya dalam bentuk file. powerdns bisa menyimpannya dalam database, salah satu yang telah saya coba adalah mysql. namun pada tutorial ini, yang saya bahas adalah menggunakan file. di dalam database tersebut, terdapat kategori porn, nah pilih kategori tersebut. lalu pilih file domain. ide dari dns filtering ini adalah "memaksa" suatu domain, katakanlah situs porno tadi, ke suatu ip yang telah kita assign. ip tersebut, bisa di server dns filter ini. misalnya dns filter...