Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #11 from jonlives/master

Skip checking services on hosts which are not OK
  • Loading branch information...
commit 17a2baf56847e6ce4bb8401763c45c2d29f72897 2 parents 18ff077 + fb108fb
@ripienaar authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  check_check.rb
View
2  check_check.rb
@@ -34,6 +34,8 @@ def update
def services(service_pattern=nil, host_pattern=nil)
matches = []
self.hosts(host_pattern).each do |host, hostinfo|
+ #Skip hosts if the host is down - obviously the services will be too, and we should already have alerted on the host.
+ next if hostinfo[current_state].to_i != 0
# Skip hosts if there is no hostinfo (no services associated, etc).
next if hostinfo["servicestatus"].nil?
# Skip hosts if they are in scheduled downtime
Please sign in to comment.
Something went wrong with that request. Please try again.