Mikrotik CPU usages monitor and email

#Mikrotik#CPu#usages#Monitor#and#email

/tool e-mail
set address=202.53.190.4 from=poptraffic@test.com user=poptraffic@test.com

/system script
add comment=”Send Email When CPU Goes 20%” dont-require-permissions=no name=cpu owner=noc 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 20%\”\r\
\n:global adminrece noc@test.com\r\
\n:global gmailid poptraffic@test.com\r\
\n:global user poptraffic@test.com\r\
\n:global gmailpwd \r\
\n:global gmailip 202.53.160.4\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 20%## \”\r\
\n/”

/system scheduler
add comment=”Send Email When CPU Goes 20%” interval=5s name=cpu on-event=\
“:if ([ /system resource get cpu-load]>20) do={ /system script run [find name=cpu]; }\r\
\n/” policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=startup
add interval=1d name=Day on-event=”/routing filter disable 20,21,22,23,24,25,26\r\
\n/routing filter enable 2,3,4,5,6\r\
\n/routing bgp peer refresh-all” policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=mar/18/2019 start-time=07:00:00
add interval=1d name=Night on-event=”/routing filter enable 20,21,22,23,24,25,26\r\
\n/routing filter disable 2,3,4,5,6\r\
\n/routing bgp peer refresh-all” policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=mar/18/2019 start-time=19:00:00

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *