Hi, we have a simple script that checks for internet connectivity via the LTE interface but i seem to have an error when it runs when the LTE interface isn’t working.
I’m not sure if its something simple like i have the interface name wrong, would someone mind taking a look and provide some feedback please.
Is not a “type”, is a submenu / section, like on /interface wireless you find the dedicated section for… wireless /interface show all type of interfaces, usually the menu is less rich than the dedicated section for each type of interfaces.
This script work on both way: disable and enable command are present on both generic /interface and dedicated /interface lte section.
But the interface name is lte1
Missing lte interface cause previous script to fail… give me 10 minutes…
this is wrong:
/interface list print count-only where name=LTE
at least
/interface print count-only where type=“lte” (or /interface print count-only where name=“lte1”)
or
/interface lte print count-only where name=“lte1” (or simply /interface lte print count-only)
but really must be do on this way:
[:len [/interface lte find]]
because the print command, with some exception, is related mostly to put text on terminal than manage variables.
Remember on /system logging to save the warning/error logs on DISK file, or you lost that info on reboot (you can not send e-mail or sms if lte1 not work)
ltestatus added for warn only one time when status change
You can put it on scheduler directly without creat separate script,
set the scheduler to start the action on “startup” and run every 4 minutes and 30 seconds (because is already present 30s delay inside script),
and add this before any line of script,
for give the time to the system to finish booting:
WOW… thank you @rextended, thats very helpfull of you.
I will get this loaded onto a RB this morning and test everything, it will be a great, robust script to check the LTE interface and keep it online hopefully.
Sorry to resurrect this thread, i wanted to ask a question if i may.
Is there a way to alter this script so if the ping response fails three times it will reboot the router rather than disable / enable the LTE interface.
I have seen the below issue a couple of times and i believe the LTE interface is crashing due to a number of “not registered” errors but i am not sure if that means the LTE interface doesn’t exist which the script does check for. The above example happened following an automated router reboot which happens everyday at 23:00
I would like to use this script, would you mind changing it to monitor 2 devices on innerweb, i.e. ping both 8.8.8.8 and 1.1.1.1 and if both fails, then take action?
We abandoned central dns addresses like 8.8.8.8 for all of our customer LTE-links because we sometimes encountered global routing errors while the local link still worked. We now only use addresses within ISP’s own networks to probe for possible link errors. There is also a delay of one minute before resetting the LTE-link since it showed that many link errors are automatically restored within that time period.
Normally we don’t reboot the device as just flipping the interface works equally well.
We also send error message regarding link failure etc via SMS and together with external monitoring on the LTE-device we can correlate any downtime to investigate whether the problem originates from the operator network or the local installation.
As a last resort when there are no available ip-connections we can check status or reboot the device by acting on incoming SMS commands. This has proven to be very useful and saved many hours of unnecessary travel as many LTE links are installed in remote branch offices far out in the countryside and on some remote islands.