Bind config files parser in python

Completed Posted Oct 23, 2014 Paid on delivery
Completed Paid on delivery

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 Software Development

Project ID: #6630018

About the project

5 proposals Remote project Active Oct 25, 2014

Awarded to:

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 More

€29 EUR in 5 days
(4 Reviews)
3.1

5 freelancers are bidding on average €73 for this job

exansoft

A proposal has not yet been provided

€260 EUR in 7 days
(9 Reviews)
4.6
lockbox

Nie złożono jeszcze oferty.

€30 EUR in 0 days
(4 Reviews)
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 in 1 day
(0 Reviews)
0.0
galshtengel

A proposal has not yet been provided

€19 EUR in 1 day
(0 Reviews)
0.0