WeatherBug script & templates version 3.0 (weatherbug AP

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

Moderators: Developers, Moderators

User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

Post by chrisgapske »

OK I am lost on how you install this .. The included directions are a bit hard to follow. Seeing there are no directions.

I could use just a little help installing and using this.



OK Well I can see that the xml file is not a template.
Error: XML parse error.


I put the script in cacti/scripts/..

And than what ?
Dillweed
Posts: 1
Joined: Wed Jun 11, 2008 1:00 pm

Fix for XML error

Post by Dillweed »

Let me premise my post with the fact that I'm not a programmer, but a huge tinker'er. So if there is something wrong, oh well, you're on your own.

Anyways, I was also getting the XML parse error when I was importing the template. I found that the Degree symbol for the temperature in the xml file was giving my linux system the fits. It must be something that I'm missing in my distro. Anyways, I removed the degree symbol and it imported just fine.

I've attached it to the post so hopefully it works for you all out there.
Attachments
cacti_host_template_weatherbug_174.xml
(41.1 KiB) Downloaded 1005 times
User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

Post by chrisgapske »

I am having the Very Same issue.
mvaughn
Posts: 1
Joined: Thu Jun 19, 2008 12:15 pm

Post by mvaughn »

I've setup the script and it's creating graphs, but the data doesn't seem to be correct. When I run the script from a command line the data is accurate but the graphs are wrong.

Code: Select all

[root@anubis scripts]# perl ./weatherbug_api.pl A3651xxxxxx 98550
DewPoint:46 Temp:55.4 Humidity:71 Wind:0 FeelsLike:55 Rain:0.00 Pressure:30.17
Attachments
humidity98550.JPG
humidity98550.JPG (26.11 KiB) Viewed 9470 times
temp98550.JPG
temp98550.JPG (29.99 KiB) Viewed 9470 times
User avatar
Simba7
Posts: 31
Joined: Tue Sep 11, 2007 10:56 am

Post by Simba7 »

Here's a fix to the weatherbug_api.pl script. I noticed that I was constantly getting large gaps in my graphs. Well, I decided to run it in my browser and received "Access Denied" when the page loaded.

So, I looked through it and did some changes. Here's the change you need to do:

You need to change

Code: Select all

my $httpaddr = "http://$ARGV[0].api.wxbug.net/getLiveWeatherRSS.aspx?ACode=$ARGV[0]&citycode=$ARGV[1]&unittype=0";
to

Code: Select all

my $httpaddr = "http://api.wxbug.net/getLiveWeatherRSS.aspx?ACode=$ARGV[0]&zipcode=$ARGV[1]&unittype=0";
User avatar
Simba7
Posts: 31
Joined: Tue Sep 11, 2007 10:56 am

Post by Simba7 »

Is there a way to include a few features from the weatherbug.pl script?

I'm noticing a large string of data, but still trying to decode it.
http://wisapidata.weatherbug.com/WxData ... 015084854/

Code: Select all

10991|4:11:00p|12/13/2008|-2|29|17|3|37|0.00"|0.00"/h|29.78s|84%|28°|-2°|-6°|-23°|0.00"|+0.0|+0.0|+0.00"/h|85.0|77.0|29.78"|29.21"|0.00"/h|8:53a|30|17|-0°|-53|0|0.00"|+0.0°/h|+0.0|+0.0|Billings Logan International Airport|Billings, MT|300|3600|
Plus, this script doesn't work when the temperature reaches below zero. It's currently -9F here and all it says is 'nan'.
cryogen
Posts: 1
Joined: Mon Jan 26, 2009 12:10 pm

Bug - Negative temperatures don't display correctly

Post by cryogen »

When the temperature drops below zero the temperature graph stops displaying any values at all.

When I run the script (it's currently below zero here):

Code: Select all

./weatherbug_api.pl myapicode 00000
Humidity:89 Wind:0 Rain:0.00 Pressure:30.32
But with a different zip (and above zero temps):

Code: Select all

./weatherbug_api.pl myapicode 00001
DewPoint:6 Temp:10.0 Humidity:82 Wind:0 FeelsLike:10 Rain:0.00 Pressure:30.4 
I've attached the modified the script to fix this. It now displays:

Code: Select all

./weatherbug_api.pl myapicode 00000
DewPoint:-10 Temp:-8.0 Humidity:89 Wind:0 FeelsLike:-8 Rain:0.00 Pressure:30.32 
and:

Code: Select all

./weatherbug_api.pl myapicode 00001
DewPoint:6 Temp:10.0 Humidity:82 Wind:0 FeelsLike:10 Rain:0.00 Pressure:30.4
I've also incorporated the fix for the "Access Denied" error that Simba7 posted above since that appears to be required for the script to work.

It appears to be working and the graph is displaying now. However, it's still morning so I might have missed something. :D
Attachments
weatherbug_api.pl
weatherbug_api.pl script modified to register negative temperatures correctly
(1.1 KiB) Downloaded 590 times
fsd
Posts: 21
Joined: Sat Jul 23, 2005 12:26 am

Post by fsd »

anyone else getting an error when trying to find a city code?

http://api.wxbug.net/getLocationsXML.as ... ring=Perth

and

http://code.api.wxbug.net/getLocationsX ... ring=Perth

replacing 'code' with the personal api code given, generates an 'access denied' message
fsd
Posts: 21
Joined: Sat Jul 23, 2005 12:26 am

Post by fsd »

nevermind, seems to be ok now, codes must have to be manually approved
Gunnar
Posts: 14
Joined: Wed Jun 24, 2009 10:38 am

Re: WeatherBug script & templates version 3.0 (weatherbu

Post by Gunnar »

Alives wrote:Previous versions of this script here:
2.0: http://forums.cacti.net/viewtopic.php?t=22691
1.0: http://forums.cacti.net/viewtopic.php?t=8821

You must register for the WeatherBug API Code in order to use this template/script. This is a much better way of polling the weatherbug data and is approved by them.

Register for your API Code here: http://apireg.weatherbug.com/defaultAPI.aspx

Place the script in your cacti/scripts/ directory and make sure it is executable.
Am I correct in assuming that this script is working only on a Linux Cacti Box? I am running a Windows Cacti Box and the graph is not populating with data.

I am pretty new to this and appreciate some help.

Thanks
davibou
Posts: 6
Joined: Mon Feb 05, 2007 11:48 am

Post by davibou »

I have updated to Version 0.8.7e and i have debug the perl script for working with metrics values

Here we go !!!

exemple http://trueweb.fr/meteo.html
Attachments
weatherbug_api.pl
the script now work properly with metrics value
(1.13 KiB) Downloaded 532 times
cacti_graph_template_weatherbug.zip
my exported templates
(13.88 KiB) Downloaded 478 times
bluesocks
Posts: 1
Joined: Tue Sep 15, 2009 9:37 pm

No love

Post by bluesocks »

davibou wrote:I have updated to Version 0.8.7e and i have debug the perl script for working with metrics values

Here we go !!!

exemple http://trueweb.fr/meteo.html
I tried the first script, and templates posted and this worked in that I did not receive any errors. However, it seems like I'm not getting any data in my graph. I would be very thankful if there were any suggestions as to why.
Attachments
Also, I get this kind of message in my log file over and over.
Also, I get this kind of message in my log file over and over.
cacti.JPG (113.07 KiB) Viewed 7060 times
graph.JPG
graph.JPG (82.49 KiB) Viewed 7088 times
davibou
Posts: 6
Joined: Mon Feb 05, 2007 11:48 am

Post by davibou »

get my templates and my modified perl script

if you try the templates in the first post and my perl script it will not work!!!

please erase the templates and data and test to add my templates and my perl script and also try to test if the perl script return you any data

login to the console as root or with a user who as execute rights go to the cacti scripts directory and try this

./weatherbug_api.pl XXXXXXXXX YYYYY

Where
XXXXXXX is your register code @wheatherbug
YYYYY is your météo station code

you should have an answer like this
DewPoint:15.5555555555556 Temp:19.0 Humidity:82 Wind:11 FeelsLike:19 Rain:0.00 Pressure:1014.9


Regards David
szastan
Posts: 4
Joined: Sun Dec 20, 2009 7:02 am
Location: Gdansk, Poland

Post by szastan »

Hi, I have other problem, only graph that generates and show data is one showing pressure, others don't show up. I've used last script and templates posted in this thread. Anyone with similar problem? Oh, console shows:

Code: Select all

perl weatherbug_api.pl A4338164343 72869
Temp:-14.0 Humidity:78 Wind:7 FeelsLike:-19 Rain:0.00 Pressure:1002.03
kels0
Posts: 8
Joined: Wed Dec 23, 2009 2:35 pm

Post by kels0 »

Weird one for ya, got everything running finally, have a couple graphs that are not graphing the correct data.

Any ideas what i need to do to fix this?

thanks in advance.
Attachments
Screen shot 2009-12-23 at 2.30.20 PM.png
Screen shot 2009-12-23 at 2.30.20 PM.png (45.55 KiB) Viewed 6262 times
Screen shot 2009-12-23 at 2.30.28 PM.png
Screen shot 2009-12-23 at 2.30.28 PM.png (13.71 KiB) Viewed 6262 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests