# Execute scripts in NotificationsEndpoint

**URL:** <https://community.influxdata.com/t/execute-scripts-in-notificationsendpoint/21481>\
**Category:** InfluxDB 2\
**Created:** [August 31, 2021, 8:17am UTC](https://community.influxdata.com/t/execute-scripts-in-notificationsendpoint/21481 "2021-08-31T08:17:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nyah](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@nyah](https://community.influxdata.com/u/nyah)\
**Post date:** [August 31, 2021, 8:17am UTC](https://community.influxdata.com/t/execute-scripts-in-notificationsendpoint/21481/1 "2021-08-31T08:17:00Z")

</div>

Hi All,

I would like to know if it is possible execute scripts (bash,python…) like a notifications endpoints in Influx2.0.

Anybody knows??

In kapacitor, it was possible to use in alerts, exec() function,it was so useful for me and I realize that I dont have this option anymore using Influx2.0.

The same with email() function, Now i have to install a client, use a task.

These functionalities saved my life trying to notify customs clients specially exec option.

In the future,do you have any perspective to add again??

Thanks so much!!

BR.

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [August 31, 2021, 3:04pm UTC](https://community.influxdata.com/t/execute-scripts-in-notificationsendpoint/21481/2 "2021-08-31T15:04:50Z")

</div>

Hello @nyah,  
You could use the http.post() function to trigger a lambda function:

> **[Invoke AWS Lambda Functions Over HTTPS](https://aws.amazon.com/about-aws/whats-new/2015/07/invoke-aws-lambda-functions-over-https/)**

There are a variety of notification endpoint functions though. Here’s the doc on how to send emails with a task.

> **[Send alert email | InfluxDB Cloud Documentation](https://docs.influxdata.com/influxdb/cloud/monitor-alert/send-email/)**
>
> Send an alert email.

I’d also suggest commenting on this issue:

> <https://github.com/influxdata/flux/issues/310>
>
> // Execute a command whenever an alert is triggered and pass the alert data over… STDIN in JSON format.
> // tick:property
> func (n \*AlertNodeData) Exec(executable string, args ...string) \*ExecHandler {
> exec := &ExecHandler{
> AlertNodeData: n,
> Command: append(\[\]string{executable}, args...),
> }
> n.ExecHandlers = append(n.ExecHandlers, exec)
> return exec
> }
> 
> This has been extremely critical in our use of Kapacitor and remains a unique advantage for the TICK stack. I would hope that the Tasks in flux that run queries for alerts, can still call arbitrary path and executable along with passing results of the query.
> For example, query returns hostname of hosts not responding, pass the host name to my exec argument to run my third party cli tool that can restart that host. From my understanding UDF will still be available in Flux, but this path exec call expands the use cases to the point that without it, I would consider my alternatives long term as it would take too much effort to maintain all the features I use it for in separate UDFs.

---

<div class="post-metadata">

**Author:** ![soniahcp](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@soniahcp](https://community.influxdata.com/u/soniahcp)\
**Post date:** [April 2, 2022, 8:29am UTC](https://community.influxdata.com/t/execute-scripts-in-notificationsendpoint/21481/3 "2022-04-02T08:29:39Z")

</div>

Hi Again,

I tried this option but it’s not the same. 😔

I wonder to know if it has a option to execute a script (like a output) in an alert with flux using Influx 2.0, executing a http post it’s not enough for me because I can’t have the same functionality.

I can’t migrate all my infrastructure to Influx2.0 if I don’t have the same functionalities like kapacitor has in alert node, for example exec(), email() without install a client,etc 😅

Thanks yo much!!  
BR.

---

<div class="post-metadata">

**Author:** ![Mark\_influx](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Mark\_influx](https://community.influxdata.com/u/Mark_influx)\
**Post date:** [April 6, 2022, 1:44pm UTC](https://community.influxdata.com/t/execute-scripts-in-notificationsendpoint/21481/4 "2022-04-06T13:44:51Z")

</div>

the simple way is install grafana… i try in every setup but not find how to sent mail alert with kapacitor or only mail for influxdb2

---

<div class="post-metadata">

**Author:** ![soniahcp](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@soniahcp](https://community.influxdata.com/u/soniahcp)\
**Post date:** [April 6, 2022, 2:28pm UTC](https://community.influxdata.com/t/execute-scripts-in-notificationsendpoint/21481/5 "2022-04-06T14:28:56Z")

</div>

In my organisation, we are not allow to sent email using grafana so it’s not a option for me, apart of that, at the end of the day you have to install more applications to do the same you were doing with kapacitor and solve the options removed.
