• MikroTik.com
  • RouterBOARD
  • User Meeting
  • Training
  • User Manual
  • Support
  • Downloads
  • Videos
Register |   * Login | HOME

View unanswered posts | View active topics

Feature Request (improvement)  Page 1 of 1
 [ 12 posts ]  Post new topic Reply to topic
  Print view Previous topic | Next topic 
Author Message
Belyivulk
 Post subject: Feature Request (improvement)
PostPosted: Wed May 10, 2006 11:55 am 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Mon Mar 06, 2006 10:53 pm
Posts: 256
Karma: 3

Location: Whangarei, New Zealand
What would be useful (nice) and im not sure it exists, when a client with a MT router shuts down the router, or if the router looses power when it comes back up an event message sent back to the log of the AP its connecting too explaining if it were power outage, deliberate shutdown, lost wireless, or whatever the case may be. Helps to diagnose faults.


Top
 Profile  
 
cmit
 Post subject:
PostPosted: Wed May 10, 2006 12:10 pm 
Offline
Forum Guru
Forum Guru
User avatar

Joined: Fri May 28, 2004 11:49 am
Posts: 1549
Karma: 1

Location: Germany
You already have a log entry in the clients' log stating "unclean reboot because of power failure" or something along that lines if it was a un-clean shutdown. You could just look into the log of the client (which you probably can arrange access to)...

Best regards,
Christian Meis


Top
 Profile  
 
normis
 Post subject:
PostPosted: Wed May 10, 2006 12:20 pm 
Offline
MikroTik Support
MikroTik Support
User avatar

Joined: Fri May 28, 2004 10:04 am
Posts: 16951
Location: Riga, Latvia
plus, use the safe mode (crtl+x) so that unwanted shutdowns or disconnections don't happen


Top
 Profile  
 
Belyivulk
 Post subject:
PostPosted: Thu May 11, 2006 1:00 pm 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Mon Mar 06, 2006 10:53 pm
Posts: 256
Karma: 3

Location: Whangarei, New Zealand
Go on? Ctrl-X how does that work?

I was looking at a router last night that just "vanished" off our network, but still remained pingable (hard to explain) and at first i thought the client had restarted, i couldnt get into mac telnet or winbox and there was nothing in the logs on the ap to suggest a reboot. In that situation a log in the AP would be handy i suppose. Turned out the gf unplugged it to connect a hair curler, but as it was a new link installed in the afternoon over a particularly long distance we were watching it like hawks.

Anyway, CTRL-X. What do you mean normis?


Top
 Profile  
 
normis
 Post subject:
PostPosted: Thu May 11, 2006 1:08 pm 
Offline
MikroTik Support
MikroTik Support
User avatar

Joined: Fri May 28, 2004 10:04 am
Posts: 16951
Location: Riga, Latvia
hit ctrl+x and it will start safe mode. in this mode you can do all the same stuff, but if by some mistake you manage to disconnect from the router (disable all interfaces for example) then the safe mode will undo the last actions and you will be able to connect again.


Top
 Profile  
 
Belyivulk
 Post subject:
PostPosted: Thu May 11, 2006 1:11 pm 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Mon Mar 06, 2006 10:53 pm
Posts: 256
Karma: 3

Location: Whangarei, New Zealand
You have just made my day. I love you. I want you to have my babies! I was unaware of this feature that could make my life SOOOOOO much easier!

At which stage do i press ctrl-x?


Top
 Profile  
 
normis
 Post subject:
PostPosted: Thu May 11, 2006 1:19 pm 
Offline
MikroTik Support
MikroTik Support
User avatar

Joined: Fri May 28, 2004 10:04 am
Posts: 16951
Location: Riga, Latvia
any stage. in winbox you open the terminal window and hit ctrl+x there. the safe mode will then stay enabled for all that you do in either terminal or winbox. to turn it off, again hit ctrl+x in terminal.

in general you go to safe mode before attempting some important configuration

we will make a button for it in winbox


Top
 Profile  
 
Belyivulk
 Post subject:
PostPosted: Thu May 11, 2006 1:22 pm 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Mon Mar 06, 2006 10:53 pm
Posts: 256
Karma: 3

Location: Whangarei, New Zealand
Great! that will stop ALOT of misshaps that we seem to encounter, for example choosing a frequency that "bricks" the router. If it would switch back to the original freq and re-establish connection now THAT is handy


Top
 Profile  
 
changeip
 Post subject:
PostPosted: Thu May 11, 2006 6:00 pm 
Offline
Forum Guru
Forum Guru

Joined: Fri May 28, 2004 4:22 pm
Posts: 3701
Karma: 15
Normis,

Allowing for safe mode in a script also would be handy as well... using SSH to run commands or scripting to run commands and being able to turn on/off safe mode would be good. As well as being able to detect safe mode.

:safe on
:safe off
:put [:safe]

Sam


Top
 Profile  
 
eflanery
 Post subject:
PostPosted: Tue May 23, 2006 7:12 pm 
Offline
Member
Member

Joined: Fri May 28, 2004 9:11 pm
Posts: 334
Karma: 1

Location: Moscow, ID
It is quite possible to take safe mode in remote scripts, this little chunk of python (similar constructs are possable in other languages, of course) is what I use:

Code:
    def lock(self, take):
        tries = 0
        success = -1
        modes = [["] > "], ["] <SAFE> "]]
        try:
            self.refreshconnection()
            while success != 0:
                if tries >= 30:
                    raise error("Locking failed")
                tries = tries + 1
                self.connection.write("\x18\n")
                success = self.connection.expect(modes[take], 1)[0]
        except:
            raise error("Locking failed")

The important part is this: self.connection.write("\x18\n")

Particularly, the \x18\n bit.

The \x18 sends a literal ^x, and the \n sends a newline which generates a fresh prompt.

Very useful for preventing multiple asynchronous scripts from colliding, and leaving the router in an indeterminate state (and preventing the script from locking itself, and you, out of the router). It can be used just like a thread lock, and could even be abstracted further to create semaphores and such.

--Eric


Top
 Profile  
 
changeip
 Post subject:
PostPosted: Tue May 23, 2006 7:24 pm 
Offline
Forum Guru
Forum Guru

Joined: Fri May 28, 2004 4:22 pm
Posts: 3701
Karma: 15
Thats excellent!

I would still like to see some ice commands for placing the router into safe mode for scripting directly on the MT ... many scripts I run directly from the MT scripting language and there isn't a way I know of the place router into safe mode directly.

Sam


Top
 Profile  
 
eflanery
 Post subject:
PostPosted: Tue May 23, 2006 7:38 pm 
Offline
Member
Member

Joined: Fri May 28, 2004 9:11 pm
Posts: 334
Karma: 1

Location: Moscow, ID
Indeed, I know of no way to initiate safe mode from within local MT scripts.

Would be quite useful.

--Eric


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 12 posts ] 

Board index » RouterOS » RouterOS BETA

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Karma functions powered by Karma MOD © 2007, 2009 m157y