On Tue Jun 15 22:27:02 2010, zidanej@gmail.com wrote:
Show quoted text> Hi Jan,
>
> Also we're trying to do lookup via mac address using this:
>
> $omapi->connect;
> print "\n\nconnected!\n\n\n";
> $lease = $omapi->new_object("lease");
> $lease->hardware_address("00:e0:81:30:27:d4");
> $lease->read;
> We can do lookups with omshell using a specified mac address but we
> can't
> using this perl module. Is there any particular reason for that?
> Thanks!
>
> - Jeff
This will be fixed in 0.07. The reason for this is that it was not
documented as "lookup" from
http://linux.die.net/man/8/dhcpd
Got a better source of documentation? :) Anyway. I did add it. Could you
also have a look at the source code and see if any other attributes are
lacking the "lookup" action?
http://cpansearch.perl.org/src/JHTHORSEN/Net-ISC-DHCPd-
0.05_02/lib/Net/ISC/DHCPd/OMAPI/Lease.pm # please look for all the lines
with "omapi_attr ... => (".
Show quoted text>
> On Tue, Jun 15, 2010 at 6:26 PM, jeff bair <zidanej@gmail.com> wrote:
>
> > Hi Jan,
> >
> > Yes, I'm trying to use state = active as a lookup. This is what I
> have so
> > far basically:
> >
> > $omapi->connect;
> > print "\n\nconnected!\n\n\n";
> > $lease = $omapi->new_object("lease");
> > $lease->ip_address("169.229.7.12");
> > $lease->read;
> >
I've been testing and googling this issue and it seems like the omshell
and/or omapi simply ignores the attribute. What we can do (since this is
an abstraction layer:)) is simply to add a post-filter on the retrieved
data and force "read()" to return false when the retrieved "state" don't
match the requested "state()". I'm not quite sure I like the solution,
but I will implement it on request...
I will release 0.07 when I get your reply - unless you want more to be
included. Fork me at github if you like:
http://github.com/jhthorsen/net-isc-dhcpd