Community discussions

MikroTik App
 
ahooper
newbie
Topic Author
Posts: 40
Joined: Sat Apr 22, 2006 7:57 am

5.2 and ChangeIP Script

Mon May 23, 2011 1:37 pm

I have been using the following script for checking the remote clients IP, if their IP changes I get a copy of the new IP sent to me via email.

However I have upgraded to MT 5.2 and this script no longer works. Any ideas as to why?
I have tried also a couple of other scripts and none of them seem to work.
:global linkip
:global strsystemname [/system identity get name]
:global linkip [/ip address get [/ip address find interface=PPPoE-Interface] address]
:global linksysver ("Version-" . [/system package get system version] )
:if ([ :typeof $linklastip ] = nil ) do={ :global linklastip "0" }
:if ([ :typeof $linkip ] = nil ) do={
:log info ("WAN: No ip address present on interface, please check.")
} else={
:if ($linkip != $linklastip) do={ 
/tool e-mail send from=clientupdate@my.mailserver.com  to=myemail@my.mailserver.com subject="$strsystemname" body="$linkip" server=my.mailserver.com
:log info "WAN: IP Changed Sending UPDATE!"
:global linklastip "$linkip"
} else={
:log info "WAN: IP Unchanged No update required."
}
}
 
User avatar
yuefy
just joined
Posts: 13
Joined: Sat Apr 02, 2011 9:13 am

Re: 5.2 and ChangeIP Script

Wed Jun 01, 2011 7:44 am

Sent to the wrong
 
Eliminateur
Frequent Visitor
Frequent Visitor
Posts: 96
Joined: Thu Jun 28, 2007 7:38 am

Re: 5.2 and ChangeIP Script

Fri Jul 01, 2011 9:31 pm

i hjave the same problem, i've implemented BOTH these scripts:
http://wiki.mikrotik.com/wiki/Sending_y ... IP_address
the only change is in the:
/tool e-mail send from=from@email_here_com to=to@email_here_com subject="DSL IP $strDate $strTime $strSystemName" body="DSL IP $ddnsip" 
i took out the server part as i already have it globally configured.

and they both don't work nor they log anything.

if i manually use the email send line(without the variables) from terminal then it works

PD: i'm using 5.5

Who is online

Users browsing this forum: jaclaz and 11 guests