File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -274,7 +274,8 @@ def check(self, instance):
274274
275275 # Report docker healthcheck SC's where available
276276 if health_service_checks :
277- self ._send_container_healthcheck_sc (containers_by_id )
277+ health_scs_containers = instance .get ('health_service_check_whitelist' , [])
278+ self ._send_container_healthcheck_sc (containers_by_id , health_scs_containers )
278279
279280 def _count_and_weigh_images (self ):
280281 try :
@@ -521,8 +522,13 @@ def _report_container_size(self, containers_by_id):
521522 self , 'docker.container.size_rootfs' , container ['SizeRootFs' ],
522523 tags = tags )
523524
524- def _send_container_healthcheck_sc (self , containers_by_id ):
525+ def _send_container_healthcheck_sc (self , containers_by_id , whitelist ):
525526 for container in containers_by_id .itervalues ():
527+ # O(n) nasty :( (pass dict or set?)
528+ # TODO: address tagging.
529+ if container .get ('Image' ) not in whitelist :
530+ continue
531+
526532 health = container .get ('health' , {})
527533 tags = self ._get_tags (container , CONTAINER )
528534 status = AgentCheck .UNKNOWN
You can’t perform that action at this time.
0 commit comments