Page 1 of 1

Update Mikrotik Routerboard

Posted: Tue May 11, 2021 5:37 am
by kelvynator
Hi,

After several attempts and research on different forums, I come back to you with a problem.
I have a CHR and a hundred Mikrotik devices connected to it.
I can now push updates.
What I want to do is update the Routerboard too.
According to my research, there is no functionality in the CHR.
I would therefore like to create a script which connects in SSH on each Mikrotik router and launches the update command "/ system routerboard upgrade", then a reboot.
I first stumbled on authentication, or it was necessary to enter the password each time. Then I generate a private key to be able to log in automatically without a password.

On the other hand I am still struggling to create a script that would allow me to launch the update of the routerboard. I am having problems with the confirmation of the "y" messages.

Have you ever tried this kind of manipulation?
Do you think this is achievable?

Regards

Re: Update Mikrotik Routerboard

Posted: Tue May 11, 2021 10:28 am
by rextended
/system routerboard upgrade
"upgrade" only BIOS, not the software.
It's what you want?

Untill you use any type of terminal, confirmation are everytime needed.
For skip that, schedule command like that 1 or 2 min away:
add name=aggiorna_bios on-event="/system routerboard upgrade" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-date=may/11/2021 start-time=09:40:00


For effective update:
{
/system routerboard settings set auto-upgrade=yes
/system package update set channel=long-term
/system scheduler
remove [find where name="pulizia_al_riavvio"]
add name=pulizia_al_riavvio start-time=startup on-event="/delay 20s;\r\n\
    /file remove [find where name~\".fwf\" or name~\".dpk\" or name~\".npk\"];\r\n\
    /system scheduler remove [find where name=\"pulizia_al_riavvio\"];/system reboot;" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive
/system package update install
}

Re: Update Mikrotik Routerboard

Posted: Wed May 12, 2021 12:20 am
by kelvynator
Hi,
Thanks for you answer.
Yes I have found the command for active autoupdate in routerboard settings.
After upgrade with Dude, i make a second reboot and the routerboard update automatically.

Thanks for your help.

Re: Update Mikrotik Routerboard

Posted: Wed May 12, 2021 4:49 pm
by skullzaflare
We just have the routers "scheduled" to check themselves for a routerboard update upon boot always
/system scheduler
add name=firmwarecheck-reboot on-event="#### Check for Firmware Update \r\
    \n\r\
    \n   /system routerboard\r\
    \n   :if ( [get current-firmware] != [get upgrade-firmware]) do={ \r\
    \n      ## New version of firmware available, let's upgrade\r\
    \n     \r\
    \n\r\
    \n      upgrade\r\
    \n\r\
    \n      ## Wait for upgrade, then reboot\r\
    \n      :delay 2s;\r\
    \n      /system reboot\r\
    \n   } else={\r\
    \n   :log info (\"No Router HW upgrade found\")\r\
    \n   }\r\
    \n}" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-time=startup

At this point we have always setup our own redirect from the upgrade.mikrotik.com to a private internal server so the "check for updates" only pulls from our server and auto deploys weekly for if we decide to change firmwares.

So now our routers auto check for routerboard upgrade every reboot and installs if it has one and weekly checks our update server for "latest" package and upgrades if its newer.

Still slowly deploying these changes to our existing 1800 routers, havent found an easy way to send scripts/config changes

Re: Update Mikrotik Routerboard

Posted: Wed May 12, 2021 6:16 pm
by rextended
Use The Dude, you can upgrade 1000 device at same time, if you want, and no script or fake web update are required.

Re: Update Mikrotik Routerboard

Posted: Wed May 12, 2021 6:37 pm
by skullzaflare
Use The Dude, you can upgrade 1000 device at same time, if you want, and no script or fake web update are required.
This only does the software side and not routerboard, this is OP's problem.
In my case, DUDE is a PoS on 6.46.3+ firmware if you have rOS enabled on the routers. So its useless for managing routers anymore

Re: Update Mikrotik Routerboard

Posted: Wed May 12, 2021 6:58 pm
by rextended
Sorry, PoS? I do not understand :((

With Dude, you can inject any command to the devices, like "/system routerboard upgrade;/sys reboot"