mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
NOAA decommissioned weather.noaa.gov
Change weather.noaa.gov -> tgftp.nws.noaa.gov
This commit is contained in:
parent
6eeb457fc2
commit
2d95020da7
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2006 Lars Strand
|
# Copyright (C) 2006 Lars Strand
|
||||||
#
|
#
|
||||||
# Plugin to fetch temperature from weather.noaa.gov
|
# Plugin to fetch temperature from tgftp.nws.noaa.gov
|
||||||
#
|
#
|
||||||
# Parameters supported:
|
# Parameters supported:
|
||||||
#
|
#
|
||||||
@ -16,7 +16,7 @@
|
|||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
my $usehum = $ENV{humidity} || undef; # set to "yes" to enable humidity
|
my $usehum = $ENV{humidity} || undef; # set to "yes" to enable humidity
|
||||||
my $wcode = $ENV{wcode} || "ENGM"; # Find areacode here http://weather.noaa.gov/
|
my $wcode = $ENV{wcode} || "ENGM"; # Find areacode here http://tgftp.nws.noaa.gov/
|
||||||
my $unit = $ENV{unit} || "C"; # "C" = Celsius, "F" = Fahrenheit
|
my $unit = $ENV{unit} || "C"; # "C" = Celsius, "F" = Fahrenheit
|
||||||
my $proxy = $ENV{proxy} || undef; # Example: "http://proxy.foo.bar:8080/"
|
my $proxy = $ENV{proxy} || undef; # Example: "http://proxy.foo.bar:8080/"
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ if ($0 =~ /^(?:|.*\/)temperature_([^_]+)$/) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
my $datasource = "http://weather.noaa.gov/pub/data/observations/metar/decoded/$wcode.TXT";
|
my $datasource = "http://tgftp.nws.noaa.gov/data/observations/metar/decoded/$wcode.TXT";
|
||||||
|
|
||||||
my $ua = LWP::UserAgent->new(timeout => 30);
|
my $ua = LWP::UserAgent->new(timeout => 30);
|
||||||
$ua->agent('Munin');
|
$ua->agent('Munin');
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2006 Lars Strand
|
# Copyright (C) 2006 Lars Strand
|
||||||
#
|
#
|
||||||
# Plugin to fetch temperature from weather.noaa.gov
|
# Plugin to fetch temperature from tgftp.nws.noaa.gov
|
||||||
#
|
#
|
||||||
# Parameters supported:
|
# Parameters supported:
|
||||||
#
|
#
|
||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
# Find areacodes here http://weather.noaa.gov/
|
# Find areacodes here http://tgftp.nws.noaa.gov/
|
||||||
my @wcode = undef;
|
my @wcode = undef;
|
||||||
|
|
||||||
if (defined($ENV{wcode})) {
|
if (defined($ENV{wcode})) {
|
||||||
@ -43,7 +43,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "autoconf") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $datasource = "http://weather.noaa.gov/pub/data/observations/metar/decoded/";
|
my $datasource = "http://tgftp.nws.noaa.gov/data/observations/metar/decoded/";
|
||||||
|
|
||||||
my $ua = LWP::UserAgent->new(timeout => 30);
|
my $ua = LWP::UserAgent->new(timeout => 30);
|
||||||
$ua->agent('Munin');
|
$ua->agent('Munin');
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
"""
|
"""
|
||||||
munin US NOAA weather plugin (http://weather.noaa.gov)
|
munin US NOAA weather plugin (http://tgftp.nws.noaa.gov)
|
||||||
|
|
||||||
Draws pressure in hPa.
|
Draws pressure in hPa.
|
||||||
Copy/link file as 'weather_pressure_CODE', like: weather_pressure_LOWW for Austria, Vienna.
|
Copy/link file as 'weather_pressure_CODE', like: weather_pressure_LOWW for Austria, Vienna.
|
||||||
|
|
||||||
Get the code by going to http://weather.noaa.gov, selecting your
|
Get the code by going to http://tgftp.nws.noaa.gov, selecting your
|
||||||
location, and copying the code from the address bar of your browser; should
|
location, and copying the code from the address bar of your browser; should
|
||||||
be something like CODE.html.
|
be something like CODE.html.
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ import sys
|
|||||||
import urllib
|
import urllib
|
||||||
import re
|
import re
|
||||||
|
|
||||||
url = 'http://weather.noaa.gov/pub/data/observations/metar/decoded/%s.TXT'
|
url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT'
|
||||||
|
|
||||||
re_hPa = re.compile('Pressure.*\((\d+) hPa\)')
|
re_hPa = re.compile('Pressure.*\((\d+) hPa\)')
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
"""
|
"""
|
||||||
munin US NOAA weather plugin (http://weather.noaa.gov)
|
munin US NOAA weather plugin (http://tgftp.nws.noaa.gov)
|
||||||
|
|
||||||
Draws temperature/dew point in C.
|
Draws temperature/dew point in C.
|
||||||
Copy/link file as 'weather_temp_CODE', like: weather_temp_LOWW for Austria, Vienna.
|
Copy/link file as 'weather_temp_CODE', like: weather_temp_LOWW for Austria, Vienna.
|
||||||
|
|
||||||
Get the code by going to http://weather.noaa.gov, selecting your
|
Get the code by going to http://tgftp.nws.noaa.gov, selecting your
|
||||||
location, and copying the code from the address bar of your browser; should
|
location, and copying the code from the address bar of your browser; should
|
||||||
be something like CODE.html.
|
be something like CODE.html.
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ import sys
|
|||||||
import urllib
|
import urllib
|
||||||
import re
|
import re
|
||||||
|
|
||||||
url = 'http://weather.noaa.gov/pub/data/observations/metar/decoded/%s.TXT'
|
url = 'http://tgftp.nws.noaa.gov/data/observations/metar/decoded/%s.TXT'
|
||||||
|
|
||||||
re_C = re.compile('Temperature:.*\((-?\d+\.?\d?) C\)')
|
re_C = re.compile('Temperature:.*\((-?\d+\.?\d?) C\)')
|
||||||
re_DewC = re.compile('Dew.*\((-?\d+\.?\d?) C\)')
|
re_DewC = re.compile('Dew.*\((-?\d+\.?\d?) C\)')
|
||||||
|
Loading…
Reference in New Issue
Block a user