Skip to content

Instantly share code, notes, and snippets.

@justincaldwell
Created March 10, 2014 19:47
Show Gist options
  • Save justincaldwell/9472842 to your computer and use it in GitHub Desktop.
Save justincaldwell/9472842 to your computer and use it in GitHub Desktop.
def run
file = Dir["/data/content_instance_views/**/*"].select { |f| File.file? f }.sort_by { |f| File.mtime f }.first
if file
age = (Time.now.to_i - File.mtime(file).to_i).to_i
message "View count log is #{age} seconds old"
critical if age > 2400
warning if age > 1200
end
ok
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment