Page 1 of 1

Problem with scheduler

Posted: Thu Feb 19, 2015 1:51 pm
by sergios
Hi to All!
I'm using Mikrotik RB951Ui-2HnD with firmware version 3.19. I wrote 2 scripts, both are using the same global variables. One script handles those variables and other one, just use the values but not modifying them. Initially, these variables have no value or typeof is set to "nothing".
1st script run before 2nd one, so when the 2nd script is executing it has already had the values of those global variables.
The example is listed bellow (script is called "CHECK-GATEWAY"):
:global PingFailCount ;
:global PingFailThreshold 5 ;
:global doublePingFailThreshold ($PingFailThreshold * 2) ;
:if ([ :typeof $PingFailCount ] = "nothing" ) do={ :set PingFailCount 0 };

The scheduler configured in the next way:
/system scheduler
add interval=5s name=CHECK-GATEWAY on-event=CHECK-GATEWAY policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=jan/02/1970 start-time=00:00:05
add interval=30s name=CONTROL-3G-CONNECTION on-event=CONTROL-3G-CONNECTION policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=jan/02/1970 start-time=00:00:30

So, the 1st script "CHECK-GATEWAY" is executed after 5 second passed after booting device and the 2nd script "CONTROL-3G-CONNECTION" is executed 25 second later.

All works perfectly if I just reboot device and will be waiting for the time when both scripts will be executed at least once (so they both will form their own variables and you can check them by executing "/environment print" command). The problem arise only if I will do the next sequence of actions:
1) reboot device;
2) after device has been booted, login in, and execute command "/system scheduler print" before that moment when scripts will be run 1st time after reboot.
When I will have done this, scripts won't be working at all. If you will check the variables via "/environment print" command, you'll see that typeof dynamic variables is still set to "nothing" and it will not be changed even the scheduler will run each script automatically. If I will run both scripts manually, variables will be set correctly, but they will not be automatically changed (increased/decreased) by the next round of scheduler.
As for me, it is a bug and must be corrected.

Re: Problem with scheduler

Posted: Fri Feb 20, 2015 9:58 pm
by unridaz
If I understand correctly,

You reboot the device, wait, the script runs automatically and everything works fine.

BUT

If you reboot the device, and check the scheduler with "/system scheduler print" before it runs for the first time, then it never runs no matter how long you wait? Or is it running but the variables are not being set?

What is the time settings on the scheduled script? When does it start, when is the interval?

Have you tried to break the scheduler with other commands? For example if you use "/environment print" before it runs, after it runs are the variables set?

Re: Problem with scheduler

Posted: Sat Feb 21, 2015 4:15 pm
by sergios
If I understand correctly,

You reboot the device, wait, the script runs automatically and everything works fine.

BUT

If you reboot the device, and check the scheduler with "/system scheduler print" before it runs for the first time, then it never runs no matter how long you wait? Or is it running but the variables are not being set?

What is the time settings on the scheduled script? When does it start, when is the interval?

Have you tried to break the scheduler with other commands? For example if you use "/environment print" before it runs, after it runs are the variables set?
If I understand correctly,

You reboot the device, wait, the script runs automatically and everything works fine.

^^^Exactly!

BUT

If you reboot the device, and check the scheduler with "/system scheduler print" before it runs for the first time, then it never runs no matter how long you wait? Or is it running but the variables are not being set?

^^^ "/system scheduler print" shows that both scripts are executing periodically, but there are no changes of values of any variables!

What is the time settings on the scheduled script? When does it start, when is the interval?

^^^Script which is called "CHECK GATEWAY" is executed every 5 seconds (router must send 10 packets with interval of 0.1 seconds) and another script which is called "CONTROL-3G-CONNECTION" is executed every 30 seconds (it must check state of 3G connection and must disable main gateway if global variables of 1st script reached the threshold)

Have you tried to break the scheduler with other commands? For example if you use "/environment print" before it runs, after it runs are the variables set?
^^^I've tried to execute "/environment print" command before scheduler runs first time and after it runs, but this command doesn't have any impact (all works perfectly). Also I have tried to execute command "/system script environment print" but it's also does not has any affect.

Re: Problem with scheduler

Posted: Mon Mar 02, 2015 9:48 pm
by unridaz
What is the output of:
/system clock print
In your script you have the start date to Jan 02 1970... a factory reset router will be at Jan 01 1970, until you update the time by other means. From factory, it will not run for the first 24hrs.

Have you considered starting your scripts at "startup", and then at the required intervals, 5s and 30s?

What is the code of the CONTROL-3G-CONNECTION script? Would like to double check it also, because for me "CHECK GATEWAY" worked ok.

Depending on the code in the CONTROL script, your functions may be better served by "/tool netwatch" have you investigated or considered using this feature?

Re: Problem with scheduler

Posted: Wed Mar 11, 2015 6:19 pm
by sergios
"/system clock print" command displays correct date and time because ntp was configured earlier.

I have just tried to reset the whole system configuration and I noticed that default date is 02 jan 1970. Here is an output:
[admin@MikroTik] > system clock print
time: 00:01:09
date: jan/02/1970
time-zone-name: manual
gmt-offset: +00:00
[admin@MikroTik] >

So, the first run will be 5s later after reboot even if ntp is not configured.

Based on my experience, I decided that execution of both scripts must be done in a few seconds after reboot.
I can't show you whole code of "CONTROL-3G-CONNECTION" script. Both scripts work fine if I wait until they have run for the first time, but if I execute "/system scheduler print" command before they have run for the first time, they both will fail.
"CHECK GATEWAY" is similar to cisco ip sla tool. I'm using it instead of netwatch tool, because my script can evaluate packet loss and can avoid of false positives when channel is under high bandwidth utilization. For example, mikrotik sends 10 packets with interval 0.1s, and there is a counter which increases every time when device receives less than 50% of sent packets (less than 5 of 10 packets, for example). We decided that channel is DOWN when the counter will have reached the threshold (threshold=5, for example). So, if "CHECK GATEWAY" script is executed every 5s, we will declare that channel is DOWN after 25s.
"CONTROL-3G-CONNECTION" checks for modem availability and it's trying to reset interface ppp by disabling and re-enabling it. It has few counters and thresholds for determining 3G-connection state and modem recognition. This script also checks for the right recognition of the modem. If modem was not recognized correctly, it resets usb power. There is also another counter which has its own threshold and used for reboot device if the worst situation occurs - main channel is DOWN, software 3G-connection reset was reached its threshold and 3G is still not connected or USB power reset was reached its threshold and the modem is still not recognized correctly.
The decision to switch default route to 3G is made only if main channel is DOWN and modem was recognized correctly and 3G-connection was done.
So, first 30 seconds are left for initial 3G-connection and modem recognition. That's why we need to start "CONTROL-3G-CONNECTION" 30s after reboot.

Re: Problem with scheduler

Posted: Fri Mar 13, 2015 11:50 pm
by unridaz
This sounds like something to do with the :global variables you are using probably not being created yet...

are you able to run a script which just sets up the variables first:

In system scheduler interval=none or 0, run at startup
:global PingFailCount;
:global PingFailThreshold;
:global doublePingFailThreshold;
then after this code is run /environment print should not break your scripts?

Re: Problem with scheduler

Posted: Mon Mar 16, 2015 3:22 pm
by sergios
Ok, let's simplify scripts for better understanding situation.
I disabled both scripts in scheduler:
[admin@Branch-Node-Test] /system scheduler> print 
Flags: X - disabled 
 #   NAME                     START-DATE  START-TIME                     INTERVAL             ON-EVENT                      RUN-COUNT
 0 X CHECK-GATEWAY            jan/02/1970 00:00:00                       5s                   CHECK-GATEWAY                         0
 1 X CONTROL-3G-CONNECTION    jan/02/1970 00:00:00                       50s                  CONTROL-3G-CONNECTION                 0
 2   CHECK-GATEWAY-TEST       jan/02/1970 00:00:00                       20s                  CHECK-GATEWAY-TEST                   24
I added simplified copy of "CHECK-GATEWAY" script which is called "CHECK-GATEWAY-TEST". I increased interval to 20s for having more time for diagnosing problem.

Here is the whole text of "CHECK-GATEWAY-TEST" script:
[admin@Branch-Node-Test] /system script> print detail where name=CHECK-GATEWAY-TEST
Flags: I - invalid 
 0   name="CHECK-GATEWAY-TEST" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive 
     last-started=mar/16/2015 13:34:50 run-count=65 source=
       #describe variables 
              :global PingFailCount ;
              :global PingFailThreshold 5 ;
              :global doublePingFailThreshold ($PingFailThreshold * 2) ;
              :local GatewayEth1 10.1.1.1 ;
              :local PingResult ;
              :local status3G ;
              :local greyIPlist { 10.0.0.0/8; 172.16.0.0/12; 192.168.0.0/16 } ;
       
       #describe local functions
              :local check3Gstatus {
                  [/interface ppp-client monitor 0 once do={
                      :if ($status = "established") do={
                          :delay 2 ;
                      }
                      :if ($status = "connected") do={
                          :if ($"local-address" in $greyIPlist) do={
                              :set status3G greyIPmode} else={:set status3G $status}
                           } else={:set status3G $status}
                      }
                  ]
              }
       
       #set PingFailCount default value
              :if ([:typeof $PingFailCount] = "nothing") do={:set PingFailCount 0; /ip route enable [find gateway=$GatewayEth1] ;} ;
              
       #doing ping-check
              :set PingResult [ping $GatewayEth1 count=10 ttl=1 interval 0.1 size 100] ;
              :put message="Packet Received = $PingResult" ;
       
              :if ($PingResult <= 5) do={
                  :set PingFailCount ($PingFailCount + 1) ;
              }
              
       #END
       #show diagnostic results
       :put message="PingFailCount = $PingFailCount" ;
       :put message="PingFailThreshold = $PingFailThreshold" ;
       :put message="status3G = $status3G" ;
Here is the whole output of test:
[admin@Branch-Node-Test] > system reboot 
Reboot, yes? [y/N]: 
y
system will reboot shortly
Connection closed by foreign host.
serg@ncc:~$ telnet 192.168.88.6
Trying 192.168.88.6...
Connected to 192.168.88.6.
Escape character is '^]'.

MikroTik v6.25
Login: admin
Password: 








  MMM      MMM       KKK                          TTTTTTTTTTT      KKK
  MMMM    MMMM       KKK                          TTTTTTTTTTT      KKK
  MMM MMMM MMM  III  KKK  KKK  RRRRRR     OOOOOO      TTT     III  KKK  KKK
  MMM  MM  MMM  III  KKKKK     RRR  RRR  OOO  OOO     TTT     III  KKKKK
  MMM      MMM  III  KKK KKK   RRRRRR    OOO  OOO     TTT     III  KKK KKK
  MMM      MMM  III  KKK  KKK  RRR  RRR   OOOOOO      TTT     III  KKK  KKK

  MikroTik RouterOS 6.25 (c) 1999-2014       http://www.mikrotik.com/

[?]             Gives the list of available commands
command [?]     Gives help on the command and list of arguments

[Tab]           Completes the command/word. If the input is ambiguous,
                a second [Tab] gives possible options

/               Move up to base level
..              Move up one level
/command        Use command at the base level
  
[admin@Branch-Node-Test] > environment print 

[admin@Branch-Node-Test] > environment print 

[admin@Branch-Node-Test] > environment print 

[admin@Branch-Node-Test] > system scheduler print    
Flags: X - disabled 
 #   NAME                     START-DATE  START-TIME                     INTERVAL             ON-EVENT                      RUN-COUNT
 0 X CHECK-GATEWAY            jan/02/1970 00:00:00                       5s                   CHECK-GATEWAY                         0
 1 X CONTROL-3G-CONNECTION    jan/02/1970 00:00:00                       50s                  CONTROL-3G-CONNECTION                 0
 2   CHECK-GATEWAY-TEST       jan/02/1970 00:00:00                       20s                  CHECK-GATEWAY-TEST                    0
[admin@Branch-Node-Test] > system clock print 
            time: 14:02:30
            date: mar/16/2015
  time-zone-name: Europe/Kiev
      gmt-offset: +02:00
      dst-active: no
[admin@Branch-Node-Test] > system scheduler print 
Flags: X - disabled 
 #   NAME                     START-DATE  START-TIME                     INTERVAL             ON-EVENT                      RUN-COUNT
 0 X CHECK-GATEWAY            jan/02/1970 00:00:00                       5s                   CHECK-GATEWAY                         0
 1 X CONTROL-3G-CONNECTION    jan/02/1970 00:00:00                       50s                  CONTROL-3G-CONNECTION                 0
 2   CHECK-GATEWAY-TEST       jan/02/1970 00:00:00                       20s                  CHECK-GATEWAY-TEST                    0
[admin@Branch-Node-Test] > environment print      

[admin@Branch-Node-Test] > system scheduler print 
Flags: X - disabled 
 #   NAME                     START-DATE  START-TIME                     INTERVAL             ON-EVENT                      RUN-COUNT
 0 X CHECK-GATEWAY            jan/02/1970 00:00:00                       5s                   CHECK-GATEWAY                         0
 1 X CONTROL-3G-CONNECTION    jan/02/1970 00:00:00                       50s                  CONTROL-3G-CONNECTION                 0
 2   CHECK-GATEWAY-TEST       jan/02/1970 00:00:00                       20s                  CHECK-GATEWAY-TEST                    0
[admin@Branch-Node-Test] > environment print      

[admin@Branch-Node-Test] > system scheduler print 
Flags: X - disabled 
 #   NAME                     START-DATE  START-TIME                     INTERVAL             ON-EVENT                      RUN-COUNT
 0 X CHECK-GATEWAY            jan/02/1970 00:00:00                       5s                   CHECK-GATEWAY                         0
 1 X CONTROL-3G-CONNECTION    jan/02/1970 00:00:00                       50s                  CONTROL-3G-CONNECTION                 0
 2   CHECK-GATEWAY-TEST       jan/02/1970 00:00:00                       20s                  CHECK-GATEWAY-TEST                    0
[admin@Branch-Node-Test] > environment print      

[admin@Branch-Node-Test] > system clock print 
            time: 14:03:51
            date: mar/16/2015
  time-zone-name: Europe/Kiev
      gmt-offset: +02:00
      dst-active: no
[admin@Branch-Node-Test] > environment print  

[admin@Branch-Node-Test] > system scheduler print 
Flags: X - disabled 
 #   NAME                     START-DATE  START-TIME                     INTERVAL             ON-EVENT                      RUN-COUNT
 0 X CHECK-GATEWAY            jan/02/1970 00:00:00                       5s                   CHECK-GATEWAY                         0
 1 X CONTROL-3G-CONNECTION    jan/02/1970 00:00:00                       50s                  CONTROL-3G-CONNECTION                 0
 2   CHECK-GATEWAY-TEST       jan/02/1970 00:00:00                       20s                  CHECK-GATEWAY-TEST                    0
[admin@Branch-Node-Test] > 
I don't know exactly what have gone wrong but passes more than 1m20s and script was not executed not once.

1st command was executed immediately after reboot.

Here is the 2nd test:
[admin@Branch-Node-Test] > system reboot 
Reboot, yes? [y/N]: 
y
system will reboot shortly
Connection closed by foreign host.
serg@ncc:~$ telnet 192.168.88.6
Trying 192.168.88.6...
Connected to 192.168.88.6.
Escape character is '^]'.

MikroTik v6.25
Login: admin
Password: 








  MMM      MMM       KKK                          TTTTTTTTTTT      KKK
  MMMM    MMMM       KKK                          TTTTTTTTTTT      KKK
  MMM MMMM MMM  III  KKK  KKK  RRRRRR     OOOOOO      TTT     III  KKK  KKK
  MMM  MM  MMM  III  KKKKK     RRR  RRR  OOO  OOO     TTT     III  KKKKK
  MMM      MMM  III  KKK KKK   RRRRRR    OOO  OOO     TTT     III  KKK KKK
  MMM      MMM  III  KKK  KKK  RRR  RRR   OOOOOO      TTT     III  KKK  KKK

  MikroTik RouterOS 6.25 (c) 1999-2014       http://www.mikrotik.com/

[?]             Gives the list of available commands
command [?]     Gives help on the command and list of arguments

[Tab]           Completes the command/word. If the input is ambiguous,
                a second [Tab] gives possible options

/               Move up to base level
..              Move up one level
/command        Use command at the base level
  
[admin@Branch-Node-Test] > environment print 
PingFailCount=[:nothing]
PingFailThreshold=5
doublePingFailThreshold=10
[admin@Branch-Node-Test] > system clock print 
            time: 14:19:09
            date: mar/16/2015
  time-zone-name: Europe/Kiev
      gmt-offset: +02:00
      dst-active: no
[admin@Branch-Node-Test] > environment print  
PingFailCount=[:nothing]
PingFailThreshold=5
doublePingFailThreshold=10

[admin@Branch-Node-Test] > system clock print     
            time: 14:20:57
            date: mar/16/2015
  time-zone-name: Europe/Kiev
      gmt-offset: +02:00
      dst-active: no
[admin@Branch-Node-Test] > system scheduler print 
Flags: X - disabled 
 #   NAME                     START-DATE  START-TIME                     INTERVAL             ON-EVENT                      RUN-COUNT
 0 X CHECK-GATEWAY            jan/02/1970 00:00:00                       5s                   CHECK-GATEWAY                         0
 1 X CONTROL-3G-CONNECTION    jan/02/1970 00:00:00                       50s                  CONTROL-3G-CONNECTION                 0
 2   CHECK-GATEWAY-TEST       jan/02/1970 00:00:00                       20s                  CHECK-GATEWAY-TEST                    8
[admin@Branch-Node-Test] > environment print      
PingFailCount=[:nothing]
PingFailThreshold=5
doublePingFailThreshold=10

[admin@Branch-Node-Test] > system clock print     
            time: 14:20:57
            date: mar/16/2015
  time-zone-name: Europe/Kiev
      gmt-offset: +02:00
      dst-active: no
[admin@Branch-Node-Test] > system scheduler print 
Flags: X - disabled 
 #   NAME                     START-DATE  START-TIME                     INTERVAL             ON-EVENT                      RUN-COUNT
 0 X CHECK-GATEWAY            jan/02/1970 00:00:00                       5s                   CHECK-GATEWAY                         0
 1 X CONTROL-3G-CONNECTION    jan/02/1970 00:00:00                       50s                  CONTROL-3G-CONNECTION                 0
 2   CHECK-GATEWAY-TEST       jan/02/1970 00:00:00                       20s                  CHECK-GATEWAY-TEST                    8
[admin@Branch-Node-Test] > environment print      
PingFailCount=[:nothing]
PingFailThreshold=5
doublePingFailThreshold=10
So, you could see that initial values of variables are set only when script is executing. In the 2nd test, you could see that "CHECK-GATEWAY-TEST" script was executed by the scheduler 8 times but "PingFailCount" variable was not set but it should be set.

I also had done 3rd test. I deleted "check3Gstatus" from "CHECK-GATEWAY-TEST" script and it works fine. Here is an output:
[admin@Branch-Node-Test] /system script> print where name=CHECK-GATEWAY-TEST
Flags: I - invalid 
 0   name="CHECK-GATEWAY-TEST" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive 
     last-started=mar/16/2015 14:58:25 run-count=86 source=
       #describe variables 
              :global PingFailCount ;
              :global PingFailThreshold 5 ;
              :global doublePingFailThreshold ($PingFailThreshold * 2) ;
              :local GatewayEth1 10.1.1.1 ;
              :local PingResult ;
       
       #setting PingFailCount default value
              :if ([:typeof $PingFailCount] = "nothing") do={:set PingFailCount 0; /ip route enable [find gateway=$GatewayEth1] ;} ;
              
       #doing ping-check
              :set PingResult [ping $GatewayEth1 count=10 ttl=1 interval 0.1 size 100] ;
              :put message="Packet Received = $PingResult" ;
       
              :if ($PingResult <= 5) do={
                  :set PingFailCount ($PingFailCount + 1) ;
              }
              
       #END
       #show diagnostic results
       :put message="PingFailCount = $PingFailCount" ;
       :put message="PingFailThreshold = $PingFailThreshold" ;
[admin@Branch-Node-Test] /system scheduler> /system reboot 
Reboot, yes? [y/N]: 
y
system will reboot shortly
Connection closed by foreign host.
serg@ncc:~$ telnet 192.168.88.6
Trying 192.168.88.6...
Connected to 192.168.88.6.
Escape character is '^]'.

MikroTik v6.25
Login: admin
Password: 








  MMM      MMM       KKK                          TTTTTTTTTTT      KKK
  MMMM    MMMM       KKK                          TTTTTTTTTTT      KKK
  MMM MMMM MMM  III  KKK  KKK  RRRRRR     OOOOOO      TTT     III  KKK  KKK
  MMM  MM  MMM  III  KKKKK     RRR  RRR  OOO  OOO     TTT     III  KKKKK
  MMM      MMM  III  KKK KKK   RRRRRR    OOO  OOO     TTT     III  KKK KKK
  MMM      MMM  III  KKK  KKK  RRR  RRR   OOOOOO      TTT     III  KKK  KKK

  MikroTik RouterOS 6.25 (c) 1999-2014       http://www.mikrotik.com/

[?]             Gives the list of available commands
command [?]     Gives help on the command and list of arguments

[Tab]           Completes the command/word. If the input is ambiguous,
                a second [Tab] gives possible options

/               Move up to base level
..              Move up one level
/command        Use command at the base level
  
[admin@Branch-Node-Test] > environment print 

[admin@Branch-Node-Test] > environment print 
PingFailCount=0
PingFailThreshold=5
doublePingFailThreshold=10

[admin@Branch-Node-Test] > environment print 
PingFailCount=1
PingFailThreshold=5
doublePingFailThreshold=10
So I caught the time when script initially sets PingFailCount value.
Maybe the problem is in "check3Gstatus" local function. But I need it to check 3G state directly when main channel fails, to make decision disable main default route or not.

Another problem exists when I use functions. A function will be done twice if I declare it at the beggining of the script and then call. I mean that the function is executed at the moment when scheduler is reading the script from top to down and than the function is executed once more if I call it like $<function-name> in the middle of the script.

Notice, that all tests were done with deactivated main channel and without 3G modem inserted into mikrotik.

Re: Problem with scheduler

Posted: Wed Mar 18, 2015 10:24 pm
by sergios
I inserted into the test script debug messages.
So, the scheduler configuration now looks like:
[admin@Branch-Node-Test] /system scheduler> print
Flags: X - disabled
# NAME START-DATE START-TIME INTERVAL ON-EVENT RUN-COUNT
0 X CHECK-GATEWAY jan/02/1970 00:00:00 5s CHECK-GATEWAY 0
1 X CONTROL-3G-CONNECTION jan/02/1970 00:00:30 30s CONTROL-3G-CONNECTION 0
2 CHECK-GATEWAY-TEST jan/02/1970 00:00:05 20s CHECK-GATEWAY-TEST 15

The test script looks like:
[admin@Branch-Node-Test] /system script> print where name=CHECK-GATEWAY-TEST
Flags: I - invalid
0 name="CHECK-GATEWAY-TEST" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive last-started=mar/18/2015 17:12:45 run-count=167
source=
#describe variables
:global PingFailCount ;
:global PingFailThreshold 5 ;
:global doublePingFailThreshold ($PingFailThreshold * 2) ;

:local GatewayEth1 10.1.1.1 ;
:local PingResult ;
:local status3G ;
:local greyIPlist { 10.0.0.0/8; 172.16.0.0/12; 192.168.0.0/16 } ;
:log info "here1";
#describe local functions
:local check3Gstatus {
[:log info "here2"; /interface ppp-client monitor 0 once do={
:log info "here3";
:if ($status = "established") do={
:delay 2s ;
:log info "here4";
}
:if ($status = "connected") do={
:log info "here5";
:if ($"local-address" in $greyIPlist) do={
:log info "here6";
:set status3G greyIPmode} else={:set status3G $status}
:log info "here7";
} else={:set status3G $status}
:log info "here8";
}
]
}

:log info "here9";
#setting PingFailCount default value
:if ([:typeof $PingFailCount] = "nothing") do={:set PingFailCount 0; /ip route enable [find gateway=$GatewayEth1] ;} ;
:log info "here10";

#doing ping-check
:set PingResult [ping $GatewayEth1 count=10 ttl=1 interval 0.1 size 100] ;
:put message="Packet Received = $PingResult" ;
:log info "here11";

:if ($PingResult <= 5) do={
:set PingFailCount ($PingFailCount + 1) ;
:log info "here12";
}

#END
#show diagnostic results
:put message="PingFailCount = $PingFailCount" ;
:put message="PingFailThreshold = $PingFailThreshold" ;

The log messages show that it stucks at "here2":
17:18:45 script,info here1
17:18:45 script,info here2
17:19:05 script,info here1
17:19:05 script,info here2
17:19:25 script,info here1
17:19:25 script,info here2
17:19:45 script,info here1
17:19:45 script,info here2

I tried to add script which sets up all global variables at startup and runs only once. But the problem was repeated.
It seems that the problem is in "check3Gstatus" function but I don't know where is it?

Re: Problem with scheduler

Posted: Thu Mar 19, 2015 9:15 am
by sergios
I have analyzed execution of function ""check3Gstatus"" more deeper and noticed that "/interface ppp-client monitor 0 once" is not executed. The last question is "Where is an error?"