DNS Server Response Time: Script & Templates

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

Post by gagadget »

dig only use "msec" and don't switch to second, at least in version 8.4.6 .
But, I don't know if it use the local resolver cache because it should not.

The perl script will be pretty straight forward. The only problem is it relies on the fact that dig have to be installed locally on the cacti machine, it's not true for the majority of the OSes.

An other solution could be a script that connect to the DNS sever via SSH and launch a dig command remotely ...

I have tested dig and dnsResponseTime.pl measurement, the first give me an average of 4 ms et the second 12 ms, which one is righter ?
Mike S.
Posts: 4
Joined: Thu Nov 16, 2006 5:19 pm

Post by Mike S. »

Hi,

It seems that poller.php hangs and does not give results.

When i run the scripts it totaly loops for ever. (works but to good i think)

When i run poller i get in logs:
Error: Maximum runtime of 292 seconds exceeded. Exiting

What could it be?

Thanks
zagman76
Posts: 2
Joined: Tue Nov 14, 2006 6:56 pm

Post by zagman76 »

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:
I am having the same problem, except mine is stuck at 1k... :-?
hkie
Posts: 1
Joined: Tue Nov 21, 2006 4:56 am

Empty result

Post by hkie »

Hi
i have a problem the result is empty, here is entries off the poller.log

11/21/2006 10:48:56 AM - CACTID: Poller[0] Host[2] ERROR: Empty result [hcsztws16158.hcst.com]: 'perl C:/cacti/scripts/dnsResponseTimeLoop.pl -s xx.xx.xx.xx -h cacti.xxxx.com -t 9 -i 10 -r -d 10'

11/21/2006 10:48:56 AM - CACTID: Poller[0] Host[2] DS[804] SCRIPT: perl C:/cacti/scripts/dnsResponseTimeLoop.pl -s xx.xx.xx.xx -h cacti.xxxx.com -t 9 -i 10 -r -d 10, output: U

have someone a idea?

bye Holger
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Looks like you need to specify the complete path to the PERL binaries. From version "g", you can't state "PERL". For example, you'd need to change your PERL path to "/usr/bin/perl".

Hope this helps ?
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
cwahlin
Cacti User
Posts: 91
Joined: Fri Oct 10, 2003 7:23 am

Post by cwahlin »

For me, the script seems to be stuck in an endless loop...

/Carl
flipflap
Cacti User
Posts: 142
Joined: Sat Jul 09, 2005 3:13 pm

Post by flipflap »

i tried running this script from windows os command line

dnsResponseTimeLoop.pl -s x.x.x.x -h google.com -t 9 -i 300 -r -d 10

output

Can't locate Net/DNS.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .)
at dnsResponseTimeLoop.pl line 3.
BEGIN failed--compilation aborted at dnsResponseTimeLoop.pl line 3

can this be ported to windows? thanks
gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

Post by gagadget »

install Net::DNS module for perl
flipflap
Cacti User
Posts: 142
Joined: Sat Jul 09, 2005 3:13 pm

Post by flipflap »

i did that then the next thing it was looking for was net::ip i also installed then the next thing it said was

Time::HiRes::ualarm(): unimplemented in this platform at dnsResponseTimeLoop.pl
line 6
BEGIN failed--compilation aborted at dnsResponseTimeLoop.pl line 6.
gagadget
Cacti User
Posts: 71
Joined: Tue Feb 21, 2006 9:40 am

Post by gagadget »

Time:HiRes seems to use posix primitive that does not exist on your system, what do you use as your server ? Windows ... change your plateform use a real OS, sorry about that :roll:
flipflap
Cacti User
Posts: 142
Joined: Sat Jul 09, 2005 3:13 pm

Post by flipflap »

yes windows. i'll pretend i did not read about your comment :lol:
cudcm
Posts: 4
Joined: Tue Jan 16, 2007 6:34 am

Post by cudcm »

POLLER: Poller[0] Maximum runtime of 296 seconds exceeded. Exiting.

I changed under [Data Input Methods [edit: DNS Response Time]
from
scripts/dnsresponsetimeloop.pl -s <serveraddr> -h <hostname> -t 9 -i 300 -r -d 10 (300 seconds)
to
scripts/dnsresponsetimeloop.pl -s <serveraddr> -h <hostname> -t 9 -i 60 -r -d 10 (60 seconds)

I'm guessing that as 296 seconds is being exceeded you can up this value to just below that figure and should work fine?
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Did anyone find a good solution for some of the issues here?

If I let Cacti (0.8.6.j) just run, I get a POPEN failure in the log.. If I run:

Code: Select all

/usr/bin/perl /var/www/cacti/scripts/dnsResponseTimeLoop.pl -s 192.168.50.3 -h www.google.com -t 9 -i 300 -r -d 10
manually, then it sits there (I'm guessing this is right though).

If I change -i 300 to -i 10, then does that screw up the results at all?
wjm
Posts: 20
Joined: Fri Oct 13, 2006 12:06 pm

Post by wjm »

adrianmarsh,
I run it manually and I get the results below.
I wonder if running from root does it.
When I change the -i option, it runs for that many seconds.
I changed mine to 60 because I do one minute polling
-d looks to be how long it takes to fire off again , so in 60 seconds it happens 6 times.
Did you wait the full 5 minutes to see any output?

[root@localhost ~]# perl /var/www/html/scripts/dnsResponseTimeLoop.pl -s 10.10.2.4 -h www.google.com -t 9 -i 60 -r -d 10
min:3 median:3 avg:4 max:9 iter:6

My log shows below
04/23/2007 10:23:37 AM - CACTID: Poller[0] Host[380] DS[17254] WARNING: Result from SCRIPT not valid. Partial Result: ...
04/23/2007 10:23:37 AM - CACTID: Poller[0] Host[380] ERROR: The POPEN timed out

Also, if I do: top -u apache -c it shows what I believe what should be running
[root@localhost ~]# 7605 apache 17 0 10628 7660 1828 S 0.0 0.2 0:00.18 /usr/bin/perl /var/www/html/scripts/dnsResponseTimeLoop.pl -s 10.10.2.4 -h www.google.com -t 9 -i 60 -r -d 10
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

thanks wjm,

For some reason, it works ok inside the poller. When you run yours from a shell prompt, do you run as root?

I don't really want the poller taking 60s to run, just to test DNS. So I've left mine set to 10s. Hopefully enough to gauge it ok.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests