AccuWeather script & templates

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

Moderators: Developers, Moderators

drywalldude
Posts: 11
Joined: Fri Jan 28, 2005 9:41 pm
Location: USA
Contact:

frustrated Bad

Post by drywalldude »

I have tried everything with both the perl and php scripts and nothing at all. I got the perl working at command but would not graph. The php looks like this:
[root@sme7server scripts]# php ./accuweather.php Content-type: text/html
X-Powered-By: PHP/4.3.9

could not open XML input[root@sme7server scripts]# php accuweather.php
Content-type: text/html
X-Powered-By: PHP/4.3.9

All the templates import fine, Ive edited the url in line 2 like this:

$file = "http://forecastfox.accuweather.com/adcb ... orecastfox";
This returns the appropriate xml file for US Atlanta Georgia I believe.

I have set the cron for 1 minute and verified it to be doing so.
I am running a Centos 4 bases flavor of Linux with PHP 4.3.9
and cacti 8.6i

Seems like I've been trying to get these great looking graphs for years now, HELP please!
Thankyou in advance :o
semakka
Posts: 20
Joined: Mon Oct 23, 2006 6:37 am

accuweather

Post by semakka »

Just customized a bit the php script and the data and graph templates, you only need to change the zip in the php file going to accuweather website and looking for your location. it works fine for me.

add the php file to your scripts folder and import the template, exported with cacti 0.8.6i

Cheers,
Steven Muntean
Attachments
accuweather_php.zip
php script and host template
(6.6 KiB) Downloaded 1797 times
rz1
Posts: 12
Joined: Wed Dec 13, 2006 5:35 am

Post by rz1 »

Hello,

I get this running "php5 accuweather.php" :

Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /root/accuweather.php on line 31

Warning: fopen(http://forecastfox.accuweather.com/adcb ... orecastfox): failed to open stream: Connection timed out in /root/accuweather.php on line 31


Any idea?
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

Same here??
danwdoo
Cacti User
Posts: 50
Joined: Thu Oct 26, 2006 11:42 pm

Parser broken by space

Post by danwdoo »

Hello,
I have noticed the XML parser is broken by retreiving a city name with a space in it. For instance if I pull down "Chiang Mai" it breaks with "could not open XML input" If I use Bankok (or any city name without a space in it) it works. I even went so far as to download the accuweather ASP file for chiang mai, edited it to remove the space (chiangmai instead of chiang mai) and loaded the file that way and it worked fine. What change needs to be made to the php file in order for it to handle names with spaces?

Thanks!
Danny
danwdoo
Cacti User
Posts: 50
Joined: Thu Oct 26, 2006 11:42 pm

Found the answer

Post by danwdoo »

Ok,
Looks like on the link you have to add a %20 in the place of the space. So for Chiang Mai in the URL you would put CHIANG%20MAI and it works. Hope this helps someone.

Danny
shelby
Posts: 1
Joined: Fri Sep 07, 2007 1:52 pm
Location: Los Angeles, Ca
Contact:

Post by shelby »

I was trying to get the .pl script to work and noticed that it was not properly graphing the Temp or Real Feel, I made some adjustments to the script and it works properly now. You can view the changes posted here
gippsweb
Posts: 5
Joined: Tue Mar 13, 2007 7:46 pm

Post by gippsweb »

I have been messing with this script on and off for the last few months, but cannot get it working properly.

When running the php file from the command line I get the following error at random intervals and it appears to stop cacti grabbing anything useful.

XML error: not well-formed (invalid token) at line 1

This happens occassionally, other times from the command line it give all the numbers needed, but appears to fail when called by cacti..

Any ideas???
gippsweb
Posts: 5
Joined: Tue Mar 13, 2007 7:46 pm

Post by gippsweb »

After much messing about, increasing the amount of memory allocated to php.ini ..

I'll keep an eye on it, but it currently appears to be graphing correctly now.
User avatar
zorrosam
Cacti User
Posts: 244
Joined: Thu May 03, 2007 3:17 pm
Location: Italy

problem!

Post by zorrosam »

Hi all,

when i launch the php i have this error message:

[root@ciclope scripts]# php -q accuweather.php
PHP Notice: Undefined index: PRESSURE in /var/www/cacti/scripts/accuweather.php on line 45
PHP Notice: Undefined index: TEMPERATURE in /var/www/cacti/scripts/accuweather.php on line 46
PHP Notice: Undefined index: REALFEEL in /var/www/cacti/scripts/accuweather.php on line 47
PHP Notice: Undefined index: HUMIDITY in /var/www/cacti/scripts/accuweather.php on line 48
PHP Notice: Undefined index: WINDGUSTS in /var/www/cacti/scripts/accuweather.php on line 49
PHP Notice: Undefined index: WINDSPEED in /var/www/cacti/scripts/accuweather.php on line 50
PHP Notice: Undefined index: VISIBILITY in /var/www/cacti/scripts/accuweather.php on line 51
PHP Notice: Undefined index: UVINDEX in /var/www/cacti/scripts/accuweather.php on line 52
temperature: humidity: windgusts: windspeed: visibility:

please help me

sam
terahz
Posts: 2
Joined: Mon Nov 26, 2007 1:29 pm

Post by terahz »

I've updated the original perl script to metric units and to work with the new accuweather setup, if someone is interested.

http://forums.cacti.net/viewtopic.php?p ... ht=#119746
k2exoman
Posts: 1
Joined: Mon Mar 10, 2008 3:19 pm
Location: New Mexico

quick question...

Post by k2exoman »

regarding creating the device, what do i use as the host address? the full weather string from the script? or just the main section www.aws.com??
User avatar
Simba7
Posts: 31
Joined: Tue Sep 11, 2007 10:56 am

Post by Simba7 »

Ok.. I'm having this problem..

Code: Select all

scratchansniff scripts # php -q accuweather.php

Warning: fopen(): URL file-access is disabled in the server configuration in /var/www/localhost/htdocs/cacti/scripts/accuweather.php on line 31

Warning: fopen(http://forecastfox.accuweather.com/adcbin/forecastfox/weather_data.asp?location=EUR;ES;SP014;MAZARRON;&metric=1&partner=forecastfox): failed to open stream: no suitable wrapper could be found in /var/www/localhost/htdocs/cacti/scripts/accuweather.php on line 31
could not open XML input
I'm wondering if I goofed up somewhere..
bonjurkes
Posts: 1
Joined: Fri Jun 27, 2008 9:12 am

Post by bonjurkes »

Hello,

I just installed accuweather template and script (i had some problems while installing weatherbug). I set my country settings from accuweather.php and uploaded it. Everything was working like a charm. Graph started to show temperature and others for 20 min, and after that it stopped graphing.

So there is a line at my graph showing 24 celcius for 20 mins and than nothing came after that.

I thought something going wrong, so i removed graphs and add it back again. And now it only shows nan, nothing more.

When i run accuweather.php from ssh , it shows the values as , temperature : 24 , humidity : 150 bla bla.

But it is not showing on graph. And my other graphs (load graphs etc) are working perfect.
User avatar
Simba7
Posts: 31
Joined: Tue Sep 11, 2007 10:56 am

Post by Simba7 »

..is there a way to convert the PHP script into a "Zip Code" type style?

I've been trying and it doesn't like it much.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests