WeatherBug script & templates version 2.0
Moderators: Developers, Moderators
problem with data (nan value)
Sorry,
the scripts weatherbug.perl works well .. even if i have no data in my cacti graph. (nan) Can you help me?
The log is ok:
0/02/2007 04:40:13 PM - CACTID: Poller[0] Host[1] DS[8062] SCRIPT: perl /var/www/cacti/scripts/weatherbug.pl get code from http://www.aws.com/aws_2001/asp/getLiveWeather.asp , output: current_temp:26 wind_speed:5 barometer:1019.98 humidity:47 high_temp:26 low_temp:12 dew_point_temp:14 wind_chill_temp:27
please help me
the scripts weatherbug.perl works well .. even if i have no data in my cacti graph. (nan) Can you help me?
The log is ok:
0/02/2007 04:40:13 PM - CACTID: Poller[0] Host[1] DS[8062] SCRIPT: perl /var/www/cacti/scripts/weatherbug.pl get code from http://www.aws.com/aws_2001/asp/getLiveWeather.asp , output: current_temp:26 wind_speed:5 barometer:1019.98 humidity:47 high_temp:26 low_temp:12 dew_point_temp:14 wind_chill_temp:27
please help me
how does this work with proxy server? I have a proxy server that requires authentication as well.
however, i dont even get error on command line:
[root@intranet scripts]# ./weatherbug.pl KEWR
[root@intranet scripts]#
Thanks!
Just as a test, it does work fine on my non-public server:
[jweinraub@rockhopper:~]
$ ./weatherbug.pl KEWR
Tries:1 Humidity:56.0 FeelsLike:22.8 Wind:14.8 DewPoint:13.8 Temp:22.8 Rain:0.00 Pressure:102.74
however, i dont even get error on command line:
[root@intranet scripts]# ./weatherbug.pl KEWR
[root@intranet scripts]#
Thanks!
Just as a test, it does work fine on my non-public server:
[jweinraub@rockhopper:~]
$ ./weatherbug.pl KEWR
Tries:1 Humidity:56.0 FeelsLike:22.8 Wind:14.8 DewPoint:13.8 Temp:22.8 Rain:0.00 Pressure:102.74
-
- Cacti User
- Posts: 87
- Joined: Fri Mar 09, 2007 12:35 pm
okay i got it to work finally.
if anybody else is in my scenario this is what i did:
if anybody else is in my scenario this is what i did:
Code: Select all
#!/usr/bin/perl
use warnings;
#use strict;
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->proxy(['http', 'ftp'] => 'http://jweinraub:password@proxy:8080');
# ... snip ...
my $req = new HTTP::Request('GET', $httpaddr);
$content = $ua->request($req)->as_string;
problems!
Hi all!
i have configured these ... script more template for milan(italy)
When i launch the scripts the data are get in the correct way ... cacti from log launch the script correctly .... but hav no graph in my installation?
any idea?
any help is appreciate.
sam
i have configured these ... script more template for milan(italy)
When i launch the scripts the data are get in the correct way ... cacti from log launch the script correctly .... but hav no graph in my installation?
any idea?
any help is appreciate.
sam
help
sorry sir!evert wrote:Found it!
Some of the variables like mph & "Hg that are used on the AWS site are hard-coded in weatherbug.pl.
The following alterations will make it work for the Metric system:
of course, but also:Code: Select all
my $httpaddr = "http://www.aws.com/aws_2001/asp/obsforecast.asp?units=1&id=" . $ARGV[0];
Code: Select all
# regex in html source order if ($_ =~ /Temperature\(\DC\)\s(-?\d+?\.\d+?)\s/g) { $data{Temp} = $1; } if ($_ =~ /Humidity\s\(\D\)\s(\d+?\.\d+?)\s/g) { $data{Humidity} = $1; } if ($_ =~ /Wind\s\(kph\).+?(\d+?\.\d+?)\s/g) { $data{Wind} = $1; } if ($_ =~ /Daily\sRain\s\(cm\)\s(\d+?\.\d+?)\s/g) { $data{Rain} = $1; } if ($_ =~ /Pressure\s\(kPa\)\s(\d+?\.\d+?)\s/g) { $data{Pressure} = $1; } if ($_ =~ /(HEAT INDEX|WIND CHILL):(\d+?\.\d+?)\s/g) { $data{FeelsLike} = $2; } if ($_ =~ /DEW\sPOINT:\s(\d+?\.\d+?)\s/g) { $data{DewPoint} = $1; }
can you explain me wich is the file that i have to change?
sam
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
I made those changes and adjusted the Graph Templates as well.
I decided to use the METAR Code as a Hostname (e.g. EDDM for Munic Airport) to avoid being prompted for the METAR Code for each Graph Template. You will avoid entering a community string and this deactivates Host Availability checking.
I renamed the script to avoid misunderstanding.
Reinhard
Updated the XML for the Templates. Requires at least cacti 0.8.6j
I decided to use the METAR Code as a Hostname (e.g. EDDM for Munic Airport) to avoid being prompted for the METAR Code for each Graph Template. You will avoid entering a community string and this deactivates Host Availability checking.
I renamed the script to avoid misunderstanding.
Reinhard
Updated the XML for the Templates. Requires at least cacti 0.8.6j
- Attachments
-
- cacti_host_template_weatherbug-metric.xml
- Corrected Templates; no need to define LAST consolidation function
- (45.17 KiB) Downloaded 603 times
-
- weatherbug-metric.pl
- The Script
- (1.19 KiB) Downloaded 507 times
Dead Weather Bug?
Did anyone else's weather bug stop working?
"http://www.aws.com/aws_2001/asp/obsforecast.asp?id="
need so be changed to
"http://www.aws.com/obsforecast.asp?id="
And Works Fine after i edit the weatherbug.pl
need so be changed to
"http://www.aws.com/obsforecast.asp?id="
And Works Fine after i edit the weatherbug.pl
If you want to use a zip code, you can also usemicro98 wrote:"http://www.aws.com/aws_2001/asp/obsforecast.asp?id="
need so be changed to
"http://www.aws.com/obsforecast.asp?id="
And Works Fine after i edit the weatherbug.pl
Code: Select all
http://www.aws.com/obsforecast.asp?&zipcode=
-
- Cacti User
- Posts: 379
- Joined: Fri Feb 16, 2007 11:37 am
- Location: Emeryville, CA
- Contact:
Does the zip code work for Canadian Zip codes as well? I am having a hell of a time locating the correct code for two of my offices in Canada.
just wondering if i could use this instead.
app
just wondering if i could use this instead.
app
[b]Cacti Version[/b] - 0.8.7b
[b]Plugin Architecture[/b] - 2.2 Beta
[b]Poller Type[/b] - CMD.php
[b]Server Info[/b] - Linux 2.6.9-78.0.1.ELsmp
[b]Web Server[/b] - Apache/2.0.52 (Red Hat)
[b]PHP[/b] - 4.3.9
[b]MySQL[/b] - 4.1.22
[b]RRDTool[/b] - 1.2.23
[b]SNMP[/b] - 5.1.2
[b]Plugins[/b][list]Global Plugin Settings (settings - v0.5)
SuperLinks (superlinks - v0.72)
Host Info (hostinfo - v0.2)
Report Creator (reports - v0.3)
Update Checker (update - v0.4)
Realtime for Cacti (realtime - v0.35)
Cacti Log View (clog - v1.1)
RRD File Cleaner (rrdclean - v0.36)
Network Discovery (discovery - v0.9)
Uptime (uptime - v0.4)[/list]
[b]Plugin Architecture[/b] - 2.2 Beta
[b]Poller Type[/b] - CMD.php
[b]Server Info[/b] - Linux 2.6.9-78.0.1.ELsmp
[b]Web Server[/b] - Apache/2.0.52 (Red Hat)
[b]PHP[/b] - 4.3.9
[b]MySQL[/b] - 4.1.22
[b]RRDTool[/b] - 1.2.23
[b]SNMP[/b] - 5.1.2
[b]Plugins[/b][list]Global Plugin Settings (settings - v0.5)
SuperLinks (superlinks - v0.72)
Host Info (hostinfo - v0.2)
Report Creator (reports - v0.3)
Update Checker (update - v0.4)
Realtime for Cacti (realtime - v0.35)
Cacti Log View (clog - v1.1)
RRD File Cleaner (rrdclean - v0.36)
Network Discovery (discovery - v0.9)
Uptime (uptime - v0.4)[/list]
It does work, but I decided to use Environment Canada's Weather Office pages instead.apperrault wrote:Does the zip code work for Canadian Zip codes as well? I am having a hell of a time locating the correct code for two of my offices in Canada.
just wondering if i could use this instead.
app
See the attached templates and perl script.
Works the same as the Weather Bug templates, except there's no Rainfall graph. I did however add a graph for 'visibility' as it's listed on the Weather Office pages.
To find your weather code, go to http://text.www.weatheroffice.gc.ca/canada_e.html and find the city you want to graph weather for.
Once you're at the page, copy the first argument to the page and use it as your location code.
For example, I'm in Ottawa, so my URL is:
http://text.www.weatheroffice.gc.ca/for ... 118&unit=m
This makes my Code: on-118
If you want Imperial units, change the last M to an I in the perl script and you're off to the races. You'll also have to change the legends and descriptors in the graphs to represent °F, MPH and wind speed and pressure.
- Attachments
-
- Weather Office host template.xml
- Host Template for Weather Office graphs
- (49.85 KiB) Downloaded 562 times
-
- weatheroffice.pl
- Perl script to pick up the data from EC's Weather Office pages
- (1.83 KiB) Downloaded 354 times
Who is online
Users browsing this forum: No registered users and 2 guests