Created
December 30, 2011 00:18
-
-
Save narkisr/1536869 to your computer and use it in GitHub Desktop.
zfs pool scrub and daily status email
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
| #!/usr/bin/env ruby | |
| require 'gmail' | |
| def email_scrub_status(status) | |
| gmail = Gmail.new('u', 'pass') | |
| gmail.deliver do | |
| to "dest@gmail.com" | |
| subject "Zfs check result on Host" | |
| text_part do | |
| body "The storage status is: #{status}" | |
| end | |
| end | |
| puts 'email sent' | |
| end | |
| command_output = `zpool status -x` | |
| email_scrub_status(command_output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment