Sample Generic Perl Script for use with DDI API
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.

Comments
Thanks
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