Created
December 16, 2014 15:54
-
-
Save anonymous/fd5ed9075cc026acc607 to your computer and use it in GitHub Desktop.
Quick Container Check
This file contains hidden or 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
#!/usr/bin/env python | |
from docker import Client | |
import json | |
d = Client(base_url='unix://var/run/docker.sock') | |
containers = d.containers() | |
metrics = { | |
'/redis': '1', | |
'/rsyslog': '1', | |
'/usagetracking_http_additional_logging': '1', | |
'/prctrdx001': '1', | |
'/prctrrb001': '1' | |
} | |
for container in containers: | |
metrics[container["Names"][0]] = '0' | |
perf_data = "OK | " | |
for k, v in metrics.iteritems(): | |
perf_data += "%s=%s;;;; " % (k, v) | |
print perf_data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment