Hi,
i am having a failover over mikrotik router, and want to send me an email when ping to 8.8.8.8 over ethernet 1 / gw 1 send me an email? I am having script to send me email when there is no ping.
Hi,
i am having a failover over mikrotik router, and want to send me an email when ping to 8.8.8.8 over ethernet 1 / gw 1 send me an email? I am having script to send me email when there is no ping.
Hi.
This post could help you to fix it out.
http://forum.mikrotik.com/t/avg-rtt-from-ping-command/75110/1
#Mikrotik Ping more than 200ms to send mail
#https://ros.ac
#By:Ali
#From:China
: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
/tool e-mail send server=<Server IP> port=25 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";
}
Thanks all for reply. Just tell me, maybe here needs a space:
to=> to@mail.co> mf> rom=> from@mail.com
I have updated it
can you just tell me one thing. Server IP for email. What should I put here? If i want to send to gmail, i need to put gmail SMTP wan ip?
OneDrive:
tomislav91:
Thanks all for reply. Just tell me, maybe here needs a space:
I have updated it
can you just tell me one thing. Server IP for email. What should I put here? If i want to send to gmail, i need to put gmail SMTP wan ip?
#Mikrotik Ping more than 200ms to send mail
#https://ros.ac
#By:Ali
#From:China
:local Themes “Monitor IP delay to alarm threshold”
#Set the monitored IP address
:local addre 192.168.88.1;
#Parse the IP corresponding to the smtp mail server
:local smtps [:resolve smtp.gmail.com]
#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
/tool e-mail send server=$smtp port=25 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”;
}
tomislav91:
OneDrive:
tomislav91:
Thanks all for reply. Just tell me, maybe here needs a space:
to=> to@mail.co> mf> rom=> from@mail.com
I have updated it
can you just tell me one thing. Server IP for email. What should I put here? If i want to send to gmail, i need to put gmail SMTP wan ip?
#Mikrotik Ping more than 200ms to send mail
#https://ros.ac
#By:Ali
#From:China
:local Themes “Monitor IP delay to alarm threshold”
#Set the monitored IP address
:local addre 192.168.88.1;
#Parse the IP corresponding to the smtp mail server
:local smtps [:resolve smtp.gmail.com]
#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
/tool e-mail send server=$smtp port=25 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”;
}
Thanks for it.
Can you just tell me about Dude. Does it possible to get an alert for maybe ping to create alarms? Just ask because of much queries to router…
Can you just tell me about Dude. Does it possible to get an alert for maybe ping to create alarms? Just ask because of much queries to router…
yes, you can use it. for example i use it to send e-mail for warnings and not very critical events. and most important are also send to telegram.
but if you want to have a message when 200+ms then you have to make a probe for that
also you should remember that you will monitor “ping” from dude to your device, not between 2 devices. if you wont to monitor between 2 devices it will be more difficult to create a probe and all will depend an what devices you have
well done
tomislav91:
Can you just tell me about Dude. Does it possible to get an alert for maybe ping to create alarms? Just ask because of much queries to router…
yes, you can use it. for example i use it to send e-mail for warnings and not very critical events. and most important are also send to telegram.
but if you want to have a message when 200+ms then you have to make a probe for that
also you should remember that you will monitor “ping” from dude to your device, not between 2 devices. if you wont to monitor between 2 devices it will be more difficult to create a probe and all will depend an what devices you have
i only want to ping internet and to inform me when ping is big. I dont find that option, only when ping is lost. Any form of informing me will be ok…But in probe I cant find that option
Shadeofspirit:
tomislav91:
Can you just tell me about Dude. Does it possible to get an alert for maybe ping to create alarms? Just ask because of much queries to router…
yes, you can use it. for example i use it to send e-mail for warnings and not very critical events. and most important are also send to telegram.
but if you want to have a message when 200+ms then you have to make a probe for that
also you should remember that you will monitor “ping” from dude to your device, not between 2 devices. if you wont to monitor between 2 devices it will be more difficult to create a probe and all will depend an what devices you havei only want to ping internet and to inform me when ping is big. I dont find that option, only when ping is lost. Any form of informing me will be ok…But in probe I cant find that option
there is information about these probe in dude
http://forum.mikrotik.com/t/dudes-ping-function-rtt-differs-from-command-line-ping-rtt/31945/1
tomislav91:
Shadeofspirit:
tomislav91:
Can you just tell me about Dude. Does it possible to get an alert for maybe ping to create alarms? Just ask because of much queries to router…
yes, you can use it. for example i use it to send e-mail for warnings and not very critical events. and most important are also send to telegram.
but if you want to have a message when 200+ms then you have to make a probe for that
also you should remember that you will monitor “ping” from dude to your device, not between 2 devices. if you wont to monitor between 2 devices it will be more difficult to create a probe and all will depend an what devices you havei only want to ping internet and to inform me when ping is big. I dont find that option, only when ping is lost. Any form of informing me will be ok…But in probe I cant find that option
there is information about these probe in dude
http://forum.mikrotik.com/t/dudes-ping-function-rtt-differs-from-command-line-ping-rtt/31945/1
does it good like this? I change FirstDevice to my ip address of router which i want to ping.
Shadeofspirit:
tomislav91:
Shadeofspirit:
tomislav91:
Can you just tell me about Dude. Does it possible to get an alert for maybe ping to create alarms? Just ask because of much queries to router…
yes, you can use it. for example i use it to send e-mail for warnings and not very critical events. and most important are also send to telegram.
but if you want to have a message when 200+ms then you have to make a probe for that
also you should remember that you will monitor “ping” from dude to your device, not between 2 devices. if you wont to monitor between 2 devices it will be more difficult to create a probe and all will depend an what devices you havei only want to ping internet and to inform me when ping is big. I dont find that option, only when ping is lost. Any form of informing me will be ok…But in probe I cant find that option
there is information about these probe in dude
http://forum.mikrotik.com/t/dudes-ping-function-rtt-differs-from-command-line-ping-rtt/31945/1does it good like this? I change FirstDevice to my ip address of router which i want to ping.
dawww.jpg
No! Device_property is function thar returns propertys of the device, firstaddress is subfunction - to get ip address.
if you want to monitor rtt to your device - just add this probe without changes to this device
if you want to monitor not your device you have 2 variants - change probe (without device_property), the second variant is to add new device (for example 8.8.8. and to it probe from post without changes.
than you can change alerts to device at all or to particular probe
look there fo my example with “new device” 8.8.8.8 https://drive.google.com/open?id=0Bxq9Ym3e0mk-SWRabzJ2X1A1ZjQ
tomislav91:
Shadeofspirit:
tomislav91:
Shadeofspirit:
yes, you can use it. for example i use it to send e-mail for warnings and not very critical events. and most important are also send to telegram.
but if you want to have a message when 200+ms then you have to make a probe for that
also you should remember that you will monitor “ping” from dude to your device, not between 2 devices. if you wont to monitor between 2 devices it will be more difficult to create a probe and all will depend an what devices you havei only want to ping internet and to inform me when ping is big. I dont find that option, only when ping is lost. Any form of informing me will be ok…But in probe I cant find that option
there is information about these probe in dude
http://forum.mikrotik.com/t/dudes-ping-function-rtt-differs-from-command-line-ping-rtt/31945/1does it good like this? I change FirstDevice to my ip address of router which i want to ping.
dawww.jpgNo! Device_property is function thar returns propertys of the device, firstaddress is subfunction - to get ip address.
if you want to monitor rtt to your device - just add this probe without changes to this device
if you want to monitor not your device you have 2 variants - change probe (without device_property), the second variant is to add new device (for example 8.8.8.and to it probe from post without changes.
than you can change alerts to device at all or to particular probelook there fo my example with “new device” 8.8.8.8 https://drive.google.com/open?id=0Bxq9Ym3e0mk-SWRabzJ2X1A1ZjQ
problematics is next:
i am having failovers on most of my devices. So when internet in LAN1 for example is bad, ping is big i want to change internet to another port *for example port 2.
Failover will change it when there is no ping, but idea is that i got inform when ping is higher than 200ms and then i will change it by my self. Of course I will ping 8.8.8.8.
I add probe to my dude when I have more than 1 device
Is this that? How can I decide on which device this working? Or that work on all devices in Dude?
Is this that? How can I decide on which device this working? Or that work on all devices in Dude?
look this: https://drive.google.com/open?id=0Bxq9Ym3e0mk-bXptQXRXX2JCYkk
i modified this probe to your needs.
add it to all devices from which you want to monitor ping to 8.8.8.8
actually, i don,t know what to do if this devices are not RB or there are no RB in this site, but if it is mikrotik - as agent (when you add service to monitor) select this RB or other RB in this site
it is so, because this probe will monitor ping rtt from “agent” to 8.8.8.8
tomislav91:
Is this that? How can I decide on which device this working? Or that work on all devices in Dude?
look this: https://drive.google.com/open?id=0Bxq9Ym3e0mk-bXptQXRXX2JCYkk
i modified this probe to your needs.
add it to all devices from which you want to monitor ping to 8.8.8.8
actually, i don,t know what to do if this devices are not RB or there are no RB in this site, but if it is mikrotik - as agent (when you add service to monitor) select this RB or other RB in this site
it is so, because this probe will monitor ping rtt from “agent” to 8.8.8.8
so it will inform me when ping is more than 200ms ? I first add service (i am having services ping and routeros managment), so just add this with probe and thats it?
Shadeofspirit:
tomislav91:
Is this that? How can I decide on which device this working? Or that work on all devices in Dude?
look this: https://drive.google.com/open?id=0Bxq9Ym3e0mk-bXptQXRXX2JCYkk
i modified this probe to your needs.
add it to all devices from which you want to monitor ping to 8.8.8.8
actually, i don,t know what to do if this devices are not RB or there are no RB in this site, but if it is mikrotik - as agent (when you add service to monitor) select this RB or other RB in this site
it is so, because this probe will monitor ping rtt from “agent” to 8.8.8.8so it will inform me when ping is more than 200ms ? I first add service (i am having services ping and routeros managment), so just add this with probe and thats it?
if you want to monitor 200ms - change in probe 120 to 200 (i marked in screenshot)
than add this probe as service to your device
set notifications to this device or to this particular service
for testing you can change rtt to 10ms for example - you will see if you will get notification
tomislav91:
Shadeofspirit:
tomislav91:
Is this that? How can I decide on which device this working? Or that work on all devices in Dude?
look this: https://drive.google.com/open?id=0Bxq9Ym3e0mk-bXptQXRXX2JCYkk
i modified this probe to your needs.
add it to all devices from which you want to monitor ping to 8.8.8.8
actually, i don,t know what to do if this devices are not RB or there are no RB in this site, but if it is mikrotik - as agent (when you add service to monitor) select this RB or other RB in this site
it is so, because this probe will monitor ping rtt from “agent” to 8.8.8.8so it will inform me when ping is more than 200ms ? I first add service (i am having services ping and routeros managment), so just add this with probe and thats it?
if you want to monitor 200ms - change in probe 120 to 200 (i marked in screenshot)
than add this probe as service to your device
set notifications to this device or to this particular servicefor testing you can change rtt to 10ms for example - you will see if you will get notification
i did it, but in services when i was add service it give me parse failed.
Shadeofspirit:
tomislav91:
Shadeofspirit:
tomislav91:
Is this that? How can I decide on which device this working? Or that work on all devices in Dude?
look this: https://drive.google.com/open?id=0Bxq9Ym3e0mk-bXptQXRXX2JCYkk
i modified this probe to your needs.
add it to all devices from which you want to monitor ping to 8.8.8.8
actually, i don,t know what to do if this devices are not RB or there are no RB in this site, but if it is mikrotik - as agent (when you add service to monitor) select this RB or other RB in this site
it is so, because this probe will monitor ping rtt from “agent” to 8.8.8.8so it will inform me when ping is more than 200ms ? I first add service (i am having services ping and routeros managment), so just add this with probe and thats it?
if you want to monitor 200ms - change in probe 120 to 200 (i marked in screenshot)
than add this probe as service to your device
set notifications to this device or to this particular servicefor testing you can change rtt to 10ms for example - you will see if you will get notification
i did it, but in services when i was add service it give me parse failed.
check - you deleted coma after 15