Community discussions

MikroTik App
 
spence
just joined
Topic Author
Posts: 7
Joined: Fri Jun 26, 2009 10:19 pm

Mass file upload and import

Fri Jun 26, 2009 10:23 pm

Is it possible to upload a file to several Mikrotiks and import that file, using The Dude?
 
davidw
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Fri Apr 27, 2007 11:11 pm

Re: Mass file upload and import

Tue Jul 28, 2009 3:05 pm

Not sure what you mean.

Do you want to upload a particular file to multiple routers ?
 
spence
just joined
Topic Author
Posts: 7
Joined: Fri Jun 26, 2009 10:19 pm

Re: Mass file upload and import

Tue Jul 28, 2009 7:41 pm

Yes. I want to be able to upload or even overwrite an existing file on several routers. Logging on to each router is very time consuming.
 
davidw
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Fri Apr 27, 2007 11:11 pm

Re: Mass file upload and import

Wed Jul 29, 2009 12:33 am

Hi,

Ok so Can I ask a few more questions ?
Do you use the dude and do you store the username and passwords in the dude?

Also, are all of your routers listening on ssh port 22 ?

The reason I ask is that I have written some windows software that can do what you are asking but it imports the router information from the dude. Ie ip address, username, password, device type.

We have many routers and wanted to do the same thing.

Are you interested in testing my software ?

My initial tests show that we can upgrade 400 routers in under 2 Mins.

Sure has made our life easier.



Cheers

David
 
spence
just joined
Topic Author
Posts: 7
Joined: Fri Jun 26, 2009 10:19 pm

Re: Mass file upload and import

Wed Jul 29, 2009 1:13 am

Yes. Could you please send it to me?
 
davidw
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Fri Apr 27, 2007 11:11 pm

Re: Mass file upload and import

Wed Jul 29, 2009 4:25 am

How ?
 
spence
just joined
Topic Author
Posts: 7
Joined: Fri Jun 26, 2009 10:19 pm

Re: Mass file upload and import

Wed Jul 29, 2009 4:29 am

is there a way to private message on here so I can give you my email and you could email the file over?
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Mass file upload and import

Wed Jul 29, 2009 5:26 am

davidw,

I would be interested in testing your software as well. For my purpose, I need a way to upload files to multiple routers (ssh would be fine) but also for better package upgrade. If I have dude-x.x.npk installed on a router with say v3.24 and I say Upgrade -> 3.27 it won't work because of the dude package can't be upgraded (not included in 3.27 files).

Anyway, I would be interested in test of your program.
 
davidw
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Fri Apr 27, 2007 11:11 pm

Re: Mass file upload and import

Wed Jul 29, 2009 5:30 am

Doug,

What ports are your routers listening on ? 22 ?

David
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Mass file upload and import

Wed Jul 29, 2009 8:52 am

Doug,

What ports are your routers listening on ? 22 ?

David
Yuup routers are listening via SSH on port 22. Does your software work with Dude or independent of it. I was thinking of doing something through SSH scripts and upload via the command line, but I really like the Dude GUI.
 
davidw
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Fri Apr 27, 2007 11:11 pm

Re: Mass file upload and import

Wed Jul 29, 2009 9:15 am

Software works independent of the dude.

You export a backup file to xyz.xml (this file contains all the information that we need specifically ip address, username, password)

Then my windows program reads this file and displays a list of routers.

You select the routers and enter a command that you want run and it goes and executes them.

We have a lot of routers behind public IP addresses so we use a lot of port forwarding to access each router.

Just putting the finishing touches on the first version.

stay tuned.
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Mass file upload and import

Wed Jul 29, 2009 9:33 am

I can't wait to test it :-)!
 
davidw
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Fri Apr 27, 2007 11:11 pm

Re: Mass file upload and import

Fri Jul 31, 2009 4:45 am

Hi doug and any one else who is interested.

Please go here and register your interest.

https://secure.myport.com.au/myportdownload.asp

I am hoping to complete initial testing this afternoon and should have some thing to you shortly.

Cheers

David
 
pjulian
Member Candidate
Member Candidate
Posts: 267
Joined: Mon May 31, 2004 12:16 pm
Location: Sydney, Australia

Re: Mass file upload and import

Fri Jul 31, 2009 12:44 pm

Why not just FTP your files to your boxes and then run a script with a schedule that imports the file (runs a script) which is sent with your files.

We do this for our usermanager updates to add new scratch cards.
Simply generate a script file with the relevant commands in it and send it with the files so that the script file is executed by another script on the router, which then runs whatever ROS commands you want to on the router locally.

Regards
Paul
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Mass file upload and import

Fri Jul 31, 2009 5:04 pm

Why not just FTP your files to your boxes
This is the problem the program is trying to solve.
 
pjulian
Member Candidate
Member Candidate
Posts: 267
Joined: Mon May 31, 2004 12:16 pm
Location: Sydney, Australia

Re: Mass file upload and import

Sat Aug 01, 2009 1:22 am

I don't understand why that's a problem though, it's easy to batch uploads using FTP.

Regards
Paul
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Mass file upload and import

Sat Aug 01, 2009 7:28 am

I don't understand why that's a problem though, it's easy to batch uploads using FTP.

Regards
Paul
I think davidw's program is a GUI that imports router info straight from Dude (using XML). You could use command line tools but a GUI would be a plus.
 
davidw
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Fri Apr 27, 2007 11:11 pm

Re: Mass file upload and import

Tue Aug 18, 2009 4:14 pm

Offical Web Site is now : http://www.routertools.com.au
 
spence
just joined
Topic Author
Posts: 7
Joined: Fri Jun 26, 2009 10:19 pm

Re: Mass file upload and import

Sat Aug 29, 2009 3:57 am

Pure excellence!
 
mtDave
just joined
Posts: 5
Joined: Wed Aug 15, 2007 8:19 am

Re: Mass file upload and import

Wed Jan 13, 2010 4:46 pm

Sorry to open an old post, but I am very interested in pjulian's comment above. I am trying to figure out how to upload a script file via FTP and have a scheduled script execute the uploaded script.

Does anyone know how I can do this?

Thanks.
 
pjulian
Member Candidate
Member Candidate
Posts: 267
Joined: Mon May 31, 2004 12:16 pm
Location: Sydney, Australia

Re: Mass file upload and import

Wed Jan 13, 2010 5:11 pm

Don't be sorry, this is what forums are for, to share information.
What you want to do is easy when you know how.

Here is an example.
There are 4 parts to what you need to do, the first is the creation of the file to be uploaded to the router, this must follow the correct syntax of any normal script which is run on the router, for example, this process will add a user into the usermanager database in ROS, then cleanup the script once it's been imported.

Part 1, create the script file in a text format and make the extension .rsc, for example newusers.rsc, add some stuff in there to tell you it worked as well :-)
/tool user-manager user add username=freddy password=mypassword group=public location=freds_diner download-limit=0 upload-limit=0 uptime-limit=30m subscriber=mysubscriber add-credit=24hour
/tool e-mail send to="my@email.domain" subject="User Import Completed" body="Freds Diner imported some new users into the system" file=newusers.rsc
:log info ("New Users Imported - " . [/sys cl get time] . " on " . [/sys cl get date])

Part 2, upload the script file
Just do an automated FTP upload or whatever you are going to do, make sure the script file goes in the root directory of the router, AutoIt is a handy little app for this stuff.

Part 3, have another script running as a scheduled job on the router which then runs your new script that you uploaded, obviously you always need to name your new script the same name to make this work. You will need 2 scripts, one is the scheduled script to trigger the import and cleanup, the second is the script that actually does the import, use something like this to do the import.
/import newhsusers (important, don't add file extension here, it's not needed, it already knows you are doing an import)

Use something like this as your trigger script which is run by the scheduler every X minutes depending on your needs, it needs to run the import script above plus the cleanup script in part 4.
/system script run import_users
:delay 10s
/system script run cleanup


Part 4, cleanup the script file you uploaded so that it doesn't run again by using something like this in a script.
/file remove newusers.rsc

I hope that helps, it took me ages to work it all out....
Be aware though, there are some commands and syntax that work on the command line of the router but not in a script, not sure why but I came across a few quirky commands like this.

Good Luck

Regards
Paul

Who is online

Users browsing this forum: No registered users and 2 guests