WeatherBug script & templates

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

qwertz
Cacti User
Posts: 98
Joined: Thu Feb 16, 2006 9:20 am

Post by qwertz »

Hello,
The script is working well for me BUT,

I had to remove it because the perl session stayed ESTABLISHED. it means i had a growing number of TCP ESTABLISHED session, and of course the number of my processes were growing permanently.

Do you know why the TCP sessions kept ESTABLISHED?

REgards

Qwertz
Diceman
Cacti User
Posts: 142
Joined: Tue Oct 25, 2005 10:01 am

Post by Diceman »

my graphs are working but i get quite a few gaps. at first my internet connection was dying so i thought it was because the internet died all the time. the connection is working fine now but i am still getting random gaps in the graph. perhaps it is bandwidth related, or that the AWS site times out. anyone else experiencing these problems? i have tried two different weatherstations in my area, one for the international airport and one for a local tv weather station. i find it hard to believe that their weather equipment doesnt respond but im at a loss as to why the gaps are still showing up.
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Post by Diggit2001 »

I was using this script successfully on my Windows installation of Cacti, but I recently loaded a new server with CactiEZ and am making the move to the world of Linux. When I add this stuff to my CactiEZ install, the poller logs have this:


05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] DS[535] WARNING: Result from SCRIPT not valid. Partial Result: ...
05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] ERROR: Empty result [127.0.0.1]: 'perl /var/www/html/scripts/WeatherBug.pl MARIT'
05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] DS[534] WARNING: Result from SCRIPT not valid. Partial Result: ...
05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] ERROR: Empty result [127.0.0.1]: 'perl /var/www/html/scripts/WeatherBug.pl MARIT'
05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] DS[533] WARNING: Result from SCRIPT not valid. Partial Result: ...
05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] ERROR: Empty result [127.0.0.1]: 'perl /var/www/html/scripts/WeatherBug.pl MARIT'
05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] DS[532] WARNING: Result from SCRIPT not valid. Partial Result: ...
05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] ERROR: Empty result [127.0.0.1]: 'perl /var/www/html/scripts/WeatherBug.pl MARIT'
05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] DS[531] WARNING: Result from SCRIPT not valid. Partial Result: ...
05/26/2006 11:15:09 AM - CACTID: Poller[0] Host[20] ERROR: Empty result [127.0.0.1]: 'perl /var/www/html/scripts/WeatherBug.pl MARIT'

When I run this exact command from the terminal, I get successful results. Can anyone help out a Linux noob, or maybe point me in the right direction?

Thanks much.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Starting with latest cactid, it is required to provide /full/path/to/perl when using it with Data Input Methods. This will of course affect all Templates posted prior to this change ...
So locate this Data Input Method and provide the full path for perl derived from

Code: Select all

which perl
Reinhard
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Post by Diggit2001 »

You da man. Worked like a champ and also got a few of my other scripts working.

Thanks very much.
ahardman
Posts: 41
Joined: Mon Apr 10, 2006 2:54 pm

Post by ahardman »

Has anyone ever had this issue:

WARNING: SNMP timeout detected [500 ms], ignoring host

When i run the command at a prompt i get a result but it is very slow.

Any suggestions.

I would love to have this data. We have radio equipment that is affected by the weather.
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

I have one big problem with the instructions, and that's if you add the graphs in separately, it makes 5 separate data sources and runs the script 5 separate times when it only needs to happen once (Not to mention taking 5 times the disk space that it needs!)

This might explain the gaps that some people are seeing -- It may be accessing their site too many times in a row and having problems.

Instead, I created a data source, entered the id for weatherbug, and then created the 5 graphs by clicking the 'add' button on the graph management screen, pointing each of them to the same data source and choosing the appropriate fields.

Now the script only runs once, and so far I haven't had any gaps or timeouts.
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

I was having an issue with the script timing out on occasion: perl and the poller were hanging until the script timed out (sometimes for an hour and a half!)

Fortunately there's a simple fix.

Change this line in WeatherBug.pl:

Code: Select all

use LWP::Simple;
To:

Code: Select all

use LWP::Simple qw(get $ua);
$ua->timeout(90);
That forces the script to timeout after 90 seconds so it won't hold up any other processes. Since I made this change, there were no more absurdly long script runs. There were still a couple gaps, but nothing like before.
cmorford
Posts: 1
Joined: Wed Aug 16, 2006 7:39 am

Post by cmorford »

I'm having the same problem as qwertz. My processes are increasing indefinitely.
User avatar
morgentau
Posts: 43
Joined: Fri Jun 16, 2006 4:05 am
Location: Zurich, Switzerland

Post by morgentau »

When i run the weatherbug.pl on cmd my output looks like this:

Code: Select all

diepen:/srv/www/htdocs/cacti/scripts # ./weatherbug.pl
Use of uninitialized value in concatenation (.) or string at ./weatherbug.pl line 9.
DewPoint:11.9 Humidity:78.8 Temp:15.5 Wind:13.4 Pressure:102.00 Rain:0.00 HeatIndex:14.9
So i get an error and results on cmd and my graphs are empty without any data showing only "nan".

How can i make this working with nice graphical data to show?
User avatar
kwabbernoot
Cacti User
Posts: 99
Joined: Mon Oct 13, 2003 4:11 am
Location: Zottegem, Belgium

Post by kwabbernoot »

ahardman wrote:Has anyone ever had this issue:

WARNING: SNMP timeout detected [500 ms], ignoring host

When i run the command at a prompt i get a result but it is very slow.

Any suggestions.

I would love to have this data. We have radio equipment that is affected by the weather.
Increase the SNMP timeout in the configuration of device within Cacti.
cdsloop
Posts: 1
Joined: Mon Oct 16, 2006 7:17 am
Location: Germantown, MD

WeatherBug API

Post by cdsloop »

I saw this post and thougth it might be of interest to everyone that we now have an API available that you can sign up for.

Check it out at http://api.weatherbug.com/
davibou
Posts: 6
Joined: Mon Feb 05, 2007 11:48 am

Post by davibou »

Hi all i'm new here

This is a verry good script but a problem for me i leave in France Dijon and don't find any weatherstation code to use

Can someone help ??
rsaeks
Posts: 34
Joined: Mon Nov 06, 2006 5:15 pm

Post by rsaeks »

I am trying to use this template to graph our weather stations since the kids will like having some historical data that they can use for their projects, however I can't seem to get any data out of this.

When I run the .pl script with sudo -u cacti /path/to/script, I return data. The data I get back is using our codes, but seems be dropping of the leading "-" on the temp for some reason.

When I try to use this through the poller and turn up the logging a bit, I see this output:

CMD: perl /Library/WebServer/Documents/cacti/scripts/WeatherBug.pl GLNVV, output: current_temp: wind_speed: barometer: humidity: high_temp: low_temp: dew_point_temp: wind_chill_temp:

If I copy the top line and run it manually, I am able to get data back.

Is there something that I need to do to have this run properly?

If you need some more info, let me know.

Thanks
davibou
Posts: 6
Joined: Mon Feb 05, 2007 11:48 am

Post by davibou »

Ok finally found a list for the entire world this is the link :))

http://adds.aviationweather.gov/metars/stations.txt

Check the list you will find your weather station code easly
Locked

Who is online

Users browsing this forum: No registered users and 3 guests