Bind config files parser in python
€8-30 EUR
Pagado a la entrega
Short: I need a python script that gets as input a file with a list of hostnames and outputs a cvs like formatted list of bind configuration parameters. The end goal is to import in excel.
Long:
The input file will have a hostname or ip address, one or several files locations on the destination server that must be parsed. The format of this file is at your choice (cvs like and variations, json, xml…)
Nice to have: the files locations could contains wildcards
Ex:
hostname1 : /var/lib/named/[url removed, login to view]
hostname2 : /var/lib/named/[url removed, login to view] : /var/lib/named/[url removed, login to view]
hostname 3 : /var/lib/named/named.*
The options for running the script:
--input <input file name>
--fetch -> just connect to the hosts from the file name and get the files and save them locally
--process <folder> -> get the bind config files from the folder and parse them
If just the “—input” is specified the script must do “fetch + process”
If no option is given, the help is shown
The local files are saved in the current folder with the name “date-time” (ex: 20141023-1027)
The connection to the servers is done with ssh with rsa keys. The rsa keys are already installed. The user is “named”.
The output of the parsing is as follows:
- the output is on the screen/terminal/standard output
- I’m interested only in the zone definitions
- must parse the forward, master and slave zone entries
For example server hostname1 have a file [url removed, login to view]:
zone "[url removed, login to view]" {
type forward;
forwarders { [url removed, login to view]; [url removed, login to view]; };
};
zone "[url removed, login to view]" in {
type master;
file "[url removed, login to view]";
};
zone "[url removed, login to view]" in {
type slave;
file "[url removed, login to view]";
};
zone "[url removed, login to view]" in {
type master;
file "[url removed, login to view]";
};
The output:
hostname1;[url removed, login to view];forward; [url removed, login to view]; [url removed, login to view];
hostname1;[url removed, login to view];master
hostname1;[url removed, login to view];slave
hostname1; [url removed, login to view];master
…..
Hostname2….
Hostname3…..
…..
The coder must have him own test platform, I can only test on my side and give feedback. I can’t give access to my servers or more sample files.
The script must work on python2.4 on RedHat.
FYI: the number of servers is around 200 with around 400 zone records per server.
Nº del proyecto: #6630018
Sobre el proyecto
Adjudicado a:
Hello, I'm a graduated mathematician and computer scientist from germany. I've done a lot of work with python and I've also lots of experience with getting data from different servers and parsing data. For your p Más
5 freelancers están ofertando un promedio de €73 por este trabajo
I am one of the python developer. I'll give you great solutions for your requirement. I done a lot work on python.