WeatherBug script & templates

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

Moderators: Developers, Moderators

bltst2
Posts: 4
Joined: Tue Sep 12, 2006 3:54 pm

Post by bltst2 »

cmorford wrote:I'm having the same problem as qwertz. My processes are increasing indefinitely.

This has happened to me as well - any solution? I turned it off last night and the process numbers have flat lined. Certainly a problem with this script.
Attachments
graph_image.php.png
graph_image.php.png (17.71 KiB) Viewed 10183 times
rsaeks
Posts: 34
Joined: Mon Nov 06, 2006 5:15 pm

Post by rsaeks »

I really wouldn't mind using this script, but it doesn't seem to want to run from cacti. It runs fine manually as the Cacti user and sends the proper data.

Oh well ...
michael.williams
Posts: 30
Joined: Tue Oct 24, 2006 11:02 am

Post by michael.williams »

Ottomatic mentioned:

Step 7: Now... In all of the blanks that say... "get code from..." Go to that website and search for your code. Once have found the weather for your city. In the address bar there is a "?id=" and then there is a few letters... That is your code. Put that in all the blanks that say "get code from..." then click create at the bottom.

So, do I leave "?id" in the field before enterri ng the code? I'm getting null values for all.
ToeBee
Posts: 1
Joined: Thu Mar 15, 2007 9:28 am

Post by ToeBee »

I'm getting horrible gaps! See attached image.

The problem might be on the server side though. When the gaps happen I can run the script by hand and it outputs the following:

DewPoint:1.2 HeatIndex:1.2

and thats all. Going to the URL that the perl script tries to parse I get an error message:

Code: Select all

Site is Temporarily Unavailable 

The most current observation for the site you requested is more than 4 hours old. The closest sites to the one you selected with data available are listed below:
And when I click in my city it just redisplays the same page. So I'm not sure what is going on here but somehow the script seems to be getting a value of 1.2 somewhere that it is spitting out when this happens. Perhaps it needs a little more tweaking when it comes to error handling :)
Attachments
wind_gaps.png
wind_gaps.png (13.66 KiB) Viewed 9974 times
apperrault
Cacti User
Posts: 379
Joined: Fri Feb 16, 2007 11:37 am
Location: Emeryville, CA
Contact:

Post by apperrault »

i am having a problem locating the correct code for a site i have in Canada. I even have the Longitude and Latitude of the site, and i cannot locate a code for them. I have the Z code from the Weatherbug page, but i don't think that will work, will it?

thanks

app
[b]Cacti Version[/b] - 0.8.7b
[b]Plugin Architecture[/b] - 2.2 Beta
[b]Poller Type[/b] - CMD.php
[b]Server Info[/b] - Linux 2.6.9-78.0.1.ELsmp
[b]Web Server[/b] - Apache/2.0.52 (Red Hat)
[b]PHP[/b] - 4.3.9
[b]MySQL[/b] - 4.1.22
[b]RRDTool[/b] - 1.2.23
[b]SNMP[/b] - 5.1.2
[b]Plugins[/b][list]Global Plugin Settings (settings - v0.5)
SuperLinks (superlinks - v0.72)
Host Info (hostinfo - v0.2)
Report Creator (reports - v0.3)
Update Checker (update - v0.4)
Realtime for Cacti (realtime - v0.35)
Cacti Log View (clog - v1.1)
RRD File Cleaner (rrdclean - v0.36)
Network Discovery (discovery - v0.9)
Uptime (uptime - v0.4)[/list]
User avatar
evert
Posts: 27
Joined: Sun Sep 21, 2003 6:39 am
Location: Sarpsborg, Norway
Contact:

Post by evert »

davibou wrote:Hi all i'm new here

This is a verry good script but a problem for me i leave in France Dijon and don't find any weatherstation code to use

Can someone help ??

LFSD is the correct one for you 8)
Regards,
Evert Meulie
User avatar
evert
Posts: 27
Joined: Sun Sep 21, 2003 6:39 am
Location: Sarpsborg, Norway
Contact:

Re: No negative degrees Celsius

Post by evert »

hbokh wrote:
proohu01 wrote:hbokh, how did you get the perl script to output in °C instead of F? I use weatherbug.pl EHRD (For Rotterdam Airport) but get Temp:33.8 (would be nice two but it should be much less :D )

Or did you make any changes to the templates? If so, can you post them here?
Use "Units=1" in the URL in the script:

Code: Select all

my $httpaddr = "http://www.aws.com/aws_2001/asp/obsforecast.asp?Units=1&id=" . $ARGV[0];
Oh and don't forget to replace the F into C in the XML-template too.

Will that only fix the temperature? If yes, how to I change the windspeed from miles/hour to kms/hour? 8)
Regards,
Evert Meulie
User avatar
evert
Posts: 27
Joined: Sun Sep 21, 2003 6:39 am
Location: Sarpsborg, Norway
Contact:

Post by evert »

davibou wrote:Ok finally found a list for the entire world this is the link :))

http://adds.aviationweather.gov/metars/stations.txt

Check the list you will find your weather station code easly
Does not seem to be maintained. Use http://www.rap.ucar.edu/weather/surface/stations.txt instead 8)
Regards,
Evert Meulie
User avatar
evert
Posts: 27
Joined: Sun Sep 21, 2003 6:39 am
Location: Sarpsborg, Norway
Contact:

Post by evert »

Not all METAR-codes seem to work?

For example: NZSP is a valid METAR-code, but the WeatherBug script only returns 0's:

Code: Select all

DewPoint:0.0 Humidity:0.0 Temp:0.0 Wind:0.0 Pressure:0.00 Rain:0.00 HeatIndex:0.0
Regards,
Evert Meulie
Alives
Cacti User
Posts: 103
Joined: Mon Jul 11, 2005 11:39 am

Post by Alives »

Looks like you guys are in luck yet again.

I have been on cacti hiatus, but I am now back in the game. I started running this script again and got fed up with it.

The gaps are because of the aws site timing out. This causes the perl script to keep running, which explains why your processes keep going up. Run this to see:

Code: Select all

ps aux | grep perl
you can kill them with:

Code: Select all

killall perl
that will show you all your perl processes running trying to grab the data from that site. Cacti does a nasty job of cleaning up, and if it doesnt collect its data in a certain amount of time, it doesnt kill its child processes.

I have rewritten the script to use timeouts. The timeout is now user defined and will retry a set number of times if it is reached. I am graphing the # of tries now too to see if its something that happens at certain times during the day or if its just the certain weather code I chose.

I am not releasing this just yet, but it will be soon. I want to test it for a while first.

Any suggestions in the meantime?

BTW... no gaps in my graphs now!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Your effort is most appreciated
Reinhard
apperrault
Cacti User
Posts: 379
Joined: Fri Feb 16, 2007 11:37 am
Location: Emeryville, CA
Contact:

Post by apperrault »

I can't wait to see the new scripts!!!

Thanks

app
[b]Cacti Version[/b] - 0.8.7b
[b]Plugin Architecture[/b] - 2.2 Beta
[b]Poller Type[/b] - CMD.php
[b]Server Info[/b] - Linux 2.6.9-78.0.1.ELsmp
[b]Web Server[/b] - Apache/2.0.52 (Red Hat)
[b]PHP[/b] - 4.3.9
[b]MySQL[/b] - 4.1.22
[b]RRDTool[/b] - 1.2.23
[b]SNMP[/b] - 5.1.2
[b]Plugins[/b][list]Global Plugin Settings (settings - v0.5)
SuperLinks (superlinks - v0.72)
Host Info (hostinfo - v0.2)
Report Creator (reports - v0.3)
Update Checker (update - v0.4)
Realtime for Cacti (realtime - v0.35)
Cacti Log View (clog - v1.1)
RRD File Cleaner (rrdclean - v0.36)
Network Discovery (discovery - v0.9)
Uptime (uptime - v0.4)[/list]
User avatar
evert
Posts: 27
Joined: Sun Sep 21, 2003 6:39 am
Location: Sarpsborg, Norway
Contact:

Post by evert »

Alives wrote: I am not releasing this just yet, but it will be soon. I want to test it for a while first.

Any suggestions in the meantime?

BTW... no gaps in my graphs now!


May I volunteer as beta-tester? 8)
Regards,
Evert Meulie
Alives
Cacti User
Posts: 103
Joined: Mon Jul 11, 2005 11:39 am

Post by Alives »

I'll post some time today. Its looking good so far.
Alives
Cacti User
Posts: 103
Joined: Mon Jul 11, 2005 11:39 am

Post by Alives »

Locked

Who is online

Users browsing this forum: No registered users and 5 guests