diff --git a/sensu-alertmanager b/sensu-alertmanager index f178b2c..1c1f9f2 100755 --- a/sensu-alertmanager +++ b/sensu-alertmanager @@ -3,7 +3,7 @@ # To debug create a new sensu handler configured a tcp port 31337 # on host the host start nc -l # pipe the output from this to stdin of this script. -# or run a working version with --verbose=2 and reparse .message.Data +# or run a working version with --verbose=2 and reparse received alert import argparse import datetime @@ -28,7 +28,7 @@ def report(level, msg, alert=None): print(json.dumps(event)) def debug(msg, alert=None): - report("debug", msg) + report("debug", msg, alert) def log(msg, alert=None): report("info", msg, alert) @@ -97,7 +97,7 @@ def post(msg, retry=0): alert.append(msg) if retry: - log("Retry: {}".format(retry)) + log("Retry: {}".format(retry), alert) else: log("Sending to {}".format(args.alertmanager), alert) @@ -123,7 +123,7 @@ def post(msg, retry=0): def process(data): if (args.verbose > 1): - debug('Alert Received') + debug('Alert Received', data) md = data['check']['metadata'] entity_name = entity(data)