B
B
brar2017-11-09 02:50:00
linux
brar, 2017-11-09 02:50:00

Fail2ban notifications in Telegram?

Web searches lead only to setting up telegram-cli. But I would like to configure via api.
For example, through a simple:

curl "https://api.telegram.org/botTOKEN/sendMessage?chat_id=XXXXXXXX&text=Asterisk-jail_is_stopped"
and ...Asterisk-jail_is_started.
In bash, the message arrives in the cart. I mean, it's the norm here.
In jail.conf in the asterisk jail added curl with this url to the action field. Fail2ban won't start. I understand that I was wrong.
Tell me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Grigoriev, 2017-11-09
@brar

In /etc/fail2ban/jail.conf, the action parameter specifies the configuration from the /etc/fail2ban/action.d directory
In general, Google will help you
https://blog.mypapit.net/2015/08/how-to-send- fail2...
If you don't want to use telegram-cli, then in /usr/share/fail2ban/fail2ban-telegram.sh write replacing telegram-cli with curl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question