Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env python
import sys
from dlcli import api
Returns a sum of the number of agents that have returned the base.count metric in the last minute.
You will need to update the TAG, org, account and key variables in the settings below.
# Settings
TAG = 'mytag'
settings = {
'url': '',
'org': 'myorg',
'account': 'myaccount',
'key': 'myapikey',
count = 0
for series in api.series.get_tag_series(tag=TAG, metric='base.count', resolution='30', period='60', **settings):
count += int(series['points'][0]['avg'])
print "OK | count=%d;;;;" % count
except Exception, e:
print "FAIL! %s" % e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment