Email alert by bad ping latency

[code:local Themes “Monitor IP delay to alarm threshold”
#Set the monitored IP address
:local addre 192.168.88.1;
#Set the delay
:local ms 200;
:local avgRtt;
/tool flood-ping $addre count=10 do={
:if ($sent = 10) do={
:set avgRtt $“avg-rtt”
}}
:if ($avgRtt >= $ms) do={
#Send mail Where set i the TLS mode on this script?
/tool e-mail send server= port=587 user= password= to=to@mail.com from=from@mail.com subject=$Themes body=(“Monitoring IP:$addre\ndelay:$avgRtt ms”)
:log err “Message has been sent”;
}][/code]

I have that see in the forum but i don’t find it, ik will add TLS description.
Who can help me please




[code:local Themes "Monitor IP delay to alarm threshold"
#Set the monitored IP address
:local addre 192.168.88.1;
#Set the delay
:local ms 200;
:local avgRtt;
/tool flood-ping $addre count=10 do={
:if ($sent = 10) do={
:set avgRtt $"avg-rtt"
}}
:if ($avgRtt >= $ms) do={
#Send mail Where set i the TLS mode on this script?
/tool e-mail send server=<Server IP> port=587 user=<user> password=<pass> to=to@mail.com from=from@mail.com subject=$Themes body=("Monitoring IP:$addre\ndelay:$avgRtt ms")
:log err "Message has been sent";

https://wiki.mikrotik.com/wiki/Manual:Tools/email

Add “tls=yes” after send

Edit your post and adde a ] to the [code

You can also change server setting for email from:

/tool e-mail send server=<Server IP> port=587 user=<user> password=<pass> to=to@mail.com from=from@mail.com subject=$Themes body=("Monitoring IP:$addre\ndelay:$avgRtt ms")
:log err "Message has been sent";

To:

/tool e-mail send to=to@mail.com subject=$Themes body=("Monitoring IP:$addre\ndelay:$avgRtt ms")
:log err "Message has been sent";

Add all email settings including TLS so all script uses the same her:
Tools->Email or terminal

/tool e-mail set address=<Server IP> port=587 start-tls=yes from=from@mail.com user=<user> password=<pass>

Sorry it don’t work :frowning:

Anybody?

I am not really sure what you are asking, or what behavior your are experiencing. Will need more information. Is the email not being sent correctly? Are you referring to the TLS property of the email tool? Does the mail.com server return an error?

The email will not be sent

  1. Has it ever worked?

  2. Are you using gmail?
    If so, have you configured google to accept gmail relay, if not, it does not work.

It has worked but only at last bugfix.
I use my email information from Telenet (Belgium)
Thanks for your reply

If this problem started recently, but was working before, perhaps your provider Telenet changed something or added a requirement similar to the gmail relay requirement mentioned by @Jotne. I can tell you that I have not had a problem with gmail or zoho mail up to and including 6.40.4, running on a RB3011.

My config is similar to the one suggested by @plisken, but one of the problems I had initially was with the TLS setting. With ZOHO mail I had to select start-tls=tls-only in the Email Setting. Selecting tls=yes in the send email tool DID NOT WORK. Try selecting “tls-only” instead of “yes” when setting up the email settings. Here’s the settings that I use for Zoho mail (start-tls=yes fails with, but start-tls=tls-only works) This is my config:

/tool e-mail set address= from=“” password=
port= start-tls=tls-only user=user@mail.com

/tool e-mail send to=“” subject=<“Subject text”> body=“”

Hope this helps,

I have tried with gmail but it does not work.
Nobody can improve that script pleace

Are you able to send email from the MikroTik?
Tools->Email->Send Email
At the same time open your Log to see what going on.
If you can not send email from there, then the error is not in the script.

Yes i can email send from the Mikrotik to Gmail and recieve the test email thats works

Hello, a question how can I do it so that I can do it on a specific WAN, I have 2 wan and I would like it to be indicated when there is latency in 2. Greetings