Skip to content

Instantly share code, notes, and snippets.

@leejones
Created December 28, 2010 20:43
Show Gist options
  • Save leejones/757686 to your computer and use it in GitHub Desktop.
Save leejones/757686 to your computer and use it in GitHub Desktop.
Monitor an address with Scout using ping
class PingMonitor < Scout::Plugin
OPTIONS =<<-EOS
destination:
default: yahoo.com
name: Desitnation
notes: The destination address for ping to check.
EOS
def build_report
ping_output = `ping -c 1 #{option(:destination)}`
ping_exitstatus = $?.exitstatus
report({:ping_exitstatus => ping_exitstatus})
end
end
metadata:
ping_exitstatus:
label: Ping Exit Status
precision: 0
larger_is_better: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment