WeatherBug script & templates
Moderators: Developers, Moderators
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.
Script runs 5 times
I imported the script but it runs 5 times, one for each measurement. what did I do wrong?
-
- Posts: 1
- Joined: Fri Nov 11, 2005 9:50 pm
Re: Script runs 5 times
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.meson3902 wrote:I imported the script but it runs 5 times, one for each measurement. what did I do wrong?
No negative degrees Celsius
Now that we have a negative windchill here today, the script fails...
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..?
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
Is there a way to fix this in the script..?
This is my sick nature...
Re: No negative degrees Celsius
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 )hbokh wrote:Now that we have a negative windchill here today, the script fails...
Whereas the site shows: WIND CHILL: -1.2 °C (wind chill and heat index are treated the same).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
Is there a way to fix this in the script..?
Or did you make any changes to the templates? If so, can you post them here?
Re: No negative degrees Celsius
Use "Units=1" in the URL in the script: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 )
Or did you make any changes to the templates? If so, can you post them here?
Code: Select all
my $httpaddr = "http://www.aws.com/aws_2001/asp/obsforecast.asp?Units=1&id=" . $ARGV[0];
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...
This is my sick nature...
thnx
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.
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 (19.68 KiB) Viewed 12879 times
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
Dan
- Attachments
-
- graph_image.php.png (35.93 KiB) Viewed 12824 times
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?
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?
-
- Cacti User
- Posts: 150
- Joined: Sat Jul 30, 2005 2:15 pm
Weatherbug script
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
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
-
- Cacti User
- Posts: 150
- Joined: Sat Jul 30, 2005 2:15 pm
it is one print statement
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];
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.
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.
Who is online
Users browsing this forum: No registered users and 1 guest