perl script not working
This script is not updating in graphite. Any ideas?
OUTPUT:
weather.temperature 35 1263766247
weather.humidity 64 1263766247
weather.wind_speed 6 1263766247
SCHEMAS:
/usr/local/
[everything_
priority = 100
pattern = .*
retentions = 60:1440
[weather_data]
priority = 100
pattern = .*
retentions = 60:1440
CODE:
#!/usr/bin/perl -w
use IO::Socket;
use strict;
use Weather::Google;
# init host and port
my $host = '127.0.0.1';
my $port = 2003;
my $gw;
my $date = `date +%s`;
## Initialize the module
$gw = new Weather:
my $temp = $gw->current_
my $humidity = $gw->current_
$humidity =~ m#Humidity:(.*)%#;
$humidity = $1;
my $wind = $gw->current_
$wind =~ m#at (.*) mph#;
$wind = $1;
my $line1 = "weather.
my $line2 = "weather.
my $line3 = "weather.wind_speed $wind $date";
my $line = "$line1$
my $sock = new IO::Socket::INET( PeerAddr => $host, PeerPort => $port, Proto => 'tcp');
$sock or die "no socket: $!";
$sock->send($line);
print $line;
close($sock);
LOGS:
/opt/graphite/
18/01/2010 01:01:01 :: Unhandled Error
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
result = context.call(ctx, function, *args, **kwargs)
File "/usr/lib/
return self.currentCon
File "/usr/lib/
return func(*args,**kw)
--- <exception caught here> ---
File "/opt/graphite/
writeCached
File "/opt/graphite/
for schema in schemas:
exceptions.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Graphite Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- cnsmith
- Solved:
- Last query:
- Last reply:
This question was reopened
- by cnsmith