- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Getting Extensible Attribute value from existing DHCP filter using Perl API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-18-2017 01:17 PM
I have IPv4 filters that contain HW addrs. Each HW addr has a defined extensible attribute called "Security Zone". When I try to get them w/the code below, it fails w/this msg:
Use of uninitialized value $zone in concatenation (.) or string at ./Infoblox.pl
---------------------
my @retrieved_objs = $session->get (
object => "Infoblox:HCP::MAC",
mac => "00:03:93:ae:32:0e",
);
foreach my $item (@retrieved_objs) {
my $filter=$item->filter;
print "$filter\n";
my $attrs=$item->extensible_attributes();
my $zone=$attrs->{'Security Zone'};
print "$zone\n";
}
Thanks for any suggestions.
Solved! Go to Solution.
Re: Getting Extensible Attribute value from existing DHCP filter using Perl API
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-18-2017 02:47 PM - edited 08-18-2017 02:49 PM
The code is generally sound. The error you're seeing is being returned from an object w/o the attribute defined. If you just want to not get the error, you can do something like:
print "$zone\n" if $zone;
or return something more useful to find the offender, of course, like:
if ($zone) { print "$zone\n"; }
else { print $item->mac(),"\n"; }
Re: Getting Extensible Attribute value from existing DHCP filter using Perl API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-18-2017 03:40 PM
Should I be using a different object? I've confirmed the extensible attribute exists for the HW addr. The HW addr is under the filter.
Thanks for your help.

Re: Getting Extensible Attribute value from existing DHCP filter using Perl API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-18-2017 04:33 PM
Are you trying to get the attrib off of each MAC entry, or the filter itself? (Obviously, I'm only working from a snippet here, so I don't have full context.)
If per-MAC, I'd suggest putting in the if/else I posted earlier, and then go look at it and verify whether the attrib is in fact there, or if you possibly have something else suspicious.
Re: Getting Extensible Attribute value from existing DHCP filter using Perl API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-18-2017 04:54 PM
Was misreading the columns and the extensible attribute was spelled differently. All good, now. Thanks, again, for your confirmation.
gary