Community discussions

MikroTik App
 
mysz0n
Member Candidate
Member Candidate
Topic Author
Posts: 137
Joined: Tue Mar 03, 2009 2:14 am

RB reboot on log topic

Thu Sep 07, 2017 11:20 am

What is the simplest method of rebooting RB when log topic = 'gsm, error'
RB used to work fine for 2-3 months without rebooting.
For some time (new packages?), several times a week I got logs like this:
Sep/04/2017 16:13:51 gsm,error sms send failed: missing port value
Sep/07/2017 08:20:24 gsm,error unable to load unread sms: cannot open port
only reboot helps
 
User avatar
strods
MikroTik Support
MikroTik Support
Posts: 1624
Joined: Wed Jul 16, 2014 7:22 am
Location: Riga, Latvia

Re: RB reboot on log topic

Thu Sep 07, 2017 11:44 am

Add scheduler which runs script like this:

if ([:len [/system logging find where topic~"gsm,error"]] > 0) do={
:execute script="/system reboot"
}

Are you sure that you will not see logs also after reboot and lock yourself into reboot loop?
 
mysz0n
Member Candidate
Member Candidate
Topic Author
Posts: 137
Joined: Tue Mar 03, 2009 2:14 am

Re: RB reboot on log topic

Thu Sep 07, 2017 12:03 pm

thx for reply.
This is my logging
/system logging
set 0 action=memory disabled=no prefix="" topics=info
set 1 action=disk disabled=no prefix="" topics=error
set 2 action=disk disabled=no prefix="" topics=warning
set 3 action=echo disabled=no prefix="" topics=critica
I need error logs to be stored od disc, can i exclude gsm,errors from saving to the thist while keeping all other error logs on the disk?
 
User avatar
strods
MikroTik Support
MikroTik Support
Posts: 1624
Joined: Wed Jul 16, 2014 7:22 am
Location: Riga, Latvia

Re: RB reboot on log topic

Thu Sep 07, 2017 12:14 pm

You can create two topic
error -> disk
error,gsm -> memory
 
mysz0n
Member Candidate
Member Candidate
Topic Author
Posts: 137
Joined: Tue Mar 03, 2009 2:14 am

Re: RB reboot on log topic

Wed Feb 28, 2018 12:05 pm

hi strods, i'm trying to make that work but shouldn't it looks more like this?

if ([:len [/log find where topic="gsm, error"]] > 0) do={
:execute script="/system reboot"
}
instead of
/system logging find where topic~"gsm,error"]
?
anyway, both options do not work :/

Who is online

Users browsing this forum: loloski and 22 guests