Community discussions

MikroTik App
humlhr
newbie
Topic Author
Posts: 38
加入: Thu Feb 24, 2011 10:44 am

DSL ips update mail

Sun Dec 11, 2011 6:24 pm

i am using a script that mail me my DSL ip when changed. but i have 4DSL lines and i need a script that check all DSL lines that i inter in it and mail me their ips.

i have
DSL1=pppoe-out1
DSL2=pppoe-out2
DSL3=pppoe-out3
DSL4=pppoe-out4
Top
用户头像
sadeghrafie
Long time Member
Long time Member
Posts: 514
加入: Sat Nov 14, 2009 11:28 am
Location:Bushehr, IRAN

Re: DSL ips update mail

Sun Dec 11, 2011 8:45 pm

Code:Select all
:global currentIPx; :local newIP [/ip address get [find interface="pppoe-outx"] address]; :if ($newIP != $currentIPx) do={ :put "ip address $currentIPx changed to $newIP"; :set currentIPx $newIP; /tool e-mail send from=ssss@ssss.com password=ssssssss to=ssss@ssss.com subject="pppoe-outx IP Address " body="pppoe-outx IP is $currentIPx" server=x.x.x.x port=587 tls=yes; }
You can make a loop from 1 to for or write it 4 time. Then set scheduler to run e.g every 5 min
Top
humlhr
newbie
Topic Author
Posts: 38
加入: Thu Feb 24, 2011 10:44 am

Re: DSL ips update mail

Mon Dec 12, 2011 1:17 pm

Thanks for your help.

plz solve me my 1 problem more.

tell me where i can put loop Statement.

and i want to inter delay in loop.

请给我一些更多的帮助。:?

wherexis a variable.
Top
用户头像
janisk
MikroTik Support
MikroTik Support
Posts: 6263
加入: Tue Feb 14, 2006 9:46 am
Location:Riga, Latvia

Re: DSL ips update mail

Mon Dec 12, 2011 1:40 pm

/system scheduler

just start running the script
Top
humlhr
newbie
Topic Author
Posts: 38
加入: Thu Feb 24, 2011 10:44 am

Re: DSL ips update mail

Mon Dec 12, 2011 6:14 pm

ok thanks its working.
Top

Who is online

Users browsing this forum: No registered users and 4 guests