Community discussions

MUM Europe 2020
 
multipath
newbie
Topic Author
Posts: 43
Joined: Fri Sep 17, 2010 4:42 pm

Script Error: cannot substract string from ip address

Thu Nov 03, 2011 8:21 pm

Hello all,

Ok here is my script.

{
:local sesscnt
:local sessft
:local sesstt
:foreach sesscnt in=[/tool user-manager session find where !active] do={
:set sessft [:pick [/tool user-manager session get $sesscnt from-time]]
/tool user-manager session set $sesscnt from-time=($sessft-05:00:00)
:set sesstt [:pick [/tool user-manager session get $sesscnt till-time]]
/tool user-manager session set $sesscnt till-time=($sesstt-05:00:00)
}
/tool user-manager session print file=test
}
Script Error: cannot substract string from ip address

I have it encapsulated with the {} to be able to run directly from the terminal while testing.
Anyone have an idea why the error message says ip address when the values I'm trying to pass are date/time?
Any help or script ideas are welcome. The script is to change the till-time and from-time session values from the default Universal Greenwhich Time (+0) to my time zone (-5) before writing them to a text file. The router is set as a NTP client and the clock is correct for my timezone. I have also checked the Usermanager sessions and they are also showing the correct time for the sessions. Thanks.
 
changeip
Forum Guru
Forum Guru
Posts: 3804
Joined: Fri May 28, 2004 5:22 pm

Re: Script Error: cannot substract string from ip address

Thu Nov 03, 2011 9:47 pm

sometimes you have to use the :totime and :toip to cast them as such ... not quite sure for sure : )
Colo and Wholesale Bandwidth Available! Sales at SanDiegoBroadband dot com
 
multipath
newbie
Topic Author
Posts: 43
Joined: Fri Sep 17, 2010 4:42 pm

Re: Script Error: cannot substract string from ip address

Fri Nov 04, 2011 12:44 am

Thanks! That was the tip I needed.

Never mind the field can not be changed or updated. Keeps giving error now contact Mikrotik with support file. Will try different way.

Who is online

Users browsing this forum: No registered users and 27 guests