Mikrotik CPU usages monitor and auto email

we monitor mikrotik cpu usages and when cpu usages 10% or 10%+ then will email automatically
Mail will send from Address: poptraffic@xyz.com
Mail will send to Address: noc@xyz.com
Mail Password:”you can use your password or can blank”

/system script
add comment=”Send Email When CPU Goes 10%” name=cpu owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive source=”: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 \”CPU LOAD 10%\”\r\
\n:global adminrece noc@xyz.com\r\
\n:global gmailid poptraffic@xyz.com\r\
\n:global user poptraffic@xyz.com\r\
\n:global gmailpwd \r\
\n:global gmailip smtp.xyz.com\r\
\n/tool e-mail \r\
\nset address=\$gmailip from=\$gmailid password=\$gmailpwd port=25 start-tls=no user=\$user\r\
\n/tool e-mail send to=\$adminrece subject=\”\$sub4 \$sub3 \$sub2 \$sub1\” body=\”Please Check something is wrong ##CPU 10%## \”\r\
/system scheduler
add comment=”Send Email When CPU Goes 10%” interval=5s name=cpu on-event=\
“:if ([ /system resource get cpu-load]>5) do={ /system script run [find name=cpu]; }\r\
\n/” policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=startup

You may also like...

Leave a Reply

Your email address will not be published.