WeatherBug script & templates

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

Moderators: Developers, Moderators

Frances
Cacti User
Posts: 60
Joined: Sun Apr 10, 2005 11:26 pm
Location: west coast

Post by Frances »

Codegrinder is using RRDtool 1.2.x, whereas it looks like you're using 1.0.x. 1.2.x is a bit slower, but much more attractive. Also, Oetiker managed some speed improvements in 1.2.10 which help with performance when the graphs are being drawn. The difference you see is the combination of additional options (font specification, for example) and anti-aliasing. FYI; RRD's touched by 1.2.x are not backwards compatible, so it's wise to back up your RRD's before upgrading.
meson3902
Posts: 1
Joined: Thu Sep 15, 2005 7:39 pm

Script runs 5 times

Post by meson3902 »

I imported the script but it runs 5 times, one for each measurement. what did I do wrong?
cdombroski
Posts: 1
Joined: Fri Nov 11, 2005 9:50 pm

Re: Script runs 5 times

Post by cdombroski »

meson3902 wrote:I imported the script but it runs 5 times, one for each measurement. what did I do wrong?
I had the same thing at first. What I did to fix was to delete graphs and data sources I had created. Then I created a datasource by hand (Management->Data Sources->Add), using WeatherBug for the data template and a host I already had defined as the host (apparently data sources don't work without hosts). Once you click create, it will allow you to input your weather code. Then I created the graphs by hand (Management->Graph Management->Add) using the appropriate templates and datasource. The graphs I choose not to associate with a host. Then I just added the graphs to the graph tree.
User avatar
hbokh
Posts: 40
Joined: Thu Feb 24, 2005 4:29 pm
Location: Groningen, NL

No negative degrees Celsius

Post by hbokh »

Now that we have a negative windchill here today, the script fails...

Code: Select all

# ./weatherbug.pl EHGG
DewPoint:0.0 Humidity:80.6 Temp:3.0 Wind:18.3 Pressure:94.82 Rain:0.00 HeatIndex:1.2
Whereas the site shows: WIND CHILL: -1.2 °C (wind chill and heat index are treated the same).
Is there a way to fix this in the script..?
This is my sick nature...
User avatar
proohu01
Posts: 45
Joined: Mon Dec 20, 2004 3:13 am
Location: The Netherlands

Re: No negative degrees Celsius

Post by proohu01 »

hbokh wrote:Now that we have a negative windchill here today, the script fails...

Code: Select all

# ./weatherbug.pl EHGG
DewPoint:0.0 Humidity:80.6 Temp:3.0 Wind:18.3 Pressure:94.82 Rain:0.00 HeatIndex:1.2
Whereas the site shows: WIND CHILL: -1.2 °C (wind chill and heat index are treated the same).
Is there a way to fix this in the script..?
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?
User avatar
hbokh
Posts: 40
Joined: Thu Feb 24, 2005 4:29 pm
Location: Groningen, NL

Re: No negative degrees Celsius

Post by hbokh »

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.

BTW: I've delete my weather-data, since it's of no use when the temperature goes down and in the graph it goes up... :cry:
This is my sick nature...
User avatar
proohu01
Posts: 45
Joined: Mon Dec 20, 2004 3:13 am
Location: The Netherlands

thnx

Post by proohu01 »

Simple! thnx.

EDIT:
My graph does go below "0". I changed the "Lower limit" in the graph template "Weatherbug - Temperature" to -40. And that seems to be workig as you can see below.
The weird thing is that only the temperature goes -1 and not the DewPoint....?? They should both be -1.
Attachments
ondernul.gif
ondernul.gif (19.68 KiB) Viewed 12870 times
cpdans
Posts: 43
Joined: Mon Oct 28, 2002 7:59 am

Post by cpdans »

Okay, I have the same problem here...site is showing at temp of 1.4F and a wind chill of -20.4F. The graph doesn't show the same....it shows the wind chill/heat index correctly, just in the positives. Not sure what to do, I would appreciate any help with this.

Dan
Attachments
graph_image.php.png
graph_image.php.png (35.93 KiB) Viewed 12815 times
Diceman
Cacti User
Posts: 142
Joined: Tue Oct 25, 2005 10:01 am

Post by Diceman »

i have this script working i suppose, it gives me

01/17/2006 08:30:04 PM - CMDPHP: Poller[0] Host[1] DS[107] WARNING: Result from CMD not valid. Partial Result:
01/17/2006 08:30:04 PM - CMDPHP: Poller[0] Host[1] DS[108] WARNING: Result from CMD not valid. Partial Result:

in my logs. my graphs also show NaN and wont populate. any ideas?
hermatize
Cacti User
Posts: 55
Joined: Wed Aug 10, 2005 6:29 pm

Post by hermatize »

Im having an issue when i add a weatherbug map it never prompts me to put in the special code when i create the graphs on the device.

Anyone have any ideas i appreciate the help

Thanks in advance !!!!
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

Weatherbug script

Post by paulbeard206 »

Code: Select all

CACTID: Host[11] DEBUG: The POPEN returned the following File Descriptor 9
CACTID: Host[11] ERROR: Empty result [red.paulbeard.org]: 'perl /usr/local/share/cacti/scripts/WeatherBug.pl'
CACTID: Host[11] DS[166] WARNING: Result from SCRIPT not valid. Partial Result: ...
CACTID: Host[11] DS[166] SCRIPT: perl /usr/local/share/cacti/scripts/WeatherBug.pl, output: U
doesn't work?

Code: Select all

/usr/local/share/cacti/scripts/WeatherBug.pl 
current_temp:44 wind_speed:3 barometer:30.33 humidity:40 high_temp:45 low_temp:28 dew_point_temp:21 wind_chill_temp:43
But I have no idea why.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Not sure on this, but cactid requires all output be done with one single print (cactid won't wait for another print that may occur). So please check the perl code for that.
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

it is one print statement

Post by paulbeard206 »

lvm wrote:Not sure on this, but cactid requires all output be done with one single print (cactid won't wait for another print that may occur). So please check the perl code for that.
Reinhard

Code: Select all

./WeatherBug.pl
current_temp:54 wind_speed:12 barometer:29.67 humidity:38 high_temp:59 low_temp:37 dew_point_temp:29 wind_chill_temp:50

Code: Select all

print "current_temp:" . $weather[3] . " wind_speed:" . $weather[5] . " barometer:" . $weather[10] . " humidity:" . 
        $weather[11] . " high_temp:" . $weather[12] . " low_temp:" . $weather[13] . " dew_point_temp:" . 
        $weather[14] . " wind_chill_temp:" . $weather[15];
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

If you're running the latest cactid, it requires /full/path/to/perlbinary
Reinhard
ottomatic
Posts: 10
Joined: Mon Mar 20, 2006 3:29 pm

Post by ottomatic »

Ok... After much frustration I figured out how this works.

Step 1: Import the template and copy the perl script to the scripts directory

Step 2: Make sure that in your Settings > Poller > Downed Host Detection is set to "Ping and SNMP"

Step 3: Devices and create a new host by clicking Add.

Step 4: Enter your description. Then your hostname... you can add a host that is pingable or 127.0.0.1. Then change the host template to "WeatherBug." then click create.

Step 5: Click on "Create Graphs for this Host"

Step 6: Then click on the types of weather you want to graph. I just checked them all.

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.

Step 8: Now go to your Graph Trees and add the host (the description is what you should look for) that we created earlier in step 1. Then wait for the poller go get the weather.
Locked

Who is online

Users browsing this forum: No registered users and 3 guests