Last active
December 7, 2015 11:21
-
-
Save mortn/b4e50b9e0128781c7e90 to your computer and use it in GitHub Desktop.
Get disk temperatures on 3ware RAID controller
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
| #!/bin/bash | |
| ### First we get the controller ID (e.g. c0) | |
| CT=$(tw-cli info | sed -n 's/\(c[0-9]\).*/\1/p') | |
| ### Then we list all drives on that controller | |
| DRV=$(tw-cli /$CT show drivestatus | sed -n 's/\(p[0-9]\).*/\1/p' | xargs) | |
| ### Last we loop over the disks we found and read out the temperature on each of them | |
| echo "3ware temperatures: $(for d in $DRV; do | |
| tw-cli /$CT/$d show temperature | sed -n 's/ Temperature = /:/;s/ deg //p' | |
| done | xargs)" | logger |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One could, of course, just shorten the whole thing into a single command, but setting the controller ID and the drives as variables makes it so much easier to use for something else than just temperature read-outs.