I am trying to have a simple queue activated w/ one set of tx/rx values during the day and another at night. This seems very straight forward according to the instructions and examples at these sites:
https://wiki.mikrotik.com/wiki/Manual:Scripting
https://wiki.mikrotik.com/wiki/Manual:S ... g-examples
I have created a script to enable one queue and disable the other in the morning and another script to enable/disable in opposite fashion at night. Both scripts work fine when executed from the
cli. This is easily verified by confirming the 2 queues are set the the expected enable/disable values after running. Also the scheduler reports that the run-count is increasing so the scheduled jobs appear to be executed.
The problem is that the scheduler does not seem to execute either script since after it reports it has run (run count increments by one) there is no change to the state of the queues.
I will give a brief description of the design and then show the configuration, followed by some output showing the results of the manual job run etc.
RouterOS version 6.40.5.
[rtr] /system scheduler> export
# feb/18/2018 07:19:28 by RouterOS 6.40.5
# software id = BKWB-V892
#
# model = RouterBOARD 952Ui-5ac2nD
I created a system scheduler named 'Day' and 'Night'
Each executes 1 time / day and on-event is set to a script named the same, i.e. 'Day' & 'Night'
[rtr] /system scheduler
[rtr] /system scheduler> export
add interval=1d name=Day on-event=Day policy=read,write start-date=feb/16/2018 start-time=06:00:00
add interval=1d name=Night on-event=Night policy=read,write start-date=feb/16/2018 start-time=16:00:00
The system scripts are named 'Day' and 'Night'
Each is a job to enable one simple queue and disable the other. Simple queues are named 'Day' & 'Night'
[rtr] /system script> export
/system script
add name=Night owner=xb7 policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
"/queue simple enable Night; /queue simple disable Day"
add name=Day owner=xb7 policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
"/queue simple enable Day; /queue simple disable Night"
Queues are created with names 'Day' & 'Night'
[rtr] /system script> /queue simple
[rtr] /queue simple> export
/queue simple
add disabled=yes max-limit=20M/20M name=Day target=192.168.10.0/24
add max-limit=3M/5M name=Night target=192.168.10.0/24
The system clock is set correctly and ntp-client is configured correctly and verified as working (updating regularly).
Output below shows the scheduled jobs have been run once each but each time I checked the state of the queues and found them not to be as expected, that is nothing was changed.
Output showing the scheduled jobs and run-counts.
[rtr] /system scheduler> print
Flags: X - disabled
# NAME START-DATE START-TIME INTERVAL ON-EVENT RUN-COUNT
0 Day feb/16/2018 06:00:00 1d Day 1
1 Night feb/16/2018 16:00:00 1d Night 1
Output showing the current state of the queues (before running the jobs manually from cli).
[rtr] /system script> /queue simple print
Flags: X - disabled, I - invalid, D - dynamic
0 XI name="Day" target=192.168.10.0/24 parent=none packet-marks="" priority=8/8 queue=default-small/default-small limit-at=0/0
max-limit=20M/20M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s bucket-size=0.1/0.1
1 name="Night" target=192.168.10.0/24 parent=none packet-marks="" priority=8/8 queue=default-small/default-small limit-at=0/0
max-limit=3M/5M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s bucket-size=0.1/0.1
Day is disabled, Night is enabled.
Now run the Day script manually and again look at the state of the queues
[rtr] /system script> run Day
[rtr] /system script> /queue simple print
Flags: X - disabled, I - invalid, D - dynamic
0 name="Day" target=192.168.10.0/24 parent=none packet-marks="" priority=8/8 queue=default-small/default-small limit-at=0/0
max-limit=20M/20M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s bucket-size=0.1/0.1
1 XI name="Night" target=192.168.10.0/24 parent=none packet-marks="" priority=8/8 queue=default-small/default-small limit-at=0/0
max-limit=3M/5M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s bucket-size=0.1/0.1
Note that Day is now enabled and Night is disabled.
Now run the Night job from cli and show the state of the queues.
[xb7@rtr] /system script> run Night
[xb7@rtr] /system script> /queue simple print
Flags: X - disabled, I - invalid, D - dynamic
0 XI name="Day" target=192.168.10.0/24 parent=none packet-marks="" priority=8/8 queue=default-small/default-small limit-at=0/0
max-limit=20M/20M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s bucket-size=0.1/0.1
1 name="Night" target=192.168.10.0/24 parent=none packet-marks="" priority=8/8 queue=default-small/default-small limit-at=0/0
max-limit=3M/5M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s bucket-size=0.1/0.1
Night is enabled and Day is disabled.