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
| from subprocess import check_output | |
| from datadog import statsd | |
| from datadog.api.constants import CheckStatus | |
| import requests | |
| import re | |
| zpool_status = check_output(["/sbin/zpool", "status"]) | |
| pattern = re.compile('state: ONLINE') |
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
| def getCfResult(token, url, verify=False, resultsPerPage=50): | |
| """Get pages of json objects back from CF API URL""" | |
| headers = { | |
| "Authorization":"bearer {0}".format(token) | |
| } | |
| nextPage = True | |
| jsonResult = [] | |
| while nextPage: | |
| if "?" in url: | |
| resultString = "&results-per-page={0}".format(resultsPerPage) |
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
| a |