doc/checker_example.rb in watchmonkey_cli-1.10.0 vs doc/checker_example.rb in watchmonkey_cli-1.11.0
- old
+ new
@@ -21,10 +21,11 @@
#self.maxrt = ->(app, checker, args){ app.opts[:maxrt] && app.opts[:maxrt] * 2 }
# Called by configuration defining a check with all the arguments.
# e.g. my_checker "http://google.com", some_option: true
# Should invoke `app.enqueue` which will by default call `#check!` method with given arguments.
+ # Must have options as last argument!
def enqueue host, opts = {}
opts = { some_option: false }.merge(opts)
# If you want to exec commands (locally or SSH) usually a connection or symbol is passed.
# The buildin handlers follow this logic:
@@ -34,9 +35,10 @@
# requires first argument to be self (the checker), all other arguments are passed to `#check!` method.
app.enqueue(self, host, opts)
end
# First argument is the result object, all other arguments came from `app.enqueue` call.
+ # Must have options as last argument!
def check! result, host, opts = {}
# Do your checks and modify the result object.
# Debug messages will not show if -s/--silent or -q/--quiet argument is passed.
# Info messages will not show if -q/-quiet argument is passed.