Community discussions

MikroTik App
 
iam8up
Member
Member
Topic Author
Posts: 333
Joined: Sun Oct 28, 2007 10:58 pm
Location: Troy, OH
Contact:

Disable logging for script

Tue Oct 07, 2008 4:35 am

The script below will output lines for every single action it takes. Is there a way I can disable log output for just this script? I would prefer not hiding all of the info topic if that can be helped!
date; system info; static dns entry removed by scriptuser
date; system info; static dns entry added by scriptuser
:local topdomain
:local hostname
:local hostip
:set topdomain "foo.com" ;
/ip dhcp-server lease ;
:foreach i in=[find] \
do={  \
    /ip dhcp-server lease ;
        :if ([:len [get $i host-name]] > 0) do={ \
           :set hostname ([get $i host-name] . "." . $topdomain); \
           :set hostip [get $i address]; \
           :put ( $hostname . " : " . $hostip ) ; \
           /ip dns static ;
           :foreach di in=[find] do={ :if ([get $di name] = $hostname) do {/ip dns static remove $di }}
           /ip dns static add name=$hostname address=$hostip
         }  \
};
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7041
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Disable logging for script

Tue Oct 07, 2008 8:52 am

Only way to turn them off is to disable all system info logs.
 
User avatar
omega-00
Forum Guru
Forum Guru
Posts: 1167
Joined: Sat Jun 06, 2009 4:54 am
Location: Australia
Contact:

Re: Disable logging for script

Tue Oct 07, 2008 11:15 am

I for one would like to see a script option in the logs (not info,script,system) which would allow us to quash the huge number of log lines scripts can generate. :-)
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7041
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Disable logging for script

Tue Oct 07, 2008 12:35 pm

Script option is already there, but in this particular case log entries are not generated by script, they are system messages that dns entry was removed.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Disable logging for script

Wed Oct 08, 2008 10:59 am

when start script - disable logging for the time script is running, if that solves anything, after finished, enable logging again. it is not very safe, as any other person will be able to perform actions and you wont see them on logs.

you can do that using script you are running ;)
 
iam8up
Member
Member
Topic Author
Posts: 333
Joined: Sun Oct 28, 2007 10:58 pm
Location: Troy, OH
Contact:

Re: Disable logging for script

Tue Oct 14, 2008 3:00 am

Really needs to be a way around this, I think, but I'm not developing...

I simply disabled the script and I'll run it manually if/when needed =(

Who is online

Users browsing this forum: No registered users and 20 guests