#1134 closed patch (fixed)

hddtemp_smartctl pattern matches too much

Reported by: kenyon Owned by: kenyon
Priority: normal Milestone: Munin 2.0.0
Component: plugins Version: devel
Severity: minor Keywords:
Cc:

Description

I'm not sure what this pattern is supposed to be matching (I think RAID devices), but it matches too much: http://munin-monitoring.org/browser/trunk/plugins/node.d/hddtemp_smartctl.in?rev=3996#L232

If I want to list my drive as "disk/by-id/ata-ST3250410AS_9RY2F1RL" (so that this plugin works across reboots when the drive letter changes), then the aforementioned pattern cuts off the "_9RY2F1RL" part, causing the smartctl command to fail.

The fix is to anchor the pattern to the end of the line, like this:

my $dev = $drive =~ /(.*)(?:_\d+)$/ ? $1 : $drive;

This should be fine for existing users of RAID devices who specify e.g. sda_0.

Change History (3)

comment:1 Changed at 2011-09-10T07:50:47+02:00 by kenyon

So, to be clear, the change is to just put a $ in the pattern.

comment:2 Changed at 2011-09-18T00:32:26+02:00 by kenyon

  • Milestone changed from Munin 1.4.7 to Munin 2.0
  • Owner changed from nobody to kenyon
  • Status changed from new to assigned

comment:3 Changed at 2011-09-18T00:32:50+02:00 by kenyon

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in r4389.

Note: See TracTickets for help on using tickets.