Showing off. [And now, tutorial too.]

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

kalto
Posts: 4
Joined: Thu Apr 08, 2004 9:42 pm

Post by kalto »

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...
stoopinc
Posts: 11
Joined: Wed Apr 14, 2004 9:27 pm
Location: Boulder, CO

Post by stoopinc »

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 :cry:

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 ????????????
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:

/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" \
GPRINT:a:AVERAGE:"%8.0lf" \
GPRINT:a:MIN:"%8.2lf %s" \
GPRINT:a:MAX:"%8.2lf %s"
mvendl
Posts: 1
Joined: Fri Jul 02, 2004 11:09 am

Re: Updating the graphs

Post by mvendl »

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
User avatar
symbiat
Posts: 11
Joined: Sun Jul 04, 2004 1:39 pm
Contact:

Post by symbiat »

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.
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.

Just thought I would pass this technique along.
Sys. Admin / Developer
User avatar
symbiat
Posts: 11
Joined: Sun Jul 04, 2004 1:39 pm
Contact:

Blank graphs?

Post by symbiat »

I followed the tutorial but still get blank graphs... best way to troubleshoot?
Sys. Admin / Developer
maxpower
Posts: 3
Joined: Mon Jul 12, 2004 2:27 pm

Post by maxpower »

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. :D Best of luck to you all and thanks again for this great thread.
Peer
Posts: 4
Joined: Thu Mar 25, 2004 11:17 am
Location: Netherlands

Post by Peer »

Got it...

Mine is now reporting negative value's, at last.
Changed next line :

Code: Select all

$output =~ s/[^-0-9|\|]*//gi;
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.
User avatar
silicon_freak
Posts: 20
Joined: Tue Nov 25, 2003 4:29 pm
Location: Heath, Oh
Contact:

Post by silicon_freak »

silicon_freak
http://www.siliconworksinc.net
Peer
Posts: 4
Joined: Thu Mar 25, 2004 11:17 am
Location: Netherlands

Post by Peer »

Glad to be at help.
It caused me a lot of pain in the head, but i got it with trail and error.
I hope it is an definit sollution. :D
User avatar
silicon_freak
Posts: 20
Joined: Tue Nov 25, 2003 4:29 pm
Location: Heath, Oh
Contact:

Post by silicon_freak »

We should prolly submit it as a bug fix >:)

CC
silicon_freak
http://www.siliconworksinc.net
User avatar
silicon_freak
Posts: 20
Joined: Tue Nov 25, 2003 4:29 pm
Location: Heath, Oh
Contact:

Post by silicon_freak »

Bugfix submitted with revision information!


http://bugs.cacti.net/view.php?id=380

Thx again peer!
silicon_freak
http://www.siliconworksinc.net
Guest

Post by Guest »

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:

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)

Thanks
mmcguire

Post by mmcguire »

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...
Any solutions to this? I am running into the exact same problem?
mmcguire

Post by mmcguire »

I found out my problem. The weatherbug.pl script needed an space before current_temp.

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];

new 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];

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest