Community discussions

MikroTik App
 
jeroenp
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Mon Mar 17, 2014 11:30 am
Location: Amsterdam
Contact:

[Mikrotik follow-up needed] Any way to persist a :global variable so it survives reboot?

Thu Oct 13, 2016 4:29 pm

I'm looking for a way to persist a :global variable so it survives a reboot.

Any ideas?

--jeroen
Last edited by jeroenp on Fri Oct 14, 2016 1:38 pm, edited 1 time in total.
 
Miracle
Member Candidate
Member Candidate
Posts: 106
Joined: Fri Sep 11, 2015 9:04 am

Re: Any way to persist a :global variable so it survives reboot?

Thu Oct 13, 2016 5:06 pm

Try store them in "comment"
 
jeroenp
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Mon Mar 17, 2014 11:30 am
Location: Amsterdam
Contact:

Re: Any way to persist a :global variable so it survives reboot?

Thu Oct 13, 2016 6:04 pm

Try store them in "comment"
What entity types would best be suited for such a comment?

--jeroen
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2411
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Any way to persist a :global variable so it survives reboot?

Thu Oct 13, 2016 8:06 pm

The "/system note" is a good place. It is displayed at the start of every terminal session, but beyond that, it doesn't ever "do" anything. Alternatively, you could create a custom disabled item at any menu, and use it as a comment. By virtue of being disabled, it won't do anything.

OR (my preferred approach), instead of doing that, you could write a startup script in "/system scheduler" that initializes the global variables to whatever values you need.
PEAR2_Net_RouterOS(1.0.0b6) - My API client in PHP
(Rate my posts? If you want... no pressure...)
 
jeroenp
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Mon Mar 17, 2014 11:30 am
Location: Amsterdam
Contact:

Re: Any way to persist a :global variable so it survives reboot?

Thu Oct 13, 2016 9:20 pm

The "/system note" is a good place. It is displayed at the start of every terminal session, but beyond that, it doesn't ever "do" anything. Alternatively, you could create a custom disabled item at any menu, and use it as a comment. By virtue of being disabled, it won't do anything.

OR (my preferred approach), instead of doing that, you could write a startup script in "/system scheduler" that initializes the global variables to whatever values you need.
Thanks. Since it's related to log buffers, I decided to put it in this entry (which I need to bail out on if it doesn't exist anyway):
:put [/system logging action print as-value where name=failedauth ]
The not so cool (or - even though it's a bug - maybe cool), is that WinBox does not allow setting this comment.

--jeroen
 
jeroenp
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Mon Mar 17, 2014 11:30 am
Location: Amsterdam
Contact:

Re: Any way to persist a :global variable so it survives reboot?

Fri Oct 14, 2016 1:22 pm

:put [/system logging action print as-value where name=failedauth ]
The not so cool (or - even though it's a bug - maybe cool), is that WinBox does not allow setting this comment.
Woot! You can set and retrieve the comment. But WinBox won't show it or allow you to change it.

Pixie dust!
  /system logging action set failedauth comment=12
  :put [/system logging action print as-value where name=failedauth]
--jeroen

Who is online

Users browsing this forum: kx002 and 31 guests