Send Netdot-users mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://osl.uoregon.edu/mailman/listinfo/netdot-users
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-users digest..."
Today's Topics:
1. Re: /etc/hosts import? (Erik Andersen)
----------------------------------------------------------------------
Message: 1
Date: Thu, 28 Aug 2014 21:12:07 -0700
From: Erik Andersen <[email protected]>
Subject: Re: [Netdot-users] /etc/hosts import?
To: Carlos Vicente <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
I'll be honest, I don't really know perl well enough that I've made much
progress on getting the import script to read the bind files I have.
But, I found the rest API. Which seems a lot easier than trying to
script the web interface. I was able to use it import subnets from the
ospf information I had along with comments correlated from our hosts file.
I seem to be able to inport individual static addresses also using the
rest API. I have only imported a thing or two though because I want to
add forward and reverse DNS entries for those at the same time.
For that, I'm trying to figure out how the rr* objects work through the
rest API. The first thing I'm not sure of is if I want to create a
rraddr object, do I need to create a matching rr object first. (Same
thing for a rrptr object). Second, even if I do create a rr object
first, I still get a 400 http error code. I'm not sure if I'm including
all the required parameters (but I have modeled it after the xml I get
if I http GET netdot/rest/rraddr). Here's the python3/requests code I'm
using:
import requests
httpsession = requests.Session()
httpsession.post('http://holly.eoni.com/netdot/NetdotLogin',
data={'destination' : '/netdot/', 'credential_0' : 'admin',
'credential_1' : 'passwordhidden'})
# create rr
httpsession.post('http://holly.eoni.com/netdot/rest/rr',
headers={'Accept': 'application/xml'}, data={'active' : '1',
'auto_update' : '0', 'name' : 'draco', 'zone' : 'eoni.com',
'description' : 'erik_testing_rm'})
# create rraddr
httpsession.post('http://holly.eoni.com/netdot/rest/rraddr',
headers={'Accept': 'application/xml'}, data={'rr' : 'draco.eoni.com',
'ipblock' : '10.5.2.73', 'ttl' : '700'})
I have tried http GETting
http://holly.eoni.com/netdot/rest/rr?id=meta_data and
http://holly.eoni.com/netdot/rest/rr/meta_data in a browser to read the
documentation, but get a "System error" when I do that. (I've also tried
that for rraddr and rrptr). What parameters are required for rr, rraddr,
rrptr, (and while I'm at it, rrcname)? Do I need to create a rr first?
Does creating a rraddr create a matching rrptr?
On a side note, a lot of our reverse DNS for stuff that isn't static is
in a generic format, like 216-228-192-7. Is there a way to have netdot
create those entries on the fly (unless something is set for that
address in netdot)? Or should those each be put in as a separate DNS record?
Thanks,
Erik
On 08/28/2014 05:08 AM, Carlos Vicente wrote:
> The easiest would be to look into why the BIND files are not imported, and
> correct that.
>
> Otherwise, you could write some code to parse your /etc/hosts file and create
> Net::DNS objects, which can then be fed into Zone::import_records() in Netdot.
>
> cv
>
>
> On Aug 27, 2014, at 9:24 PM, Erik Andersen <[email protected]> wrote:
>
>> So, we've maintained our forward and reverse DNS in an /etc/hosts file
>> for years. From that, we have a script (recently rewritten) that
>> generates bind zone files for one forward domain and the IPv4 reverse
>> DNS from that, and then includes some various records from a bind
>> "include" file.
>>
>> The include files are few enough that that could be handled manually.
>>
>> So, is there a way to import a hosts file? I also have a routing table
>> from one of our border routers that I can use to programmatically know
>> where the bounds of various network blocks are.
>>
>> I've tried the bind importer, but for some reason it doesn't like the
>> bind files I've generated (which bind seems fine with):
>> Bareword found where operator expected at eoni.com line 10591, near "245
>> IN"
>> (Missing operator before IN?)
>> Number found where operator expected at eoni.com line 10592, near "216"
>> (Missing semicolon on previous line?)
>> Bareword found where operator expected at eoni.com line 10592, near "246
>> IN"
>> (Missing operator before IN?)
>> Number found where operator expected at eoni.com line 10593, near "216"
>> (Missing semicolon on previous line?)
>>
>> So, I've been using python's requests library to try to interact with
>> the webUI, but that takes quite a while to get right. What's the best
>> way to get a hosts file into netdot (at least for tracking used
>> addresses and generating DNS zone files)?
>>
>> --
>> Erik
>> _______________________________________________
>> Netdot-users mailing list
>> [email protected]
>> https://osl.uoregon.edu/mailman/listinfo/netdot-users
>
------------------------------
_______________________________________________
Netdot-users mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-users
End of Netdot-users Digest, Vol 69, Issue 12
********************************************