Created
July 13, 2017 08:41
-
-
Save lcx/708eee5fc66d0985ce18c84388547641 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def scan_disks! | |
output = `sudo /usr/sbin/storcli /c0 /eall /sall show J` | |
parsed_output = JSON.parse(output) | |
critical "Can't get device ID from storcli" unless parsed_output["Controllers"][0]["Command Status"]["Status"]=="Success" | |
parsed_output["Controllers"][0]["Response Data"]["Drive Information"].each do |drive| | |
@devices << Disk.new(drive["DID"]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment