Page Load Time Script Woes
Moderators: Developers, Moderators
Page Load Time Script Woes
Okay, so I've been working on this for several days and I just can't seem to figure out what I'm doing wrong. I'm attempting to use the following article's script to get an idea of page load times:
http://www.askaboutphp.com/44/cacti-usi ... art-1.html
This script takes a URL as input and outputs similar to the following as follows:
dns:0.130177 con:0.242694 pre:0.242797 str:1.129853 ttl:1.513351 sze:27398 spd:18104
Where each space-separated value is a different aspect of the loading of a web page that I'd like to capture. I know that the script works as I've run it myself using Perl with the following command:
sudo -u cacti /usr/bin/perl /var/www/cacti/scripts/pageload/pageload-agent.php www.URL-TO-TEST.com
and php:
sudo -u cacti php /var/www/cacti/scripts/pageload/pageload-agent.php www.URL-TO-TEST.com
Both commands complete successfully.
I've created the Data Input Method as both a Script/Command using:
/usr/bin/perl /var/www/cacti/scripts/pageload/pageload-agent.php <url>
and (when the above didn't work) as a Script Server using:
/var/www/cacti/scripts/pageload/pageload-agent.php <url>
The DS ID is 101. When running via the Script/Command I get the following in the Cacti log:
01/10/2011 10:50:03 PM - CMDPHP: Poller[0] Host[0] DS[101] WARNING: Result from CMD not valid. Partial Result: U
When running under Script Server I get the following in the Cacti log:
01/10/2011 10:35:01 PM - POLLER: Poller[0] WARNING: Poller Output Table not Empty. Issues Found: 1, Data Sources: (DS[101])
For the life of me I can't get this to graph. I've worked on this for several hours and I'm really not sure what else to try. Any help is much appreciated. I've followed the article to the letter (several times) and I've tried changing multiple parameters but to no avail. If I get this resolved I promise I'll write up a procedure so that others won't have to go through this.
http://www.askaboutphp.com/44/cacti-usi ... art-1.html
This script takes a URL as input and outputs similar to the following as follows:
dns:0.130177 con:0.242694 pre:0.242797 str:1.129853 ttl:1.513351 sze:27398 spd:18104
Where each space-separated value is a different aspect of the loading of a web page that I'd like to capture. I know that the script works as I've run it myself using Perl with the following command:
sudo -u cacti /usr/bin/perl /var/www/cacti/scripts/pageload/pageload-agent.php www.URL-TO-TEST.com
and php:
sudo -u cacti php /var/www/cacti/scripts/pageload/pageload-agent.php www.URL-TO-TEST.com
Both commands complete successfully.
I've created the Data Input Method as both a Script/Command using:
/usr/bin/perl /var/www/cacti/scripts/pageload/pageload-agent.php <url>
and (when the above didn't work) as a Script Server using:
/var/www/cacti/scripts/pageload/pageload-agent.php <url>
The DS ID is 101. When running via the Script/Command I get the following in the Cacti log:
01/10/2011 10:50:03 PM - CMDPHP: Poller[0] Host[0] DS[101] WARNING: Result from CMD not valid. Partial Result: U
When running under Script Server I get the following in the Cacti log:
01/10/2011 10:35:01 PM - POLLER: Poller[0] WARNING: Poller Output Table not Empty. Issues Found: 1, Data Sources: (DS[101])
For the life of me I can't get this to graph. I've worked on this for several hours and I'm really not sure what else to try. Any help is much appreciated. I've followed the article to the letter (several times) and I've tried changing multiple parameters but to no avail. If I get this resolved I promise I'll write up a procedure so that others won't have to go through this.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Page Load Time Script Woes
I'm wondering how you made perl execute php scripts.
Apart from that, please see 2nd link of my sig
R.
Apart from that, please see 2nd link of my sig
R.
Re: Page Load Time Script Woes
I must be as magical as your namesake. It absolutely does indeed work though:
I've now been able to get this working, using Perl. The problem was that I put this script outside of the scripts folder, which it say in the original instructions is just fine to do. Evidently not. Now it's working mostly okay. I've got gaps in my records but that's probably for another thread.
Long story short: use the above article and put the related scripts in the scripts directory and you're off to the races.
Code: Select all
[root@babb ~]# sudo -u cacti /usr/bin/perl /var/www/cacti/scripts/pageload/pageload-agent.php www.google.com
dns:0.002254 con:0.003961 pre:0.004014 str:0.034697 ttl:0.036397 sze:6403 spd:175921
[root@babb ~]#
Long story short: use the above article and put the related scripts in the scripts directory and you're off to the races.
Re: Page Load Time Script Woes
Hi,
I've been having similar problems - but reducing the number of pollers to 1 fixed it for me.
I have a different problem:
using the details from:
http://www.askaboutphp.com/44/cacti-usi ... art-1.html
I have set up the data source with the 7 datasource items - here is the debug output for the datasource:
When I come to add the graph elements I am able to add "con" but not any of the other items.
Adding "dns" gives me the following debug info:
Any ideas why this would be happening?
Has anyone found a better template to use for collecting and graphing the load times for webpages?
Thanks,
Aikidoka
I've been having similar problems - but reducing the number of pollers to 1 fixed it for me.
I have a different problem:
using the details from:
http://www.askaboutphp.com/44/cacti-usi ... art-1.html
I have set up the data source with the 7 datasource items - here is the debug output for the datasource:
Code: Select all
/usr/bin/rrdtool create \
/var/lib/cacti/rra/47.rrd \
--step 60 \
DS:con:GAUGE:120:0:U \
DS:dns:GAUGE:120:0:U \
DS:pre:GAUGE:120:0:U \
DS:str:GAUGE:120:0:U \
DS:spd:GAUGE:120:0:U \
DS:sze:GAUGE:120:0:U \
DS:ttl:GAUGE:120:0:U \
RRA:AVERAGE:0.5:6:2000 \
RRA:AVERAGE:0.5:24:1000 \
RRA:AVERAGE:0.5:288:1000 \
RRA:AVERAGE:0.5:1:525600 \
RRA:AVERAGE:0.5:1:2628000 \
RRA:MAX:0.5:6:2000 \
RRA:MAX:0.5:24:1000 \
RRA:MAX:0.5:288:1000 \
RRA:MAX:0.5:1:525600 \
RRA:MAX:0.5:1:2628000 \
Adding "dns" gives me the following debug info:
Code: Select all
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-525600 \
--end=-60 \
--title='Load time for WEBPAGEs' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/lib/cacti/rra/47.rrd":con:AVERAGE \
DEF:b="/var/lib/cacti/rra/47.rrd":dns:AVERAGE \
AREA:a#FF7D00FF:"Connect time\:" \
AREA:b#FFC3C0FF:"DNS time\:"
RRDTool Says:
ERROR: No DS called 'dns' in '/var/lib/cacti/rra/47.rrd'
Has anyone found a better template to use for collecting and graphing the load times for webpages?
Thanks,
Aikidoka
Re: Page Load Time Script Woes
Did you select proper output filed for each datasource items?Aikidoka wrote:When I come to add the graph elements I am able to add "con" but not any of the other items.
See also: http://www.askaboutphp.com/wp-post-images/45/cacti-step7.png
(You should click "Save" button at each tabs)
To see details, perform this:
% rrdtool info /var/lib/cacti/rra/47.rrd
Re: Page Load Time Script Woes
Hi,
Thanks for the reply.
I did set up all the entries as instructed and used save each time. (Attached) Thanks for the command: rrdtool info /var/lib/cacti/rra/47.rrd
This is the output from the command (I can see that there is only details for "con" in the output)
TBH I will probably wipe out all the settings for this and restart from scratch - although queued behind getting WMI working from Linux.
Thanks for the help,
Aikidoka
Thanks for the reply.
I did set up all the entries as instructed and used save each time. (Attached) Thanks for the command: rrdtool info /var/lib/cacti/rra/47.rrd
This is the output from the command (I can see that there is only details for "con" in the output)
Code: Select all
filename = "/var/lib/cacti/rra/47.rrd"
rrd_version = "0003"
step = 60
last_update = 1321876141
ds[con].type = "GAUGE"
ds[con].minimal_heartbeat = 120
ds[con].min = 0.0000000000e+00
ds[con].max = NaN
ds[con].last_ds = "0.001993"
ds[con].value = 1.9930000000e-03
ds[con].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 2000
rra[0].cur_row = 1357
rra[0].pdp_per_row = 6
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = 1.9847666667e-03
rra[0].cdp_prep[0].unknown_datapoints = 0
rra[1].cf = "AVERAGE"
rra[1].rows = 1000
rra[1].cur_row = 874
rra[1].pdp_per_row = 24
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = 2.2541300000e-02
rra[1].cdp_prep[0].unknown_datapoints = 0
rra[2].cf = "AVERAGE"
rra[2].rows = 1000
rra[2].cur_row = 857
rra[2].pdp_per_row = 288
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 4.8064783333e-02
rra[2].cdp_prep[0].unknown_datapoints = 105
rra[3].cf = "AVERAGE"
rra[3].rows = 525600
rra[3].cur_row = 182956
rra[3].pdp_per_row = 1
rra[3].xff = 5.0000000000e-01
rra[3].cdp_prep[0].value = NaN
rra[3].cdp_prep[0].unknown_datapoints = 0
rra[4].cf = "AVERAGE"
rra[4].rows = 2628000
rra[4].cur_row = 1266848
rra[4].pdp_per_row = 1
rra[4].xff = 5.0000000000e-01
rra[4].cdp_prep[0].value = NaN
rra[4].cdp_prep[0].unknown_datapoints = 0
rra[5].cf = "MAX"
rra[5].rows = 2000
rra[5].cur_row = 953
rra[5].pdp_per_row = 6
rra[5].xff = 5.0000000000e-01
rra[5].cdp_prep[0].value = 1.9847666667e-03
rra[5].cdp_prep[0].unknown_datapoints = 0
rra[6].cf = "MAX"
rra[6].rows = 1000
rra[6].cur_row = 331
rra[6].pdp_per_row = 24
rra[6].xff = 5.0000000000e-01
rra[6].cdp_prep[0].value = 1.9847666667e-03
rra[6].cdp_prep[0].unknown_datapoints = 0
rra[7].cf = "MAX"
rra[7].rows = 1000
rra[7].cur_row = 472
rra[7].pdp_per_row = 288
rra[7].xff = 5.0000000000e-01
rra[7].cdp_prep[0].value = 2.2179666667e-03
rra[7].cdp_prep[0].unknown_datapoints = 105
rra[8].cf = "MAX"
rra[8].rows = 525600
rra[8].cur_row = 182500
rra[8].pdp_per_row = 1
rra[8].xff = 5.0000000000e-01
rra[8].cdp_prep[0].value = NaN
rra[8].cdp_prep[0].unknown_datapoints = 0
rra[9].cf = "MAX"
rra[9].rows = 2628000
rra[9].cur_row = 727209
rra[9].pdp_per_row = 1
rra[9].xff = 5.0000000000e-01
rra[9].cdp_prep[0].value = NaN
rra[9].cdp_prep[0].unknown_datapoints = 0
Thanks for the help,
Aikidoka
Re: Page Load Time Script Woes
I found out what the problem is.
In the instructions is doesn't say to use a value in "maximum Value" field.
So I left it as default - 0.
After using larger numbers everything started to work.
Sadly I can't get the Speed and size working yet - only get -NAN - but I'm working on it.
In the instructions is doesn't say to use a value in "maximum Value" field.
So I left it as default - 0.
After using larger numbers everything started to work.
Sadly I can't get the Speed and size working yet - only get -NAN - but I'm working on it.
Who is online
Users browsing this forum: No registered users and 1 guest