Hello guys,
I am having troubles figuring out how to make a script to send all IP addresses preferably from specific Name(BitTorrent_Users) in Firewall address-lists to my e-mail using SMTP server that is tested and is working. Recently I made some regexp to catch every IP address that uses BitTorrent protocol and list it in Address Lists. Now I want to get notified when someone is “caught” using BitTorrent protocol. Preferably as soon as listed in Address Lists, but using scheduler would do the trick as well. At the moment I only have some scripts I have found on Mikrotik forum that are below. Any help is appreciated!
:log info message=(“Start Sending Report”);
:local ipList value=“”;
:foreach tmpAddress in=[/ip firewall address-list find where dynamic=yes and list=blacklist-dyn] do={
:set $ipList value=([/ip firewall address-list get $tmpAddress value-name=address].“\r\n”.$ipList);
};
/tool e-mail send from=“example@example.com“ to=“example2@example2.com" subject=("List report of “.[/system clock get date].” ".[/system clock get time]) body=(“List of auto-blacklisted host:\r\n”.$ipList);
:log info message=(“Sending Report End”);