Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Add more ways you'd like to be able to monitor things.
- #
- Monitor.config do |config|
- # load the config for the MySQL connection
- config.configuration_file "configuration.yaml"
- config.path = "/home/penso"
- config.log_file "monitoring.log"
- end
- Monitor.alert do |monitor|
- monitor.query = "SELECT ... FROM ..."
- # This generate an exit(2) for NAGIOS
- monitor.results.first.to_i.should.be > 0
- monitor.error_if("RailsModel.count < 10") do |error|
- error.alert "fabienpenso@gmail.com"
- end
- # This allows more selective errors
- monitor.error_if("result.first.to_i < 10") do |error|
- error.alert "fabienpenso@gmail.com"
- error.exit(1)
- error.exit_message "Should have at least bla bla"
- end
- monitor.error_if("result.first.to_i < 5") do |error|
- error.alert "fabienpenso@gmail.com"
- error.exit(2)
- error.exit_message "Should have at least bla bla"
- end
- end
Add Comment
Please, Sign In to add comment