Python Forum
Getting remote addresses from database
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting remote addresses from database
#1
Hi, im looking to make a program that connects to 20+ remote machines and runs some commands on them and also downloads some files from them.

Because the number of remote hosts is high and will increase in future, i was thinking i would make a simple database (mysql) that has id, description and ip_add field, the program would then get the ip's that it should connect to from the database. I would also make a simple .php site for adding and removing remote hosts from the database.

Does this kind of setup make any sense? Or is there some other solution that anyone can think off?

Im just starting to learn python so im not sure if what i have planned makes any sense.

For the actual connecting to remote hosts i was thinking of using paramiko.

(no coding done yet, still on planning phase, sorry)

Thanks
Reply
#2
I think this is what you need: https://github.com/0rpc/zerorpc-python
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
(May-11-2017, 05:02 PM)desudesu Wrote: desudesuDoes this kind of setup make any sense?
Yes,but not the php site Undecided
Look into Fabric(port to 3) or Ansible.
Ansible is a very powerful,so if want to connect to many remote host i can be worth looking into.
Eg Strategies

Quote:All hosts will run each task before any host starts the next task, using the number of forks (default 5) to parallelize.

Quote:A second strategy ships with ansible free, which allows each host to run until the end of the play as fast as it can.:
Reply
#4
Hi, read up on ansible a little, bit, it seems its mainly used in running simple tasks on servers, not sure if it can do the complex things i would need it to do.

What i have is a empty server, what i want to make it do is, connect to remote clients that collects different kinds of data non-stop 24/7, every 12-24 hours the server should connect to these remote hosts and download new data files to the server, also somekind of check should be implemented so data already on server isnt download and if there is data missing from previous days (from last 10days for example, no internet connection perhaps) that data should be downloaded aswell.

So in short:
1. Connect to 20+ remote hosts daily (if connection not avaible, notify admin and possibly try again later for that specific remost host)
2. Check data on remotehosts (different filetypes, data on different directories on most remote hosts)
3. Check if new data is intact (no 0byte files, if 0byte files, admin should be notified, since theres a problem on remote host)
4. Download new and missing data (from days when connection to remote host wasnt available)
5. when all files downloaded, push them to a fileserver to be analyzed. END
6. Display analyzed data on website (this we have already worked out and is in use now)

This is a VERY VERY(!) simplified discription off the things this new server has to do.

Currently we have 30+ scripts running from several different machines, that do the basic data transfers and someone does the data integrity verifications manually everyday. The idea is the automate all the work, so the only thing left to do manually is to check a simple output file that says what has been done and what hasnt.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  a function to get IP addresses of interfaces Skaperen 2 1,420 May-30-2022, 05:00 PM
Last Post: Skaperen
  Loop through list of ip-addresses [SOLVED] AlphaInc 7 3,956 May-11-2022, 02:23 PM
Last Post: menator01
  instance methods sharing addresses mim 1 2,236 Mar-28-2021, 05:22 AM
Last Post: deanhystad
  Convert email addresses to VCF format jehoshua 2 4,670 Mar-06-2021, 12:50 AM
Last Post: jehoshua
  crunching ip addresses snichols 5 2,787 Nov-10-2020, 05:24 PM
Last Post: snichols
  extract email addresses from gmail vigneshboolog 0 1,759 Feb-11-2020, 09:23 AM
Last Post: vigneshboolog
  Unable to login to remote SQL Server database sipriusPT 1 15,020 Dec-20-2019, 10:16 AM
Last Post: sipriusPT
  Extract email addresses from string and store them in a list oslosurfer 2 2,695 Nov-24-2019, 03:35 PM
Last Post: oslosurfer
  Read list of IP addresses from file and return a network dflick 4 4,885 Oct-27-2018, 09:33 AM
Last Post: buran
  connect to remote database via python script sunstar20 5 5,336 Apr-23-2018, 11:05 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020