Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filepath = "#{ARGV[0]}"
- filesize = File.stat("#{filepath}").size
- case filesize.to_i
- when < ARGV[2]
- puts "Critical: Current file size is #{filesize} bytes"
- exit 2
- when < ARGV[3]
- puts "Warning: Current file size is #{filesize} bytes"
- exit 1
- when > ARGV[2] && filesize > ARGV[3]
- puts "OK: Current filesize is #{filesize} bytes"
- exit 0
- end
Advertisement
Add Comment
Please, Sign In to add comment