quinta-feira, 24 de novembro de 2016

Mikrotik - Send Log Every Day Via E-mail

Obs.: Testar a porta smtp para gmail

Send Mikrotik Log Every Morning 7:00 AM
Just copy and paste

/system script
add name=log owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive source=":log warn\
    ing \"Mikrotik Log File Sending By www.fr.net.br....\"\r\
    \n:global sub1 ([/system identity get name])\r\
    \n:global sub2 ([/system clock get time])\r\
    \n:global sub3 ([/system clock get date])\r\
    \n:global sub4 Log\r\
    \n:global adminrece #YOUR@gmail.com\r\
    \n:global gmailid #YOUR@gmail.com\r\
    \n:global user #USER\r\
    \n:global gmailpwd #PASSWORD\r\
    \n:global gmailip 74.125.136.108\r\
    \n:log warning \"Creating Log File.....\"\r\
    \n:delay 5s\r\
    \nlog print file=\"log \$sub1\"\r\
    \n/tool e-mail \r\
    \nset address=\$gmailip from=\$gmailid password=\$gmailpwd port=25 start-tls\
    =yes user=\$user\r\
    \n/tool e-mail send to=\$adminrece subject=\"\$sub4 \$sub3 \$sub2 \$sub1\" f\
    rom=\$gmailid file=\"log \$sub1\"\r\
    \n server=\$gmailip start-tls=yes\r\
    \n:log warning \"Sending Log File.....\"\r\
    \n:delay 5s\r\
    \n/system logging action set memory memory-lines=1\r\
    \n/system logging action set memory memory-lines=1000\r\
    \n/file remove \"log \$sub1\"\r\
    \n:log warning \"Log Cleared & Removed Log File By www.fr.net.br.......\
    ...\""
/system scheduler
add comment="Log Send Via Email  Every Day 7:00AM" interval=1d name=\
    "Log Send Via Email" on-event=log policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
    jul/17/2016 start-time=07:00:00
/


fonte: http://www.itlearnweb.com/2016/07/send-mikrotik-log-every-day.html

0 comentários: