Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Apr 23, 2019 9:22 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 51 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: DNS Server Response Time: Script & Templates
PostPosted: Mon Feb 07, 2005 9:03 am 
Offline

Joined: Sat Feb 05, 2005 2:25 pm
Posts: 2
Location: Switzerland
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


Attachments:
File comment: Import into Cacti through Web interface, will create the templates.
cacti_graph_template_dnsresponsetime.xml [20.12 KiB]
Downloaded 9575 times
File comment: Place as dnsResponseTime.pl into /home/cactiuser and make sure it has the correct chown, chgrp and access rights.
dnsresponsetimeloop.txt [3.92 KiB]
Downloaded 10286 times
cacti.png
cacti.png [ 16.52 KiB | Viewed 77408 times ]
Top
 Profile  
 
 Post subject: Re: DNS Server Response Time: Script & Templates
PostPosted: Thu May 19, 2005 9:50 am 
Offline

Joined: Thu May 19, 2005 9:48 am
Posts: 2
Hi,

I have this script working and I have to say that it's a really nice script, good job!

Regards.


Top
 Profile  
 
 Post subject: hi.
PostPosted: Thu May 19, 2005 2:20 pm 
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.


Top
  
 
 Post subject: Re: hi.
PostPosted: Mon May 23, 2005 7:30 am 
Offline
Cacti User

Joined: Tue Jul 13, 2004 2:57 am
Posts: 56
Location: Norway
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.


How fast your nameservers answer a lookup. Which can be useful info.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 1:15 pm 
Offline

Joined: Sat Jul 09, 2005 8:02 am
Posts: 3
Location: Bucharest; Romania
I have a small problem, Cacti is generating the graph but they are empty. In debug mode rrdtool says ok, in the pool logs he is accesing the right script (\home\cactiuser\dnsResponseTime.pl ), but not a single scratch in the graph area. What did I forget ?

_________________
To be or not to be ...


Top
 Profile  
 
 Post subject: Not generating graphs
PostPosted: Sat Aug 27, 2005 6:48 am 
Offline

Joined: Thu May 19, 2005 9:48 am
Posts: 2
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 7:31 am 
Offline

Joined: Sat Jul 09, 2005 8:02 am
Posts: 3
Location: Bucharest; Romania
The script is in the /home/cactiuser/ and has the right cactiuser group users. I think maibe the pearl script does not work. I see that in /www/cacti/scripts the files belong to root in group users. Those that come with cacti by default works perfectly.... :o

_________________
To be or not to be ...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 9:59 am 
Offline

Joined: Sat Jul 09, 2005 8:02 am
Posts: 3
Location: Bucharest; Romania
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.:cry:

"Description:
Place as dnsResponseTime.pl into /home/cactiuser and make sure it has the correct chown, chgrp and access rights. " This was the problem :wink:

_________________
To be or not to be ...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 10:04 am 
Offline

Joined: Sun Sep 04, 2005 3:30 am
Posts: 22
Location: Belgium
hi people,

i get this error

Quote:
Can't locate object method "using" via package "TCP" (perhaps you forgot to load "TCP"?) at ./dnsResponseTimeLoop.pl line 85.


now what's up with that ?


Top
 Profile  
 
 Post subject: perl script
PostPosted: Thu Sep 22, 2005 4:30 pm 
Offline

Joined: Thu Sep 22, 2005 4:26 pm
Posts: 7
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


Top
 Profile  
 
 Post subject: Negative response values
PostPosted: Fri Sep 23, 2005 4:54 pm 
Offline

Joined: Thu Sep 22, 2005 4:26 pm
Posts: 7
Quote:
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


Checking the perl, it seems that errors are the reason for negative values, no?
Code:
   $elapsed[$i]= -2000;                 # query returned error
   $elapsed[$i]= -3000;                 # did not resolve into an A record
   $elapsed[$i]= -1000;                  # timeout occurred


I'll keep reading...

-Chris


Top
 Profile  
 
 Post subject: What about poller timing?
PostPosted: Mon Oct 02, 2006 10:46 am 
Offline

Joined: Mon Oct 02, 2006 10:45 am
Posts: 8
Location: NJ
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.


Top
 Profile  
 
 Post subject: Negative values? What does it means?
PostPosted: Sat Oct 14, 2006 7:14 am 
Offline

Joined: Mon Jun 13, 2005 3:53 am
Posts: 21
Location: Rome
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.:cry:

"Description:
Place as dnsResponseTime.pl into /home/cactiuser and make sure it has the correct chown, chgrp and access rights. " This was the problem :wink:


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!

Gabriele


Top
 Profile  
 
 Post subject: Re: DNS Server Response Time: Script & Templates
PostPosted: Thu Nov 02, 2006 3:53 am 
Offline

Joined: Mon Oct 30, 2006 9:16 pm
Posts: 1
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 ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 10:51 am 
Offline
Cacti User

Joined: Tue Feb 21, 2006 9:40 am
Posts: 68
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group