Browse files

Merge pull request #11 from jonlives/master

Skip checking services on hosts which are not OK
  • Loading branch information...
2 parents 18ff077 + fb108fb commit 17a2baf56847e6ce4bb8401763c45c2d29f72897 @ripienaar committed Apr 4, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 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

0 comments on commit 17a2baf

Please sign in to comment.