IPAM tomfoolery


I’ve been tasked with finding a replacement for our well-aged IP Address Management (IPAM) software (ISOTRO NetID). The toughest part is the data migration, since the export abilities are very limited. Luckily the backend is just a Sybase database, so I installed the Sybase tools and did an “Unload” into a new version 10 database so I could work with it.

After some poking around, I came up with the following schema for the data we are concerned with:

So, I can get my networks, subnets and IP/domain name pairs with the following queries:
SELECT network, subnet_mask, network_name FROM ip_network ORDER BY network
SELECT network, subnet, subnet_mask, subnet_name FROM ip_subnet ORDER BY subnet
SELECT ip.network, ip.subnet, ip.address, dom.dn_code FROM ip_address [ip] INNER JOIN address_domain [dom] ON ip.address = dom.address ORDER BY ip.address
The final hurdle is that the IP addresses are stored as decimal numbers, rather than dotted quad format. Google led me here. numToDottedQuad looks promising, but the octets are in reverse order, so I changed the format string from ‘L’ to ‘!L’, and viola!. Three CSV files that should be importable to a new solution.

The quick-and-dirty Python script I used to convert my database exports to the final CSVs can be found here.


2 Responses to “IPAM tomfoolery”

  1. 1 Buzz

    LOL, I was about to say use a Python script to reverse the octets but then you came up with that conclusion too. 🙂 You rule!

  2. 2 Buzz

    …Or the CSV converts rather…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: