Skip to content

Instantly share code, notes, and snippets.

@craigw
Created February 8, 2010 11:31
Show Gist options
  • Save craigw/298069 to your computer and use it in GitHub Desktop.
Save craigw/298069 to your computer and use it in GitHub Desktop.
# A Nagios service check skeleton.
#
# Note that you can put more than one line of output in the message,
# and you can include check performance data if you'd like.
#
# Technical details here:
# http://nagios.sourceforge.net/docs/3_0/pluginapi.html
#
if okay?
puts "SERVICE_NAME OKAY: It's all good"
exit 0
elsif warning?
puts "SERVICE_NAME WARNING: I'm a bit worried by something"
exit 1
elsif critical?
puts "SERVICE_NAME CRITICAL: OH NOES! PANIC!"
exit 2
else # unknown
puts "SERVICE_NAME UNKNOWN: I couldn't work out the status of the service"
exit 3
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment