New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


PRTG with telegram

Votes:

14

Your Vote:

Up

Down

Today telegram launched a new service. Telegram BOT. You can HTTP trigger this bot to send messages / photo etc.

At a older article i created a telegram bot with Linux but now its much easyer to do this.

1. First you must create a telegram account and add BotFather to you list. To do this click on the following url: https://telegram.me/botfather

2. Genrate a new bot with the command "/newbot" BotFather is then asking for a username and a normal name. After that your bot is created and you get a HTTP token. (for more options for your bot type "/help")

3. Add your bot to telegram with the following url

http://telegram.me/<botname>

and send some text to the bot.

4. Now copy your token code and go to the following page in chrome:

https://api.telegram.org/bot<tokencode>/getUpdates

5. You see a json code with the message you sent to the bot. Copy the Chat id. In this example that is “-9787468”

"message":{"message_id":7,"from":{"id":656556,"first_name":"Joo","last_name":"Doo","username":"JohnDoo"},"chat":{"id":-9787468,"title":"Telegram Group"},"date":1435216924,"text":"Hi"}}]}

6. Now create a new notification (setup -> account settings -> notifications). Check the “Execute http action” and put the following url in the box:

URL:

https://api.telegram.org/bot<tokencode>/sendMessage

Postdata:

chat_id=<chatid>&text=PRTG: %status %shortname %device :: %probe -- %group -- %commentsdevice

Now save the config and test it 

bot custom-notification notification notifications telegram

Created on Jun 25, 2015 12:10:13 PM by  Systeembeheer NSD (24) 1

Last change on Jun 25, 2015 12:23:44 PM by  Felix Saure [Paessler Support]



16 Replies

Accepted Answer

Votes:

5

Your Vote:

Up

Down

Hi there, thank you very much for sharing your guide with the community!

Created on Jun 25, 2015 12:25:39 PM by  Felix Saure [Paessler Support]



Votes:

0

Your Vote:

Up

Down

I agree, this is really nice, especially since Telegram is available on mobile and desktop. Nice!

Created on Jun 26, 2015 7:23:46 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Work like a charm! Thank you so much.

Created on Jun 29, 2015 7:38:23 AM by  kjloh (0)



Votes:

0

Your Vote:

Up

Down

Super stuff. SMS modem won't eat up my credits. Thank You.

Created on Jan 17, 2016 8:21:33 AM by  joeq8 (0)



Votes:

0

Your Vote:

Up

Down

It doesn't work! Because Telegram demands that link was in the UTF-8 format, and "%group" is a mistake because symbols in UTF-8 look just %XX.

Request: https://api.telegram.org/bot111111111:QWERTYUIOP/sendMessage?chat_id=11111111&text=%device

Telegram answer error: {"ok":false,"error_code":400,"description":"[Error]: Bad Request: Message text must be in utf-8"}

Created on Mar 25, 2016 7:35:08 AM by  amiko (0)



Votes:

1

Your Vote:

Up

Down

I got an error of this type:

{"ok":true,"result":[]}

That was because privacy of the bot was set to Enabled. Go to the BotFather and type command

/setprivacy

to Disable privacy of the bot. In that way, the bot can receive messages.

After that, send a message to the bot.

Then run in Chrome

https://api.telegram.org/bot<tokencode>/getUpdates again

You will receive the correct json code.

Created on Aug 9, 2016 8:17:52 PM by  Gerrysole (10) 1



Votes:

0

Your Vote:

Up

Down

Thanks for sharing! :)

Created on Aug 10, 2016 6:05:44 AM by  Stephan Linke [Paessler Support]



Votes:

1

Your Vote:

Up

Down

There is also a new way to get the ID.

Add the IDBot user to telegram and your group and type "/getidgroup" or if you want to send the messages to yourself use /getid

https://telegram.me/myidbot

Created on Aug 10, 2016 7:06:04 AM by  Systeembeheer NSD (24) 1



Votes:

0

Your Vote:

Up

Down

When I put in the post data I get the following error:

Fehler (Bad Request) Die Überprüfung der Eingaben schlug fehl: Post-Daten: Buchstabenfolgen (&apos;<...>&apos;) die ein HTML Tag darstellen können, sind hier nicht erlaubt in Benachrichtigung "HTTP"

Created on Feb 12, 2017 8:05:42 PM by  Carsten_R (0) 1



Votes:

0

Your Vote:

Up

Down

What exactly are you posting to the bot? Does "Hello World!" work fine?

Created on Mar 16, 2017 12:47:26 PM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

When I try to save the notification screen in the Postdata field of the following error:

Error (Bad Request) The validation of the data provided failed due to the following: Postdata: Character sequences ('<...>') which can potentially form a tag are not allowed here in notify "HTTP"

Created on Apr 10, 2017 4:34:44 PM by  lelecobh (0)



Votes:

0

Your Vote:

Up

Down

Could you post your entire post data field, minus the chat id? You probably have the pointy brackets within the post field somewhere, hence it's failing.

Created on Apr 11, 2017 8:16:23 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi

I configurated my notification with this parameters

URL: https://api.telegram.org/bot<tokenid>/sendMessage

Postdata: chat_id=xxxxxx&text=PRTG: %status %shortname %device %probe %group %commentsdevice

and works very well.

Thanks

Created on Apr 20, 2017 11:26:06 AM by  Elvira Soto Arjona (150) 1 1



Votes:

0

Your Vote:

Up

Down

Hi Elvira,

Good to hear. I hope you enjoy this feature. :)

Best regards.

Created on Apr 20, 2017 11:41:04 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hello, trying to get notifications from my bot, i tested it in browser and then in prtg. Browser test is ok, but PRTG isn't working.
My request in browser is: https://api.telegram.org/bot...:.../sendMessage?chat_id=-....&text=1
My request in PRTG Http action: url: https://api.telegram.org/bot...:.../sendMessage postdata: chat_id=-....&text=1 Please help me to solve this problem :)

Created on May 19, 2017 10:11:22 PM by  HotSizzle (0)

Last change on May 22, 2017 8:57:34 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi there,

Please check what the logs are saying under "Logs > System Events > Notifications". There you should see either "Ok.." or an error next to the notifications name.

Best regards.

Created on May 22, 2017 8:58:28 AM by  Dariusz Gorka [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.