Community discussions

MikroTik App
 
User avatar
111111
Member Candidate
Member Candidate
Topic Author
Posts: 195
Joined: Thu Oct 05, 2006 1:39 am
Location: BG,SOFIA

how to calculate time between log events?

Wed Aug 08, 2007 1:59 am

the idea is next
in
/ tool netwatch

and add ip of user
on UP
:log error "user x log on"
on Down
:log warning "user x log off"

but on down message on LOG how to see uptime of user
from time when message "user x log on" was display
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: how to calculate time between log events?

Wed Aug 08, 2007 9:07 am

Set global variable on UP and on DOWN calculate time. Isn't that working?
 
User avatar
111111
Member Candidate
Member Candidate
Topic Author
Posts: 195
Joined: Thu Oct 05, 2006 1:39 am
Location: BG,SOFIA

Re: how to calculate time between log events?

Wed Aug 08, 2007 5:33 pm

any example will be good begining
:( am not scripting guru

is there a option to be seen used traffic up/down also,
as on VPN connections
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: how to calculate time between log events?

Thu Aug 09, 2007 9:19 am

on UP:
:global myTime [/system clock get time ] ;

on DOWN:
:log info ("Uptime is" . ( [/system clock get time] - $myTime ) );
 
User avatar
111111
Member Candidate
Member Candidate
Topic Author
Posts: 195
Joined: Thu Oct 05, 2006 1:39 am
Location: BG,SOFIA

Re: how to calculate time between log events?

Thu Aug 09, 2007 12:58 pm

but users is more then one is this problem ?

or only to repleace "myTime"

Who is online

Users browsing this forum: jvanhambelgium and 72 guests