Skip to content

Smart plugin working with Dell hardware RAID #45

@olivierlambert

Description

@olivierlambert

Currently, the smartctl plugin doesn't work with a Dell hardware RAID controller. In that case, the smartctl command will return:

smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.19.0+1] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

Smartctl open device: /dev/sda failed: DELL or MegaRaid controller, please try adding '-d megaraid,N'

So we should catch this very specific case to try using smartctl differently. Here is how to make it work. First, we need to smartctl --scan in order to find all the devices. This will return (for example):

/dev/sda -d scsi # /dev/sda, SCSI device
/dev/bus/0 -d megaraid,0 # /dev/bus/0 [megaraid_disk_00], SCSI device
/dev/bus/0 -d megaraid,1 # /dev/bus/0 [megaraid_disk_01], SCSI device

Now, we need to interate on all devices "megaraid" that exists, in our example 0 and 1:

smartctl -a /dev/bus/0 -d megaraid,0

and:

smartctl -a /dev/bus/0 -d megaraid,1

I suppose we could also try first to check if there's /dev/bus/ devices and treat them if we detect them. In any case, we need to catch that error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions