Bind config files parser in python

Completado Publicado Oct 23, 2014 Pagado a la entrega
Completado 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.

DNS Python Desarrollo de software

Nº del proyecto: #6630018

Sobre el proyecto

5 propuestas Proyecto remoto Activo Oct 25, 2014

Adjudicado a:

georgvogelhuber

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

€29 EUR en 5 días
(4 comentarios)
3.1

5 freelancers están ofertando un promedio de €73 por este trabajo

exansoft

A proposal has not yet been provided

€260 EUR en 7 días
(9 comentarios)
4.6
lockbox

Nie złożono jeszcze oferty.

€30 EUR en 0 días
(4 comentarios)
3.0
owaismunir

I am one of the python developer. I'll give you great solutions for your requirement. I done a lot work on python.

€29 EUR en 1 día
(0 comentarios)
0.0
galshtengel

A proposal has not yet been provided

€19 EUR en 1 día
(0 comentarios)
0.0