|
Re: Temperatures plugin: msg#00025db.rddtool.munin.general
I applied the patch and now the temperatures are displayed correctly. Thanks. Andrea On Thu, 2006-12-07 at 12:39 -0800, S. Banerian wrote: > Bjørn Ruberg wrote: > > > 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 :-) > > > actually, i needed to modify the regex just a little: > if ($response->content =~ > /Temperature:\s*(\d+\.+\d+)\s*F\s*\(\s*(\d+\.+\d+)\s*C/) { > > since i'm getting temperature data as \d+\.\d+ > > ------------------------------------------------------------------------- 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> |
|---|---|---|
| Previous by Date: | Re: Temperatures plugin: 00025, S. Banerian |
|---|---|
| Next by Date: | Re: Temperatures plugin: 00025, Bjørn Ruberg |
| Previous by Thread: | Re: Temperatures plugini: 00025, S. Banerian |
| Next by Thread: | Re: Temperatures plugin: 00025, Bjørn Ruberg |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |