Showing off. [And now, tutorial too.]
Moderators: Developers, Moderators
Hi,
i've tried setting this up with cacti 0.8.5a, i changed weatherbug.pl to work correctly with my station ID (find your's here, thx to stephanb) and when i run it on the command line it "almost" (see below) returns the values i want to get.
My problem is the same then Peer, everything seems ok, but my rrd never get updated. I made the cron job mail me the result of the cmd.php and i got this for the 3 data sources i'm trying to use for now:
update /home/www/sysinfo/cacti-0.8.5a/rra/current_temp_96.rrd --template current_temp: N:1:5
ERROR: Template contains more DS definitions than RRD
update /home/www/sysinfo/cacti-0.8.5a/rra/high_temp_97.rrd --template :high_temp N:5:3
ERROR: unknown DS name ''
update /home/www/sysinfo/cacti-0.8.5a/rra/low_temp_98.rrd --template :low_temp N:5:1
ERROR: unknown DS name ''
I'm no RRDTool expert... so if any1 got a hint for me...
Also concerning the weatherbug.pl, it "almost" returns the values i want to get... well, i'm living in a cold country using metrical measure (yes, you guessed, Canada) and the current weatherbug.pl script strip the - sign from negative number, like -7° output as 7. I guess that the line that needs to be modified is "$output =~ s/[^0-9|\|]*//gi;" but i'm not really sure how, ain't too familiar with perl... if any1 got ANOTHER hint.... i'd really appreciate
Thx for your help...
i've tried setting this up with cacti 0.8.5a, i changed weatherbug.pl to work correctly with my station ID (find your's here, thx to stephanb) and when i run it on the command line it "almost" (see below) returns the values i want to get.
My problem is the same then Peer, everything seems ok, but my rrd never get updated. I made the cron job mail me the result of the cmd.php and i got this for the 3 data sources i'm trying to use for now:
update /home/www/sysinfo/cacti-0.8.5a/rra/current_temp_96.rrd --template current_temp: N:1:5
ERROR: Template contains more DS definitions than RRD
update /home/www/sysinfo/cacti-0.8.5a/rra/high_temp_97.rrd --template :high_temp N:5:3
ERROR: unknown DS name ''
update /home/www/sysinfo/cacti-0.8.5a/rra/low_temp_98.rrd --template :low_temp N:5:1
ERROR: unknown DS name ''
I'm no RRDTool expert... so if any1 got a hint for me...
Also concerning the weatherbug.pl, it "almost" returns the values i want to get... well, i'm living in a cold country using metrical measure (yes, you guessed, Canada) and the current weatherbug.pl script strip the - sign from negative number, like -7° output as 7. I guess that the line that needs to be modified is "$output =~ s/[^0-9|\|]*//gi;" but i'm not really sure how, ain't too familiar with perl... if any1 got ANOTHER hint.... i'd really appreciate
Thx for your help...
I am having the same problem. I think it has to do with how I set up the graphs but I tried alomost everything and it doesn't work. Right now mine looks like this:Peer wrote:Hi,
I was trying out the howto to get the weather graph's, from helzerr, but i got stuck.
My RRD seems not to get updated, no error's in the log file.
I keep comming up with several blank graph's
Anny idea of what i am doing wrong, or should i wait until helzerr finishes the howto.
<edit> 28-03-2004
Shoot me it is working ????????????
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Weather - Temperatures - Current" \
--rigid \
--base=1024 \
--height=120 \
--width=500 \
--upper-limit=120 \
--lower-limit=-20 \
--vertical-label="Degrees" \
DEF:a="/var/www/cacti/rra/current_temp_12.rrd":current_temp:AVERAGE \
CDEF:cdefa=a,1024,* \
AREA:cdefa#00FF00:"Current Temperature" \
GPRINTAVERAGE:"%8.0lf" \
GPRINTMIN:"%8.2lf %s" \
GPRINTMAX:"%8.2lf %s"
Re: Updating the graphs
I am having the same problem with the .rrd file not updating. From the logs, everything looks good, I ran a manual update with rrdtool and that worked but still no data on the graph. I checked the script and everything works fine.. I should also note that I added another line to the code to add a newline as the current weather script prints the data and tags system info at the end... *shrug*
Helzerr, any thoughts? Is there more to the HowTo or is that about it?
thanks,
--mark
Helzerr, any thoughts? Is there more to the HowTo or is that about it?
thanks,
--mark
I have a Windows tool called Achilles that can be used as an HTTP proxy (you can use it to see all HTTP messages between your PC and the web server). Using this tool I was able to see the exact station ID that WeatherBug was using and hence use that in the script.helzerr wrote:
** The script **
I began by modifying the weatherbug.pl script to reflect my zip code and station ID. I had to guess the station ID, as I could not find another means to obtain it.
Just thought I would pass this technique along.
Sys. Admin / Developer
Blank graphs?
I followed the tutorial but still get blank graphs... best way to troubleshoot?
Sys. Admin / Developer
Very informative and helpful tutorial on getting external scripts to work with cacti. I haven't tackled it on the weatherbug script as of yet, but did use it for a couple of custom scripts I came up with. To all those people who are coming up with blank graphs as I was for a little while: just play around with settings like crazy. You'll eventually find out where you may have gone wrong and will learn a whole lot more about how cacti works by doing so. Best of luck to you all and thanks again for this great thread.
Got it...
Mine is now reporting negative value's, at last.
Changed next line :
See the negative sign (-) before the "0-9".
Now it showing the correct (negative) temperature (it's freezing over here)
If it is not correct what i have done please let me know
Gr.
Mine is now reporting negative value's, at last.
Changed next line :
Code: Select all
$output =~ s/[^-0-9|\|]*//gi;
Now it showing the correct (negative) temperature (it's freezing over here)
If it is not correct what i have done please let me know
Gr.
- silicon_freak
- Posts: 20
- Joined: Tue Nov 25, 2003 4:29 pm
- Location: Heath, Oh
- Contact:
PEER!!! THANK YOU!
Your Output line fixed my long lasting problem...
http://cacti.siliconworksinc.net/graph. ... rra_id=all
http://cacti.alink.com/graph.php?local_ ... rra_id=all
Your Output line fixed my long lasting problem...
http://cacti.siliconworksinc.net/graph. ... rra_id=all
http://cacti.alink.com/graph.php?local_ ... rra_id=all
silicon_freak
http://www.siliconworksinc.net
http://www.siliconworksinc.net
- silicon_freak
- Posts: 20
- Joined: Tue Nov 25, 2003 4:29 pm
- Location: Heath, Oh
- Contact:
- silicon_freak
- Posts: 20
- Joined: Tue Nov 25, 2003 4:29 pm
- Location: Heath, Oh
- Contact:
Can someone that has the graph working please reply with the Graph Items?
i have done everything listed here (including the bug fix), and I only get empty graphs (no RRD errors).
This is how I setup my graph:
Thanks
i have done everything listed here (including the bug fix), and I only get empty graphs (no RRD errors).
This is how I setup my graph:
Code: Select all
Item # 1 (current_temp): Temperatures AREA AVERAGE FFC73B
Item # 2 (current_temp): Current: GPRINT LAST
Height: 120
Width: 500
Autoscale: Checked
Use --alt-autoscale-max
Autopadding: checked
Allow graph export: Checked
Upper limit: 120
Lower limit: -20
Base value: 1000
Vertical label: Degrees (F)
Any solutions to this? I am running into the exact same problem?kalto wrote:Hi,
i've tried setting this up with cacti 0.8.5a, i changed weatherbug.pl to work correctly with my station ID (find your's here, thx to stephanb) and when i run it on the command line it "almost" (see below) returns the values i want to get.
My problem is the same then Peer, everything seems ok, but my rrd never get updated. I made the cron job mail me the result of the cmd.php and i got this for the 3 data sources i'm trying to use for now:
update /home/www/sysinfo/cacti-0.8.5a/rra/current_temp_96.rrd --template current_temp: N:1:5
ERROR: Template contains more DS definitions than RRD
update /home/www/sysinfo/cacti-0.8.5a/rra/high_temp_97.rrd --template :high_temp N:5:3
ERROR: unknown DS name ''
update /home/www/sysinfo/cacti-0.8.5a/rra/low_temp_98.rrd --template :low_temp N:5:1
ERROR: unknown DS name ''
I'm no RRDTool expert... so if any1 got a hint for me...
Also concerning the weatherbug.pl, it "almost" returns the values i want to get... well, i'm living in a cold country using metrical measure (yes, you guessed, Canada) and the current weatherbug.pl script strip the - sign from negative number, like -7° output as 7. I guess that the line that needs to be modified is "$output =~ s/[^0-9|\|]*//gi;" but i'm not really sure how, ain't too familiar with perl... if any1 got ANOTHER hint.... i'd really appreciate
Thx for your help...
I found out my problem. The weatherbug.pl script needed an space before current_temp.
Old code
new code
Old code
Code: Select all
#! /perl/bin
$output = `c:/cygwin/bin/bash -c 'wget --quiet -O - \"http:\/\/wisapidata.weatherbug.com\/WxDataISAPI\/WxDataISAPI.dll?Magic=10991&RegNum=3647055&ZipCode=95683&StationID=KMHR&Units=0&Version=2.7&Fore=1&t=1015084854\/"'`;
$output =~ s/[^0-9|\|]*//gi;
@weather = split(/\|/, $output);
# docs
# [0] - ID?
# [1] - Current Time
# [2] - Current Date
# [3] - Current Temperature
# [5] - Wind Speed (MPH)
# [7] - Gust Wind Speed (MPH)
# [10] - Barometer (Moisture)
# [11] - Humidity (%)
# [12] - High Tempurature
# [13] - Low Temperature
# [14] - Dew Point
# [15] - Wind Chill
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];
Code: Select all
#! /perl/bin
$output = `c:/cygwin/bin/bash -c 'wget --quiet -O - \"http:\/\/wisapidata.weatherbug.com\/WxDataISAPI\/WxDataISAPI.dll?Magic=10991&RegNum=3647055&ZipCode=95683&StationID=KMHR&Units=0&Version=2.7&Fore=1&t=1015084854\/"'`;
$output =~ s/[^0-9|\|]*//gi;
@weather = split(/\|/, $output);
# docs
# [0] - ID?
# [1] - Current Time
# [2] - Current Date
# [3] - Current Temperature
# [5] - Wind Speed (MPH)
# [7] - Gust Wind Speed (MPH)
# [10] - Barometer (Moisture)
# [11] - Humidity (%)
# [12] - High Tempurature
# [13] - Low Temperature
# [14] - Dew Point
# [15] - Wind Chill
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];
Who is online
Users browsing this forum: No registered users and 1 guest