DNS Server Response Time: Script & Templates
Moderators: Developers, Moderators
-
- Posts: 2
- Joined: Sat Feb 05, 2005 2:25 pm
- Location: Switzerland
DNS Server Response Time: Script & Templates
Here is my tiny contribution to this great suite of Open Source monitoring tools which I use extensively to monitor my home systems, as well as a large ICT infrastructure of a major humanitarian organisation.
I implemented DNSResponseTime to measure the response times of multiple internal and external DNS Resolvers. The Perl script launches queries repeatedly (after holdoff delay between queries) during Cacti default sample intervall of 300 seconds and the returns minimum, median, average and maximum response times.
Upon import, the attached .XML file will create both a Data Template and a Graph Template called "DNSResponse" for Data Source, as well as a Data Input Method with the same name.
The Graph Template is in so far special as it features a "peak hold" function in in order to avoid peak values of the daily view to average out in the weekly/monthly/yearly views (see attached weekly screenshot).
Rolf
I implemented DNSResponseTime to measure the response times of multiple internal and external DNS Resolvers. The Perl script launches queries repeatedly (after holdoff delay between queries) during Cacti default sample intervall of 300 seconds and the returns minimum, median, average and maximum response times.
Upon import, the attached .XML file will create both a Data Template and a Graph Template called "DNSResponse" for Data Source, as well as a Data Input Method with the same name.
The Graph Template is in so far special as it features a "peak hold" function in in order to avoid peak values of the daily view to average out in the weekly/monthly/yearly views (see attached weekly screenshot).
Rolf
- Attachments
-
- cacti.png (16.52 KiB) Viewed 87000 times
-
- dnsresponsetimeloop.txt
- Place as dnsResponseTime.pl into /home/cactiuser and make sure it has the correct chown, chgrp and access rights.
- (3.92 KiB) Downloaded 10944 times
-
- cacti_graph_template_dnsresponsetime.xml
- Import into Cacti through Web interface, will create the templates.
- (20.12 KiB) Downloaded 10338 times
Re: DNS Server Response Time: Script & Templates
Hi,
I have this script working and I have to say that it's a really nice script, good job!
Regards.
I have this script working and I have to say that it's a really nice script, good job!
Regards.
Re: hi.
How fast your nameservers answer a lookup. Which can be useful info.aboyz wrote:Can someone tell me what is the benefit of this. DNSResponseTime to measure the response times of multiple internal and external DNS Resolvers
Can someone explain it more clearer for me. Like give me an example.
Thanks.
Not generating graphs
Delta ->
I had the same problem with some scripts that I made, about lm_sensors voltages, and cpu/system/hard disk temperatures, and the problem was the owner of the scripts, I think that the owner should be cactiuser/users, so check the owner of the files contained on the dirs /rra and /scripts inside /var/www/cacti, and check the owner. At least that solution solved my problem and now it's working perfectly.
I hope that this help with your problem.
Regards.
I had the same problem with some scripts that I made, about lm_sensors voltages, and cpu/system/hard disk temperatures, and the problem was the owner of the scripts, I think that the owner should be cactiuser/users, so check the owner of the files contained on the dirs /rra and /scripts inside /var/www/cacti, and check the owner. At least that solution solved my problem and now it's working perfectly.
I hope that this help with your problem.
Regards.
I have discovered the problem. The script name was dnsResponseTime.pl so cacti could not find it. I have rename it in dnsResponseTimeLoop.pl and now is drawing something on the graphs but I don't know if those are the true values. The graph shows on all values number -2.00 K and does not move from this point.
"Description:
Place as dnsResponseTime.pl into /home/cactiuser and make sure it has the correct chown, chgrp and access rights. " This was the problem
"Description:
Place as dnsResponseTime.pl into /home/cactiuser and make sure it has the correct chown, chgrp and access rights. " This was the problem
To be or not to be ...
-
- Posts: 22
- Joined: Sun Sep 04, 2005 3:30 am
- Location: Belgium
perl script
Do you have all the requesite perl modules installed???
Opening up the script (good work by the way!), you will see the following perl modules called:
----------------------
use Net::DNS;
use Getopt::Long;
use Pod::Usage;
use Time::HiRes;
If these are not functioning on the system, you are not going to get any results. The script cannot run unless all the called functions are installed and working.
There's a good number of google references to help get CPAN up to date and running on your system first. This is always a good thing to have installed.
Cheers,
-Chris
Opening up the script (good work by the way!), you will see the following perl modules called:
----------------------
use Net::DNS;
use Getopt::Long;
use Pod::Usage;
use Time::HiRes;
If these are not functioning on the system, you are not going to get any results. The script cannot run unless all the called functions are installed and working.
There's a good number of google references to help get CPAN up to date and running on your system first. This is always a good thing to have installed.
Cheers,
-Chris
Negative response values
Checking the perl, it seems that errors are the reason for negative values, no?First off, great work. I love the ease of integration. This rounds off our install of cacti nicely.
Second question though, (before I present this to mgmt.)...how is it that we get negative response results? Is there perhaps a respone time of 0 being handled improperly?
I just need to understand why I see negative values for min and occasional avg. so i can explain it when asked.
Cheers,
-Chris
Code: Select all
$elapsed[$i]= -2000; # query returned error
$elapsed[$i]= -3000; # did not resolve into an A record
$elapsed[$i]= -1000; # timeout occurred
-Chris
What about poller timing?
When the poller runs, it sits and waits for this script to finish, which takes 5 minutes, so the first time your run it, won't some of your SNMP stats be 10 minutes old because they'll run after the perl script? Or does cacti always run scripts last? What if there are multiple scripts, how can you assure that this one, that takes 5 minutes will be last, otherwise it'll impact the other probes.
Negative values? What does it means?
I have the same problem: I saw all values of -2.00 K. Can you tell me in which way you solved the problem? Thank you very much!Delta wrote:I have discovered the problem. The script name was dnsResponseTime.pl so cacti could not find it. I have rename it in dnsResponseTimeLoop.pl and now is drawing something on the graphs but I don't know if those are the true values. The graph shows on all values number -2.00 K and does not move from this point.
"Description:
Place as dnsResponseTime.pl into /home/cactiuser and make sure it has the correct chown, chgrp and access rights. " This was the problem
Gabriele
Re: DNS Server Response Time: Script & Templates
This script uses module "Net::DNS" to get the DNS ResponseTime.but "Net::DNS" is slow.so sometimes it returns the negative time.
I suggest use dig command to get the Qurey Response time.
when using dig command,it return the "Query time".this value can used as "ResponseTime".we can use "dig" 10 times to get 10 different values.then get the min,max and the average value as the min,max and the average DNS ResponseTime.
Anyone can write a sample perl script ?
I suggest use dig command to get the Qurey Response time.
when using dig command,it return the "Query time".this value can used as "ResponseTime".we can use "dig" 10 times to get 10 different values.then get the min,max and the average value as the min,max and the average DNS ResponseTime.
Anyone can write a sample perl script ?
What does exactly mean the "Total query time" ouput of dig.
Does it take the network time with ?
Is dig use the local resolver cache ?
I have only seen "msec" measure from dig, does it switch to "sec" when time is > 999 msec ?
Tomorrow, I am going to have a look at the dig source and try to write a quick and dirty script.
Does it take the network time with ?
Is dig use the local resolver cache ?
I have only seen "msec" measure from dig, does it switch to "sec" when time is > 999 msec ?
Tomorrow, I am going to have a look at the dig source and try to write a quick and dirty script.
Who is online
Users browsing this forum: No registered users and 3 guests