Telegram Notifications

Started by alexkgr, November 04, 2023, 07:32:49 AM

Previous topic - Next topic
Quote from: kozistan on January 07, 2024, 08:28:51 PM
Hi Fright, this is working for me. As i press apply on MONIT setting i get message regarding CPUUsage, but just once after apply. No other messages regarding CPUUsage are coming, even the load is more that 15%

I was able to configure like in example on link you provided and Notification are working as expected, great work indeed.
I am not sure if there is possibility somehow to setup monit to use Telegram and not SMTP, would save us work to setup everything to execute and your script, but I personal can live with that, I don't have that much Notifications.

@vrabac thanks!
Quoteif there is possibility somehow to setup monit to use Telegram and not SMTP
hmm, I'm not sure I understood correctly, but for telegram to work it is not necessary to configure "Alert settings",
and any (fake) smtp server address can be specified (just so the form validation would be happy)

I'm on v23.7.12 and would love to see the official integration. If I can help with testing, I will.

Hi,
I was trying to setup a notification to be sent when a host goes down.
It works, but in the message that I receive on Telegram I would like to see the IP that failed.
I'm attaching my configuration.

Thanks!

April 12, 2024, 02:13:49 PM #64 Last Edit: April 12, 2024, 02:15:52 PM by Fright
Hi
i think the quickest way to do this with the $SERVICE monit variable:
change "Service name" to something like "My_server_check" and
change Telegram message template ('Message' field with 'Advanced mode' enabled in Telegram settings) to something like:

<b>DATE:</b> {MONIT_DATE}
<b>HOST:</b> {MONIT_HOST}
<b>SERVICE:</b> {MONIT_SERVICE}
<b>DESCRIPTION:</b>
<pre>{MONIT_DESCRIPTION}</pre>

to include this variable to message