# Looking to execute scripts on events

**URL:** <https://discourse.haproxy.org/t/looking-to-execute-scripts-on-events/5353>\
**Category:** Help!\
**Created:** [June 17, 2020, 3:44pm UTC](https://discourse.haproxy.org/t/looking-to-execute-scripts-on-events/5353 "2020-06-17T15:44:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://discourse.haproxy.org/u/bluepuma77)\
**Post date:** [June 17, 2020, 3:44pm UTC](https://discourse.haproxy.org/t/looking-to-execute-scripts-on-events/5353/1 "2020-06-17T15:44:08Z")

</div>

Hi all,

I am new to haproxy, but pretty happy with it so far. I was wondering if there is any option to run scripts in case of failover.

So far I only found options to email and log. But I would rather run a script to send a SMS or run some re-configuration.

Is there any support for this? Planned?

Thanks  
bluepuma

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://discourse.haproxy.org/u/bluepuma77)\
**Post date:** [June 18, 2020, 8:30pm UTC](https://discourse.haproxy.org/t/looking-to-execute-scripts-on-events/5353/2 "2020-06-18T20:30:40Z")

</div>

My research only came up with two sub-optimal solutions:

I have to use a SMTP-HTTP gateway to trigger events with other services.

> **[HAProxy Alerts with WebHooks](https://el-tramo.be/blog/haproxy-webhook-alerts/)**
>
> I want to be notified immediately when one of the backend servers behind my HAProxy instance goes down. HAProxy offers alerting functionality, but only via SMTP: when a backend goes down it sends an email to a list of recipients via an SMTP server...

Or trigger something by replacing the checks itself with my own script.

> <https://serverfault.com/questions/883531/haproxy-run-script-on-health-check-change>

Why not have something like

```
script-alert <script> 
script-alert level alert

```

or

```
webhook-alert <uri> 
webhook-alert level alert
```

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [June 18, 2020, 9:09pm UTC](https://discourse.haproxy.org/t/looking-to-execute-scripts-on-events/5353/3 "2020-06-18T21:09:48Z")

</div>

Best to file a feature request here:

> **[haproxy/haproxy](https://github.com/haproxy/haproxy/issues)**
>
> HAProxy Load Balancer's development branch (mirror of git.haproxy.org) - haproxy/haproxy

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://discourse.haproxy.org/u/bluepuma77)\
**Post date:** [June 18, 2020, 10:03pm UTC](https://discourse.haproxy.org/t/looking-to-execute-scripts-on-events/5353/4 "2020-06-18T22:03:34Z")

</div>

Done, thanks, see [here](https://github.com/haproxy/haproxy/issues/696).
