Community discussions

MikroTik App
 
pomah
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Fri Aug 15, 2014 5:00 pm

Send email if router rejects someone to my wifi

Sun Jan 31, 2021 11:50 pm

Hi

I have today a wifi setup using access list (CAPSMAN) and I would like to get an email sent to me everytime someone is rejected by the system? Is that possible and could someone get me a step by step?

The ideal solution would be if I would be able to get the same message that is printed in the log sent to me as an email, e.g.
Time		Jan/31/2021 22:14:24
Buffer		memory
Topics		
caps
info
Message		00:00:00:00:00:00@CAP_name rejected, forbidden by access-list
I am sorry if this has been asked before but I did not find anything relevant when searching the forums.
 
Van9018
Long time Member
Long time Member
Posts: 558
Joined: Mon Jun 16, 2014 6:26 pm
Location: Canada - Abbotsford

Re: Send email if router rejects someone to my wifi

Mon Feb 01, 2021 5:54 am

I think you'd have to use scripting. Scripts run on a schedule, every x minutes. The script would scan the log for keywords.
https://wiki.mikrotik.com/wiki/Manual:Scripting
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2984
Joined: Mon Apr 08, 2019 1:16 am

Re: Send email if router rejects someone to my wifi

Mon Feb 01, 2021 2:46 pm

System/Logging , new action, action type = email ?

Didn't try it yet.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Send email if router rejects someone to my wifi

Mon Feb 01, 2021 4:41 pm

Problem with that solution often is that logging selection criteria are not good enough.
I.e. there is no way to select logging actions on a regexp match with the actual message contents, and while you can select on the logging topics there a not enough unique topics defined to select a single message type.
In this case you would select on "caps,info" but you would get ALL messages with topic caps,info and it could be way too many.

I have registered a feature request some time ago to allow selecting logging actions based on regexp match with the message content.
Alternatively, a logging topic should be defined for each unique message in the system.

As it is now, your only solution is to have a regularly scheduled job that scans the messages logged to memory and picks out the interesting ones and mails them.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2984
Joined: Mon Apr 08, 2019 1:16 am

Re: Send email if router rejects someone to my wifi

Mon Feb 01, 2021 4:56 pm

Yes this filter feature is missing. I use DUDE's syslog filters to reduce the number of messages (but email is not one of my actions so far)
(Not trying to master the RegExp syntax yet, just adding many simple rules)
..

Klembord-1.jpg
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: norepto and 14 guests