Guest User

Untitled

a guest
Jan 22nd, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. filepath = "#{ARGV[0]}"
  2. filesize = File.stat("#{filepath}").size
  3.  
  4. case filesize.to_i
  5. when < ARGV[2]
  6. puts "Critical: Current file size is #{filesize} bytes"
  7. exit 2
  8. when < ARGV[3]
  9. puts "Warning: Current file size is #{filesize} bytes"
  10. exit 1
  11. when > ARGV[2] && filesize > ARGV[3]
  12. puts "OK: Current filesize is #{filesize} bytes"
  13. exit 0
  14. end
Advertisement
Add Comment
Please, Sign In to add comment