Kapacitor: how to pass args like Messages , ID in .exec node

Created on 22 Jun 2017  路  7Comments  路  Source: influxdata/kapacitor

Anyone can show me a complete example? Thanks!

I want to exec a script to send alert massage to dingtalk robot, but don't know to pass the alert massage, the official documentation does not have a relevant complete application case

Most helpful comment

@qi-zhou below is a sample python script to read ".message" field.

alert_stdin = sys.stdin.readline()
alert_json = json.loads(alert_stdin)
service_name_str = alert_json.get("message")

All 7 comments

That information is passed over STDIN to the process in a JSON format.

@nathanielc Thank you for answering in time! I know what you mean but don't know how to implement in TICKscript. Can you show a complete example in official documentation or here, Thanks first!

@qi-zhou below is a sample python script to read ".message" field.

alert_stdin = sys.stdin.readline()
alert_json = json.loads(alert_stdin)
service_name_str = alert_json.get("message")

@adityacs Thank you very much! Follow your example
It has been successful!

@nathanielc You can close this issue.

@adityacs Thank you very much! Follow your example
It has been successful!

Could you help share your full script , we also want to send the alert to Dingtalk, but it is not work use post method. thanks !

@AndyFan2017 Let know what you are trying to achieve. We can assist based on your usecase

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nathanielc picture nathanielc  路  8Comments

evan-ty picture evan-ty  路  5Comments

mgresser picture mgresser  路  4Comments

phemmer picture phemmer  路  5Comments

nathanielc picture nathanielc  路  4Comments