bloxHub

www.infoblox.com/community
Sample Generic Perl Script for use with DDI API
Posted on June 01, 2012 | Last edited by bubba on May 14, 2013
Filed in Bloxtools/Snapins
+1
+2
-1
File name: generic.pl_.txt
File size: 48.53 KB

This script is a generic Perl script template that I created a while back so I could easily leverage a lot of the basic actions that I typically need when working with the API.  I don't always need everything in it but it's easier to have one template to work from than a bunch of unique scripts.

 

Most of this is utility type functions for processing command line options, establishing a connection with the Grid Master and then having a spot for all of the "custom" code to perform specific operations.  If there's interest, I'll post a couple of examples of specific tasks later.

Tags:

Comments

bubba on

this looks pretty cool. I'm a perl noob. I'm looking for specific uses for the perl API for Infoblox. Specifically...

1. query my dhcp scopes for all MAC addresses; save them into some sort of csv file

2. dump those mac addresses into another csv file to add the mac addresses to my filter

Yes, it is as weird as it sounds like... right now, i'm on a big campus and we let anybody plug in & get an IP. I need to lock that down, but not before gathering a list of MAC addresses that are on the network now. Then, later, when I limit my DHCP to my filter, those that were already connected (in the last couple of weeks) will be in the filter and able to get an address. New computers coming in will need to be registered. Make sense?

...So, upon attempting to run this, I get missing libraries probably. 

Can't locate Text/CSV.pm in @INC (@INC contains: C:/Perl64/site/lib C:/Perl64/lib . ./lib C:/scripts C:/scripts/lib) at C:\scripts\ipam2.pl

+1
0
-1

Add comment

Log in or register to post comments

Welcome to bloxHub

Welcome to bloxHub, our community for users of Infoblox products. Most of our content can be viewed as a guest, but if you wish to contribute or join a conversation, you will need to log in. If you don't have a bloxHub account, we invite you to register an account and join us.

Follow us on Twitter

Follow us on Twitter at @bloxHub and we'll keep you notified of new content on the community as well as webinars and other items of interest to Infoblox users.