I have problems with notifications on zabbix to telegram messenger.
So, I specified different guides for that. But not successful.
For example I use this guides
This solutions works for bash. But I can send this from zabbix.
export to=$1;
export subject=$2;
export body=$3;
tgpath=/usr/src/tg/zabbix
cd ${tgpath}
(sleep 5; echo "msg $to $subject $body"; echo "safe_quit") |
${tgpath}/telegram-cli -k /etc/telegram-cli/mykey.pub -W
Key telegram-cli -e
does not work correctly with a login name and with format user#XXXXXX;
I dont want to use some API to send message.
Thank you for any help.
2
Answers
Your script is not equal to the blog post.
The steps are:
0 – Compile
1 – Create a file
/usr/src/tg/viacron/telegram.config
an put this:2 – Create a file
/usr/src/tg/viacron/telegram.config
an put this:3 – Change permissions:
4 – Test:
5 – Put
AlertScriptsPath=/usr/src/tg/viacron/
inzabbix_server.conf
and restart the server6 – In zabbix, add new media type with name
telegram_standalone.sh
More information in https://gist.github.com/gnumoksha/a95f237d82733ce1f748 and http://tobias.ws/blog/zabbix-com-notificacoes-pelo-telegram/
Now Telegram supported by default
check:
https://www.zabbix.com/integrations/telegram
and there is extra settings check:
https://youtu.be/TpP6NpS9jjg?t=143