omapi/omshell database errors

Aaron Holtz aholtz at bright.net
Fri Jan 4 20:37:51 UTC 2008


I'm working with some script to use omapi and I use omshell to do some 
testing.  It appears I have some problems within my leases file which in 
turn causes omshell to bark.

What I'm seeing is this:

> connect
obj: <null>
> new lease
obj: lease
> set hardware-address = 00:1a:66:89:84:b8
obj: lease
hardware-address = 00:1a:66:89:84:b8
> open
can't open object: more than one object matches key
obj: lease
hardware-address = 00:1a:66:89:84:b8


Now if I look into the dhcpd.leases file there are two leases in there - 
one in an 'active' state and one in a 'free' state.

Active:
lease 10.0.0.66 {
  starts 5 2008/01/04 19:38:27;
  ends 6 2008/01/05 07:38:27;
  tstp 6 2008/01/05 07:38:27;
  cltt 5 2008/01/04 19:38:27;
  binding state active;
  next binding state free;
  hardware ethernet 00:1a:66:89:84:b8;
  uid "\001\000\032f\211\204\270";
}


Free:
lease 10.6.6.200 {
  starts 3 2007/12/05 21:40:17;
  ends 3 2007/12/05 21:42:17;
  tstp 3 2007/12/05 21:42:17;
  cltt 3 2007/12/05 21:40:17;
  binding state free;
  hardware ethernet 00:1a:66:89:84:b8;
  uid "\001\000\032f\211\204\270";
}


The 'free' lease is quite old and should have long expired.  In fact, it 
is for a network that this device no longer lives on.  Is there a way to 
either:

1.  Get the dhcp server to only store omapi info about 'active' leases
2.  Flush out these 'free' leases so the omapi hash is correct


I've looked at the server code for where the hash is being updated, but I 
haven't been able to resolve the multiple entries for the same key 
problem.

Any thoughts are appreciated.

-----------------------------------------------------------------
Aaron Holtz <aholtz at bright.net>
Com Net Inc.
UNIX Systems Administration/Network Operations
"It's not broken, it just lacks duct tape."
'02 FLHRCI
-----------------------------------------------------------------


More information about the dhcp-users mailing list