Menu

#4 All graphs are flatliners...

open
nobody
None
5
2009-12-04
2009-12-04
No

After solving the DATE-problem we're still stuck with totally flat graphs... How come?
Well, I'm no Bind-expert and I don't know anything about the developments of Bind the last 6+ years, but it seems the format of the Bind stats file has dramatically changed. Therefore the regular expressions used to parse the stats-file need to be changed accordingly.

This is my adapted version of the subroutine 'process_line($)':
(dnsanalise.pl)

sub process_line($)
{
my $line = shift;
chomp $line;
my $L_number=0;
my $L_zone;
$line =~ /^\s*(\d+)/ and $L_number = $1;
if ($line =~ /^\+\+\s/){
if ($line =~ /Name Server Statistics/){
$interested = 1;
}else{
$interested = 0;
}
}
$interested = 0 if $line =~ /^\[/;

if($line =~ /^\+\+\+/)
{
$line =~ /\((\d+)\)/; # Select time stamp from first line of dump (\d+) = one or more digit characters
$time = $1; # $1 is what the pattern between the brackets found
$success = 0;
$failure = 0;
$recursion = 0;
$referral = 0;
$nxrrset = 0;
$nxdomain = 0;
}
elsif($line =~ /^---/)
{
update();
$interested = 0;
}
elsif($L_number && $interested )
{
if ($line =~ /success/) { $success = $L_number; }
elsif($line =~ /failure/) { $failure = $L_number; }
elsif($line =~ /SERVFAIL/) { $failure = $L_number; }
elsif($line =~ /recursion/){ $recursion = $L_number; }
elsif($line =~ /referral/) { $referral = $L_number; }
elsif($line =~ /nxrrset/) { $nxrrset = $L_number; }
elsif($line =~ /nxdomain/) { $nxdomain = $L_number; }
}
}

Somewhere at the beginning of the script you should add:
my $interested = 0;

It's just a silly name for a boolean variable to keep track of whether lines of the stats file bother us, based on certain characteristics.

I hope this will help the potential users of dnsgraph to get the scripts working.

The 21st of February I will become the official developer of dnsgraph if the current developer of dnsgraph doesn't respond to the mails of the Sourceforge guys within 90 days. Please mail me or respond to this posting with any suggestions you have to enhance this project to give it a grand new start on the 21st of February!
A brand new, fully functional tar-ball is what I'd like to achieve shortly after that date.
Upon that I'd like per zone statistics, a single script instead of three and a spring-cleaning of the perl code.
I'd like the code to be so clear and simple that it encourages the user to adapt it to his/her needs.
That would give this project a raison d'être, since there is an abundant supply of out of the box solutions for dns statistics.
<cough>
cacti
</cough>
Please let me know how you feel about this.
--
Eric de Hont

Discussion


Log in to post a comment.