phillxnet
(Philip Guyton)
June 29, 2018, 9:38pm
2
@coreybrett Welcome to the Rockstor community.
From the S.M.A.R.T docs section, specifically the S.M.A.R.T through Hardware RAID Controllers subsection, the link provided (also on the Web-UI config page) to the smartmontools page “Checking disks behind RAID controllers ” suggests that your syntax is correct.
coreybrett:
Has anyone done this?
Maybe not, I know the 3ware config options were tested, as show in the referenced doc section, thanks to @kcomer who helped with developing this feature in the following thread:
I recently installed Rockstor and really like what is going on here over the others out there the interface is great I see that it is relatively new so to speak but I have not been able to get SMART to get the data from the drives on the system.
I would like to see temps for disk and motherboard added to the dash board whn you guys get a chance if this is not already in the works
So to my issue, These are 8, 2 TB WD drives, on a 3ware LSI 9750-8i raid controller, with an ASUS MB and 16 gig of …
At the time I put in a few of the other raid controller driver options but it looks from your report that we may have a input validation issue here, given your apparently correct syntax.
Linking for context to the pull request that added the custom smart options feature:
rockstor:master
← phillxnet:1079_add_custom_SMART_parameter_option
opened 06:01PM - 20 Mar 16 UTC
Adds per disk custom S.M.A.R.T capabilities via simple specialized input page wh… ich includes links to upstream docs for smartmontools. All entered config is displayed on the Disks page and can be removed by submitting an empty entry in the same config page. The new config area is indicated as for advanced use only and a Disks page Rescan is required to apply the entered configuration; this allows for a before and after feedback; most often an update from "Not Supported" to the smart Switch appearing in the On state.
Of note this that this pr depends on the disk.smart_options db field added in pr #1166 in commit:
https://github.com/rockstor/rockstor-core/pull/1166/commits/cc7cfc1750cafa43b3a7c8192faa1bdce5c22f10
Custom per disk smartctl switches are limited (via input validation) to -d (device) and -T (tolerance) and an explanation is offered to inform the user that these are in addition to the usual internally used already -a --info etc switches.
Non rudimentary Input validation is included but not complete (especially in raid controller -d options and associated targets). The validation mechanism used is easily extensible to allow for future acceptance of as yet unknown options for these switches or if need be additional switches.
In the case of a raid -d option I have left the option to specify a specialized raid device target as optional. With disks behind some raid controllers the format of the smartctl command changes so that one changes the end device from for example the disk device (which of course may be a compound / raid device now) to the controller raid device. The raid -d option is then used to stipulate the port / wire that the disk of interest is attached to.
non raid syntax:
smartctl -a /dev/sda
raid syntax:
smartctl -a -d 3ware,0 /dev/twl0
This means the first raid controller /dev/twl0 and the first port/drive ie the ",0" bit.
This currently is a manual mapping but at least we now have the facility to accommodate this. The optional nature of adding this raid controller dev target is to allow for alternative controllers (some controllers don't use the alternative syntax) and to allow for diagnosing issues as the output from the two formats on controllers that support both is very different. Usually a great deal more info is available using the specialized syntax and very little using the non raid syntax.
Thanks to @kcomer on the forum for his assistance and testing of raid specific smartctl command syntax.
https://forum.rockstor.com/t/s-m-a-r-t-support-is-not-available-for-this-disk/830/24?u=phillxnet
I have tested this patch set on several real and virtual machines and no regressions were found to other S.M.A.R.T function. (Rockstor versions from 3.8-11.20 to 3.8-12.03)
Included is a couple of minor fixes found while adding enhanced user feedback in the case of disabled or unavailable S.M.A.R.T info.
@schakrava Apologies in advance for:
1: my js code. :) (a little inconsistent but it does work and is commented and readable).
2: duplication of many commits in this pr (it's smaller than it looks on commit count). Bit of a git hiccup on my part I'm afraid.
This patch set builds on pr #1212 as it modifies and augments it's abstraction layer for device name preprocessing. But given #1212 has now been merged I am assuming this should not cause any problems.
Images to follow of UI changes.
and from that it looks like the validation code (in java script) is here:
$.validator.addMethod('validateSmartCustom', function(value) {
var smartcustom_options = $('#smartcustom_options').val().trim();
var devOptions = ['auto', 'test', 'ata', 'scsi', 'sat', 'sat,12', 'sat,16', 'sat,auto', 'usbprolific', 'usbjmicron', 'usbjmicron,0', 'usbjmicron,p', 'usbjmicron,x', 'usbjmicron,x,1', 'usbcypress', 'usbsunplus'];
var devOptionsRaid = ['3ware', 'areca', 'hpt', 'cciss', 'megaraid', 'aacraid'];
var toleranceOptions = ['normal', 'conservative', 'permissive', 'verypermissive'];
// RegExp patters for the following RAID target devices:
// 3ware /dev/twe, /dev/twa, /dev/twl followed by 0-15
// Areca sata /dev/sg[2-9] but for hpahcisr and hpsa drivers /dev/sg[0-9]* (lsscsi -g to help)
// so we still have an issue there.
// HP Smart array with cciss driver uses /dev/cciss/c[0-9]d0
// HighPoint RocketRaid SATA RAID controller (hpt), LSI MegaRAID SAS RAID controller Dell PERC 5/i,6/i controller (megaraid)
// and Adaptec SAS RAID controller (aacraid) all expect /dev/sd[a-z] type raid device targets.
And sure enough it looks very much like I’ve missed out, in raidTargetRegExp, the validation for plain old sda / sdb type raid targets used by the megaraid driver.
As a result I’ve opened the following issue:
opened 09:30PM - 29 Jun 18 UTC
closed 12:42PM - 11 Jul 18 UTC
enhancement
Thanks to forum member coreybrett in the following forum thread for highlighting… this issue. When the following custom smart option for megaraid is entered "-d megaraid,0 /dev/sda" an input validation error is received. On initial inspection this appears to be down to an omission in the raidTargetRegExp variable defined within:
src/rockstor/storageadmin/static/storageadmin/js/views/smartcustom_disks.js
ie:
```
// RegExp patters for the following RAID target devices:
// 3ware /dev/twe, /dev/twa, /dev/twl followed by 0-15
// Areca sata /dev/sg[2-9] but for hpahcisr and hpsa drivers /dev/sg[0-9]* (lsscsi -g to help)
// so we still have an issue there.
// HP Smart array with cciss driver uses /dev/cciss/c[0-9]d0
var raidTargetRegExp = [/\/dev\/tw[e|a|l][0-9][0-5]{0,1}$/, /\/dev\/sg[0-9]$/, /\/dev\/cciss\/c[0-9]d0$/];
```
It is proposed that the indicated regex variable raidTargetRegExp be extended to accommodate the megaraid legitimate sda / sdb type dev names.
Please update the following forum thread with this issues resolution:
https://forum.rockstor.com/t/configure-smartmontools-for-dell-perc-h700/4923
Note that a caveat of the proposed approach is that we assume sda / sdb dev name stability in this context.
I should be able to have a go at this one myself but it may not be for a while yet as I have an ongoing backlog. But you may like to have a go yourself: in which case please see the Developers subsection of our Community Contribution doc section which should step you though building a development environment where you can test out the additional regex.
If you do fancy having a go please indicate this on the issue. No worries otherwise and remember that if you build on an existing Rockstor rpm install it will wipe your existing db which may not be what you want.
Thanks again for reporting this issue.