1

We're using Telegram notifications to get status of our Virtual Machines and other services using PRTG Monitoring Tool.

Problem

Notificacions are not working via CURL and POST

Configuration

curl -X POST https://api.telegram.org/<BOT_ID>/sendMessage -d 'chat_id=<CHAT_ID>&parse_mode=Markdown&text=%lastmessage %linksensor %since %group %device'

Error

{"ok":false,"error_code":400,"description":"Bad Request: text must be encoded in UTF-8"}

Testing

Playing with the configuration we noticed that Removing "%device" will make it work.

Question

It is a problem with the value "%device" in the Telegram Api via CURL or POST?

It is necessary for us to use "%device" value as it points to a PRTG Internal Variable.

Masplus
  • 83
  • 7
  • Maybe `%25device` instead of `%device`? – JosefZ Jul 14 '22 at 19:45
  • I'm not sure if it is a telegram related problem. I guess that for some reason you have non UTF-8 symbols in your %device name (after the substitution) – imbananko Jul 14 '22 at 20:30
  • Without using PRTG internal variables, only with the curl in my terminal, the word "%device" still break and show the UTF-8 Error. `curl -X POST https://api.telegram.org//sendMessage -d 'chat_id=&parse_mode=Markdown&text=%device'` So it seems to be related with some type of "banned" word for Telegram API ? – Masplus Jul 15 '22 at 21:06
  • @JosefZ I've tried this, and seems to work fine, the word "%device" shows in my Telegram chat. But in the console of PRTG, of course, the variable is not showing because is not named "%25device". Still seems to be a Telegram issue. – Masplus Jul 18 '22 at 12:51

1 Answers1

1

Also encountered this. If you use the synonym placeholder %server instead of %device, then everything starts working.

  • Thank you, seems to be a solution for this specific problem with PRTG but is still not working in Telegram Sentence. I'll continue with the investigation. – Masplus Oct 20 '22 at 05:32