#1222 closed enhancement (fixed)

Plugin hddtemp_smartctl has a bug in trunk

Reported by: boss-chifra Owned by: kenyon
Priority: normal Milestone: Munin 2.0.0
Component: plugins Version: devel
Severity: normal Keywords:


Line 131 should return the version number of smartctl

if ($smartctl and `$smartctl --version` =~ / version (\d+\.\d+) /i)

in version 5.38 it is working properly

Redhat 5.x
smartctl --version

smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
smartmontools release 5.38 dated 2008/03/10 at 10:44:07 GMT
smartmontools build host: x86_64-redhat-linux-gnu
smartmontools build configured: 2012/02/23 16:33:44 UTC
smartctl compile dated Feb 23 2012 at 11:33:55

But in version 5.4x has changed the output, and now the code is not working properly

ubuntu 11.04
smartctl --version

smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
smartmontools release 5.40 dated 2009-12-09 at 21:00:32 UTC
smartmontools SVN rev 3124 dated 2010-07-12 at 19:21:00
smartmontools build host: x86_64-unknown-linux-gnu
smartmontools build configured: 2010-12-27 21:21:51 UTC
smartctl compile dated Dec 27 2010 at 21:22:11

centos5.x and smartmontools compiled from source
smartctl --version

smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-308.1.1.el5] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
smartmontools release 5.42 dated 2011-10-20 at 19:19:34 UTC
smartmontools SVN rev 3458 dated 2011-10-20 at 19:20:23
smartmontools build host: i686-redhat-linux-gnu
smartmontools build configured: 2011-12-29 10:04:31 UTC
smartctl compile dated Dec 29 2011 at 11:04:51

As we can see, the word "version" in the output isn't present more.
I suggest replace "version" to "release", because it is everywhere.
Then version of smartctl will be determined correctly for 5.3x and 5.4x
The line 131 should look like this.

if ($smartctl and `$smartctl --version` =~ / release (\d+\.\d+) /i)

Change History (2)

comment:1 Changed at 2012-05-19T23:19:20+02:00 by kenyon

  • Owner changed from nobody to kenyon
  • Status changed from new to assigned

Applied in r4875, thanks.

comment:2 Changed at 2012-05-19T23:19:26+02:00 by kenyon

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.