Skip to content

Instantly share code, notes, and snippets.

@narkisr
Created December 30, 2011 00:18
Show Gist options
  • Select an option

  • Save narkisr/1536869 to your computer and use it in GitHub Desktop.

Select an option

Save narkisr/1536869 to your computer and use it in GitHub Desktop.
zfs pool scrub and daily status email
#!/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