Kapacitor 使用 Proxy 连接小电报 API

由于众所周知的原因,小电报的 Bot API 在某些地方是完全无法访问的。

那么,这导致我们最好用,最快捷的告警方式被掐死了。

于是研究了一下,发现官方有一个回复:

https://community.influxdata.com/t/how-to-set-proxy-for-telegram-and-smtp/3250

The Kapacitor 你懂的 agent uses the golang HTTP client, so you can set that with the environment variables $http_proxy (or $https_proxy). As for SMTP, we don’t currently have logic in place for that, but that sounds like a great feature request.

于是加入环境变量,结果发现一个新问题。由于 Kapacitor 与 InfluxDB 之间的连接也是 HTTP 的,导致 InfluxDB 也走了代理,反而导致不通了。于是再次尝试,发现可以使用 NO_PROXY 变量,最终结果如下:

HTTP_PROXY=http://x.x.x.x:xxxx
HTTPS_PROXY=http://x.x.x.x:xxxx
NO_PROXY=influxdb.xxx.xxx

 

CC BY-NC-SA 4.0 Kapacitor 使用 Proxy 连接小电报 API by 桔子小窝 is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

One thought on “Kapacitor 使用 Proxy 连接小电报 API

回复 antior 取消回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据