Created
December 28, 2010 20:43
-
-
Save leejones/757686 to your computer and use it in GitHub Desktop.
Monitor an address with Scout using ping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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