Skip to content

Instantly share code, notes, and snippets.

@jiphex
Created July 9, 2013 15:51
Show Gist options
  • Save jiphex/5958495 to your computer and use it in GitHub Desktop.
Save jiphex/5958495 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
DISKS = %w(/ /something /somewhere/else)
DISKS.each do |d|
(fs,blocks,used,available,cap,mount) = %x[df -P #{d}].lines.drop(1).first.split
cap = cap.to_i
puts "alert on #{fs} at #{mount} (#{cap}%)" if cap > 85
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment