WeatherBug script & templates version 3.0 (weatherbug AP
Moderators: Developers, Moderators
WeatherBug script & templates version 3.0 (weatherbug AP
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.
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.
- Attachments
-
- weatherbug_api.pl
- (1020 Bytes) Downloaded 2049 times
-
- cacti_host_template_weatherbug.xml
- (41.1 KiB) Downloaded 2856 times
Do you have some instructions on how to actually set this up?
Ive registered and got my API code, what do i do with it?
How should the perl script be executed or is that done by the poller
running
perl weatherbug_api.pl
Use of uninitialized value in concatenation (.) or string at weatherbug_api.pl line 6.
Use of uninitialized value in concatenation (.) or string at weatherbug_api.pl line 6.
Use of uninitialized value in concatenation (.) or string at weatherbug_api.pl line 6.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 12.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 13.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 14.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 15.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 16.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 17.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 18.
gives me this ??
Ive registered and got my API code, what do i do with it?
How should the perl script be executed or is that done by the poller
running
perl weatherbug_api.pl
Use of uninitialized value in concatenation (.) or string at weatherbug_api.pl line 6.
Use of uninitialized value in concatenation (.) or string at weatherbug_api.pl line 6.
Use of uninitialized value in concatenation (.) or string at weatherbug_api.pl line 6.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 12.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 13.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 14.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 15.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 16.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 17.
Use of uninitialized value in pattern match (m//) at weatherbug_api.pl line 18.
gives me this ??
Weatherbug for use where zipcode isnt available and/or using metric units:
http://{api code}.api.wxbug.net/getLocationsXML.aspx?ACode={api code}&SearchString={city name}
Example: http://A1111111111.api.wxbug.net/getLoc ... String=San Francisco
Just make sure you substitute in your api code that you received in email. This will return all the city codes found.
I have attached the new WeatherBug Metric template below and the weatherbug_api_metric.pl script below. You will need both of these to run the Metric mode using city code.
If you want to use english units and a city code, you just need to download the 2nd script called weatherbug_api.pl You do not need the template file for this to work. This script is to be used in place of the previous script in the first post. This script uses the template from the first post.
Place the script you are using in your <cacti path>/scripts/ directory and give it execute permissions.
You can do a cityCode lookup here:Register for your API Code here: http://apireg.weatherbug.com/defaultAPI.aspx
http://{api code}.api.wxbug.net/getLocationsXML.aspx?ACode={api code}&SearchString={city name}
Example: http://A1111111111.api.wxbug.net/getLoc ... String=San Francisco
Just make sure you substitute in your api code that you received in email. This will return all the city codes found.
I have attached the new WeatherBug Metric template below and the weatherbug_api_metric.pl script below. You will need both of these to run the Metric mode using city code.
If you want to use english units and a city code, you just need to download the 2nd script called weatherbug_api.pl You do not need the template file for this to work. This script is to be used in place of the previous script in the first post. This script uses the template from the first post.
Place the script you are using in your <cacti path>/scripts/ directory and give it execute permissions.
- Attachments
-
- weatherbug_api_metric.pl
- weatherbug_api.pl -> uses country code and METRIC units, YOU ALSO NEED THE NEW TEMPLATE
- (1.02 KiB) Downloaded 1019 times
-
- weatherbug_api.pl
- weatherbug_api.pl -> uses city code and english units, no new template needed.
- (1021 Bytes) Downloaded 767 times
-
- cacti_host_template_weatherbug_metric.xml
- New Metric Weatherbug template
- (41.74 KiB) Downloaded 1371 times
Last edited by Alives on Mon Apr 21, 2008 1:30 pm, edited 3 times in total.
-
- Posts: 4
- Joined: Sat Apr 19, 2008 3:32 am
I have setup script and pl file but graph don`t appear.
I post error code.
I test metric and not metric script.
I testet with city code, and this code that I`ve posted is with non metric script and with zip code.
But the error is still there.
And for any graph that i make it collect all data as shown.
I post error code.
Code: Select all
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Vrsac - Humidity" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit=100 \
--lower-limit=0 \
--vertical-label="%" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/usr/share/cacti/rra/vrsac_feelslike_288.rrd":Humidity:LAST \
DEF:b="/usr/share/cacti/rra/vrsac_feelslike_288.rrd":Humidity:AVERAGE \
DEF:c="/usr/share/cacti/rra/vrsac_feelslike_288.rrd":Humidity:MAX \
AREA:a#157419FF:"Humidity\n" \
GPRINT:a:LAST:"Current\:%8.2lf %s" \
GPRINT:b:MIN:"Minimum\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:c:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:
ERROR: the RRD does not contain an RRA matching the chosen CF
I testet with city code, and this code that I`ve posted is with non metric script and with zip code.
But the error is still there.
And for any graph that i make it collect all data as shown.
Code: Select all
Data Source Debug
/usr/bin/rrdtool create \
/usr/share/cacti/rra/vrsac_feelslike_290.rrd \
--step 300 \
DS:Pressure:GAUGE:600:0:1000 \
DS:Temp:GAUGE:600:-200:200 \
DS:Rain:GAUGE:600:0:500 \
DS:WindSpeed:GAUGE:600:0:1000 \
DS:Humidity:GAUGE:600:0:100 \
DS:FeelsLike:GAUGE:600:-200:200 \
DS:DewPoint:GAUGE:600:-200:200 \
RRA:AVERAGE:0.5:1:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:500 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
Cancel
Ok
So ive setup a city and created all the graphs with the correct API code and City Code
How exactly should the perl script be executed ?
Should i execute it with the city code and API code at the command line to create the graphs?
Do i execute it every 1 minute 5 minutes via cron, or is the cacti poller going to do it for me ?
How is the data polled?
Shouldn't running the perl script create the graphs, or is that merely creating the data which then cacti's poller ( which should be running from cron every 5 minutes ) should pick up and create the rrd files ?
So ive setup a city and created all the graphs with the correct API code and City Code
How exactly should the perl script be executed ?
Should i execute it with the city code and API code at the command line to create the graphs?
Do i execute it every 1 minute 5 minutes via cron, or is the cacti poller going to do it for me ?
How is the data polled?
Shouldn't running the perl script create the graphs, or is that merely creating the data which then cacti's poller ( which should be running from cron every 5 minutes ) should pick up and create the rrd files ?
Sorry about that I had a typo in the metric script. Basically change the 0 in &unittype=0 to a 1: &unittype=1 on line 6, or re-download the script and it will work.
perl /tmp/weatherbug_api.pl A3451207554 W48564
DewPoint:24 Temp:27.0 Humidity:83 Wind:5 FeelsLike:31 Rain:0.0 Pressure:1008.13
Sorry about that
perl /tmp/weatherbug_api.pl A3451207554 W48564
DewPoint:24 Temp:27.0 Humidity:83 Wind:5 FeelsLike:31 Rain:0.0 Pressure:1008.13
Sorry about that
Who is online
Users browsing this forum: No registered users and 2 guests