Skip to content

Instantly share code, notes, and snippets.

@yayugu
Last active August 29, 2015 14:17
Show Gist options
  • Save yayugu/5902daaf6807a534d446 to your computer and use it in GitHub Desktop.
Save yayugu/5902daaf6807a534d446 to your computer and use it in GitHub Desktop.
雑なHDD監視crontab
33 * * * * sudo ruby -e 'zstat = `zpool status -x`.strip; if zstat != "all pools are healthy" then puts zstat; end'
35 * * * * sudo ruby -e '["sda", "sdb", "sdc", "sdd"].each do |dev| health = `smartctl -H /dev/#{dev}`; unless health.include?("SMART overall-health self-assessment test result: PASSED") then puts dev; puts health; end; end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment