Community discussions

MikroTik App
 
User avatar
omberli
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 88
Joined: Tue Oct 22, 2013 7:53 pm
Location: Norway
Contact:

Sending email from Tools/Netwatch

Tue Jun 12, 2018 7:44 pm

Trying to set up a simple system to monitor my network (approx 30 Mikrotik APs and clients). Found an article at
https://mikrotik.com/testdocs/ros/2.9/t ... twatch.php
that describes how to use Netwatch to do this.

Set up Netwatch for a couple of units, and it reports correctly if the unit is up or down.

Then tried to use the script at the end of the article to send me an email if a unit goes down. Used a script like
[admin@MikroTik] system script> add name=e-down source={/tool e-mail send
{... from="rieks@mt.lv" server="159.148.147.198" body="Router down"
{... subject="Router at second floor is down" to="rieks@latnet.lv"}

(changed the to and from addresses as well as the (mail)server IP-address),
No email is sent or received. Can't see anything in my mailserver logs.

Questions:
Most mail servers will need some kind of authentication to accept sending emails. How should this be entered into the script.
Anything else that should be changed in order for this to work?

Thanks!
-Olaf-
 
AndreasGR
newbie
Posts: 45
Joined: Mon May 14, 2018 5:27 pm

Re: Sending email from Tools/Netwatch  [SOLVED]

Tue Jun 12, 2018 8:28 pm

Have you tested the script by selecting run script?
If it does not run then check email settings.
If it runs and sends email then follow the logic below:

What are the script policies assigned?
Do you have other than read, write, test and reboot?
If yes deactivate all besides the above and test the script from netwatch.

Please refer to
viewtopic.php?f=2&t=134538
 
2frogs
Forum Veteran
Forum Veteran
Posts: 713
Joined: Fri Dec 03, 2010 1:38 am

Re: Sending email from Tools/Netwatch

Wed Jun 13, 2018 6:30 am

/tool e-mail send from="rieks@mt.lv" server="159.148.147.198" body="Router down" subject="Router at second floor is down" to="rieks@latnet.lv" port=25 user=rieks password=123abc start-tls=no
 
User avatar
omberli
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 88
Joined: Tue Oct 22, 2013 7:53 pm
Location: Norway
Contact:

Re: Sending email from Tools/Netwatch

Wed Jun 13, 2018 10:44 am

Thanks.
Problem solved after changing the policies and setting the right login info for our mailserver.

Another thing related to this..:
If monitoring 25-30 access points / clients in this way (running the script on one of them) - how will this affect the performance of the monitoring unit? Is it a good idea to have a separate "monitoring unit" in the system?

-Olaf-
 
bernd2
just joined
Posts: 9
Joined: Tue Dec 01, 2015 8:04 pm

Re: Sending email from Tools/Netwatch

Sat Jun 16, 2018 6:50 pm


If monitoring 25-30 access points / clients in this way (running the script on one of them) - how will this affect the performance of the monitoring unit? Is it a good idea to have a separate "monitoring unit" in the system?
-Olaf-

Not really a problem - monitoring is only a short ping. I monitor 68 devices on a mikrotik Hex RB750Gr3 - but maybe you want to use a separate unit, which also supports thedude (like the hex), the dude is able to monitor much more than just up/down :-)
 
glad3alb
just joined
Posts: 1
Joined: Sat Dec 01, 2018 2:13 am

Re: Sending email from Tools/Netwatch

Sat Dec 01, 2018 2:23 am

Thanks.
Problem solved after changing the policies and setting the right login info for our mailserver.

Another thing related to this..:
If monitoring 25-30 access points / clients in this way (running the script on one of them) - how will this affect the performance of the monitoring unit? Is it a good idea to have a separate "monitoring unit" in the system?

-Olaf-
Hello everyone I'm new in this forum I hope to learn a lot about my name and Luca
omberli too I have the same problem as you have solved then post the script
I would like to monitor an AP from Netwatch insert IP es 10.1.0.11 description = Name AP1 is UP / AP1 is DOWN and everything works on the logs I wanted to send an email when AP1 and UP and DOWN I tried with some guide that I found online but not me it works ( /tool e-mail send
to="myemail@gmail.com"
subject="$[/system identity get name]
WAN Internet Fibra e UP on $[/system clock get time]"

Who is online

Users browsing this forum: No registered users and 42 guests