Code: Select all
{
:local tempSystem [/system health get [find name=temperature] value]
:local DeviceName [/system identity get name]
:local tempMax "45";
:if ($tempSystem >= $tempMax) do={
:log error "HIGH Temperature Alert: $tempSystem C";
# START Send Telegram Module
:local MessageText "\E2\9A\A0 <b>Router $DeviceName:</b>%0AHIGH Temperature Alert: $tempSystem C";
:local SendTelegramMessage [:parse [/system script get MyTGBotSendMessage source]];
$SendTelegramMessage MessageText=$MessageText;
# END Send Telegram Module
/tool e-mail send to="xxxxxxx@gmail.com" subject="\E2\9A\A0 [$DeviceName] HIGH Temperature Alert" body="The temperature in the router has reached a value of $tempSystem C"
} else={
:log info "The temperature is within the normal range: $tempSystem C"
}
}
What I want: 45 ºC
What I have achieved: 45 C
The results of the script should send a message via Telegram and gives error when I put the code "%B0" or "\B0" that according to this table corresponds to it: https://www.barcodefaq.com/ascii-chart-char-set/.
It also sends an email and I use this HTML code without success: "°" or "°".
I don't get results in the syslog either.
Any advice?
BR.