Hello,
who is it possible to send ma an email, every x time from an interface with rx and tx bytes ?
Regards Daniel

Hello,
who is it possible to send ma an email, every x time from an interface with rx and tx bytes ?
Regards Daniel

You can create scheduler script which will trigger in some interval:
Here is a snippet to get interface tx/rx bytes :
:local intf <interface_name>
/interface
:local tx [get $intf tx-byte]
:local rx [get $intf rx-byte]
Setup configuration for sending email in Tools->Email if not set, and in scheduler script use
/tool/e-mail/send
command to send variables from snippet, ex:
/tool/e-mail/send to="<to_email_address>" subject="<some subject>" body="Interface: $intf\nTx: $tx\nRx: $rx"
P.S.
Since your post http://forum.mikrotik.com/t/monthly-evaluation-interface-list/166492/1 gives more context, you will need to persist byte counters with other short interval scheduler script in case of reboot, you can use interface comment for that storage. Also reset interface counters and comment after sending email if you don’t need cumulative traffic report.
Here is snippet to persist tx/rx into interface comment which can be used in persistence scheduler script:
:local intf <interface_name>
/interface
:local cmt [:toarray [get $intf comment]]
:local tx ([:tonum [:pick $cmt 0]] + [get $intf tx-byte])
:local rx ([:tonum [:pick $cmt 1]] + [get $intf rx-byte])
reset-counters $intf
set $intf comment="$tx,$rx"
and to extract tx/rx values from that comment (instead using counters from 1st snippet) for sending over email:
:local intf <interface_name>
/interface
:local cmt [:toarray [get $intf comment]]
:local tx [:pick $cmt 0]
:local rx [:pick $cmt 1]
If you need human readable format of bytes you can use this before sending:
:local bytes2human do={
:local b [:tonum $1]
:local n
:local d
:local h
:if ($b < 1024) do={
:set h "$b B"
} else={
:if ($b < 1048576) do={
:set n ($b / 1024)
:set d (($b - $n * 1024) / 102)
:set h "$n.$d KiB"
} else={
:if ($b < 1073741824) do={
:set n ($b / 1048576)
:set d (($b - $n * 1048576) / 104858)
:set h "$n.$d MiB"
} else={
:set n ($b / 1073741824)
:set d (($b - $n * 1073741824) / 107374182)
:set h "$n.$d GiB"
}
}
}
:return [$h]
}
:set tx [$bytes2human $tx]
:set rx [$bytes2human $rx]