CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
average dns query per second

 



jeffersno1
Novice

Jan 3, 2008, 1:28 PM

Post #1 of 6 (717 views)
average dns query per second Can't Post

Hello,

Im new to this forum and fairly new to perl to be honest, ive written a few scripts but i've struggled with this one for queries per minute and per second on my dns boxes.

ok here i go. I look after a unix box dedicated to DNS requests, during peak times there can be up to 180 dns requests per second. During a certain times requests go through the roof, i think im getting hacked by several machines the same time every day. The only thing is there are so many requests per second its going to take me hours to go through a 300mb files full of requests.

is there a simple way for me find the peak time of requests? i've written a script to pull out the right info such as the time field etc but i cant seem to put them into a count per minute and then into per second.

Anyones help would be greatfully received. If you want me to post snippets of my script already let me know

thanks in advance

Jeffers


KevinR
Veteran


Jan 3, 2008, 10:31 PM

Post #2 of 6 (714 views)
Re: [jeffersno1] average dns query per second [In reply to] Can't Post

Is there no software for a DNS server that can keep track of this sort of statistical data?
-------------------------------------------------


jeffersno1
Novice

Jan 3, 2008, 11:26 PM

Post #3 of 6 (713 views)
Re: [KevinR] average dns query per second [In reply to] Can't Post

Not that im aware of, if there is were not running it.


KevinR
Veteran


Jan 4, 2008, 12:57 AM

Post #4 of 6 (712 views)
Re: [jeffersno1] average dns query per second [In reply to] Can't Post

Have you checked CPAN to see if there are any modules that already do this type of stuff? If the DNS log file is written in some standard format there might already be a module(s).
-------------------------------------------------


jeffersno1
Novice

Jan 4, 2008, 1:40 AM

Post #5 of 6 (710 views)
Re: [KevinR] average dns query per second [In reply to] Can't Post

thanks for your reply,



if your referring to the CPANEL, i have root access to the box but remotley, the only way i can get on is via the CLI.

this is what i have at the moment, the log file looks like this:

03-Jan-2008 08:50:36.044 queries: info: client **.***.**.***#port#: query: www.intel.com IN MX +
03-Jan-2008 08:50:36.045 queries: info: client **.**.**.***#port#: query: imap.mail.yahoo.com IN AAAA +
03-Jan-2008 08:50:36.045 queries: info: client **.**.***.**#port#: query: i23.ebayimg.com IN A +
03-Jan-2008 08:50:36.046 queries: info: client **.**.**.*#port#: query: view.web.com IN A +
03-Jan-2008 08:50:36.050 queries: info: client **.**.**.***#port#: query: spe.google.com IN A +

The script ive started to write is as follow:


Code
 #!/usr/bin/perl -w 

use POSIX;

open (file_handle,"/dns/log/test.log");

foreach (<file_handle>){
chomp($_);
@line=split(" ",$_);
@time=split(":",$line[1]);


So from the above im getting splitting the line up so i only get the time the request
was made, now all i need to do is put it into how many per minute and how many per secondThanks againJeffers


KevinR
Veteran


Jan 4, 2008, 9:44 AM

Post #6 of 6 (701 views)
Re: [jeffersno1] average dns query per second [In reply to] Can't Post

I'm not referring to the CPANEL. Did you search CPAN? There are a lot of DNS related modules, but being unfamiliar with DNS, I don't know if any of them will help you. If you want help with writing a script I can do that, it will help tremendously though if you clearly describe what you are trying to do with those lines of data.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives