Community discussions

MikroTik App
 
mihailJl
newbie
Topic Author
Posts: 38
Joined: Thu Jun 22, 2017 9:06 am

Get Uptime from Router in number

Fri Mar 02, 2018 11:47 am

I want to get "Uptime" in variable and compare!

:local uptime [/system resource get uptime]
:log info $uptime
:if ($uptime > ..... ) do={
:log info "yes"
} else {
:log info "no"
}

Maybe the variable is in string and the compare is not success!
How to convert?
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1782
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: Get Uptime from Router in number

Fri Mar 02, 2018 11:48 pm

[Sebastian@firewall] > :put [:typeof  [/system resource get uptime ]]
time
=> time object