logo       

Re: Temperatures plugin: msg#00023

db.rddtool.munin.general

Subject: Re: Temperatures plugin

Andrea Gzz wrote:
> Hi.
>
> First of all I have to say that munin is great, I have been using it for
> a good 6 months now and never experienced any troubles.
> Now, here comes the (probably dumb) question: I recently added the
> temperatures plugin
> ( http://muninexchange.projects.linpro.no/?search&cid=23&pid=37&phid=36 ) but
> I couldn't get it to plot the temperatures.
> I configured the plugin by setting "env.wcode LIPE EBBR LIVT" in
> munin-node.conf but nothing on the graph.
> What is odd is that the graph displays the correct locations' name, but
> no temperature data is plotted or displayed.
>
> I noticed that the plugin source code contains this "if" condition:
>
>> if (defined($ENV{wcode})) {
>> @wcode = split(' ', $ENV{wcode});
>> } else {
>> @wcode = ("ENGM", "ENBR", "ENVA", "ENTC");
>> }
>
> I replaced the codes with the ones I needed and executed the plugin
> from a bash shell.This was the output:
>
>> amoeba:/etc/munin/plugins# ./temperatures
>> LIPE.value 11
>> EBBR.value 11
>> LIVT.value 16
>
> So it seems that the values are correctly retrieved from
> http://weather.noaa.gov/ .
> But still, nothing on the graph.
> What did I miss?

The perl regexp allows for whitespace after the temperature. I found
that out by reading the Munin logs:

Dec 07 19:36:01 [24110] - Unable to update
/var/lib/munin/hjemme.ruberg.no/ferdinand.hjemme.ruberg.no-temperatures-ENGM-g.rrd:

conversion of '4 ' to float not complete: tail ' '

So, a slight change to the regular expression (in diff format):

# diff -Naur temperatures.orig temperatures
--- temperatures.orig 2006-12-07 19:41:30.000000000 +0100
+++ temperatures 2006-12-07 19:43:57.000000000 +0100
@@ -83,7 +83,7 @@
my $url = "$datasource$station.TXT";
my $response = $ua->request(HTTP::Request->new('GET',$url));

- if ($response->content =~ /Temperature:\s*(.*)\s*F\s*\(\s*(.*)\s*C/) {
+ if ($response->content =~
/Temperature:\s*(\d+)\s*F\s*\(\s*(\d+)\s*C/) {
if ($unit =~ /F/) {
print "$station.value $1\n";
} else {


...and we get this:

Dec 07 19:44:56 [27422] - Updating
/var/lib/munin/hjemme.ruberg.no/ferdinand.hjemme.ruberg.no-temperatures-ENGM-g.rrd

with 4

A new version will be available pretty soon, if I know the plugin's
author correctly :-)

--
Bjørn



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise