Community discussions

 
fattytuna
just joined
Topic Author
Posts: 3
Joined: Sun Sep 23, 2018 7:17 am

Scheduled script errors are swallowed?

Fri Jul 19, 2019 10:01 pm

I have my devices configured to send all logs to a logging service (Papertrail):
[admin@mikrotik-ap-2] > /system logging print where action="papertrail"
Flags: X - disabled, I - invalid, * - default
 #    TOPICS                                    ACTION                                   PREFIX    
 0    !debug                                    papertrail
      !dns
I also have some scheduled scripts. I noticed that one of the scheduled scripts wasn't logging output that it should.. it's a firmware upgrader that should either
:log info "Firmware doesn't need upgrading"
or
:log warning "Upgrading firmware!"
.

Running the script manually revealed a syntax error:
[admin@mikrotik-ap-2] /system script> run 0                                                         
bad command name get (line 1 column 8)
This syntax error,
bad command name get (line 1 column 8)
, never appeared in my Papertrail logs. It looks like if the scheduler gets an error from script execution, it's just swallowed, which would be a bad behavior to have!

Have I misconfigured something?
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1296
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Scheduled script errors are swallowed?

Fri Jul 19, 2019 10:40 pm

Logging in RouterOS is a mystery.
Something are logged and some other not.

Example.
Did an upgrade of hAP Lite from 6.45.1 to 6.45.2.
Nothing in the log that it was upgraded, nor that it rebooted during process.

If you post the script, I may be able to help you with it to see what is wrong.

Have some experience from logging and script.

See Splunk for MikroTik where I do use several script to log data.
viewtopic.php?f=23&t=137338
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 

Who is online

Users browsing this forum: No registered users and 11 guests