Created
January 5, 2016 10:59
-
-
Save arthurzenika/5a93d6fab53f936689b1 to your computer and use it in GitHub Desktop.
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 event_return(events): | |
''' | |
Return event data to remote carbon server | |
Provide a list of events to be stored in carbon | |
''' | |
opts = _get_options({}) # Pass in empty ret, since this is a list of events | |
opts['skip'] = True | |
for event in events: | |
log.trace('Carbon returner received event: {0}'.format(event)) | |
metric_base = event['tag'] | |
# TODO move whitelisted functions that should be send to graphite in salt master configuration | |
if 'ret' in event['tag'].split('/') and event['data'].get('fun') in ('apache.server_status', 'munin.run'): | |
returner(event['data']) | |
else: | |
saltdata = event['data'].get('data') | |
_send(saltdata, metric_base, opts) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment