Naveen Kumar g_naveen_k at yahoo.com
Sun Mar 11 03:03:33 UTC 2007

Thanks this worked. I had to do an open and then call wait_for_completion on open before calling object_remove. 
Also for some reason it gives key conflict when removing object with a given name. if I just match on ip/clientId that seems to work.
Thanks again.

----- Original Message ----
From: Martin McCormick <martin at dc.cis.okstate.edu>
To: dhcp-users at isc.org; Naveen Kumar <g_naveen_k at yahoo.com>
Sent: Saturday, March 10, 2007 4:54:25 PM
Subject: Re: dhcpctl_object_remove 

Naveen Kumar writes:
> My code is able to add a host entry by filling in ip-address and 
> client-id fields for the host object, However attempting to delete the 
> object using dhcpctl_object_remove fails with a "not found" error. How 
> does one go about removing host object ??? I have searched archives for 
> dhcp-users but couldn't come up with a conclusive answer.
    Are you sure you have "open"'d the  object after
creating it?  I forgot that the first time I tried this and got
the same error.  Remember that you are making a sort of draft of
what you want to happen but nothing goes over the wire until you
open the remote object which is your dhcp server and then
"remove" the record.  Here is an expect fragment of the script
that worked:

send -- "new host\r"
expect -exact ">"
send -- "set name = \"helium.example.domain\"\r"
expect -exact ">"
send -- "set hardware-address = 00:60:08:37:7F:0A\r"
expect -exact ">"
send -- "set hardware-type = 1\r"
expect -exact ">"
send -- "set ip-address =\r"
expect -exact ">"
send -- "open\r"
expect -exact ">"
send -- "remove\r"
expect -exact ">"
send -- $EOF
expect -exact "\$"

    The last two lines kill off the omshell and look for the
shell prompt.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Network Operations Group

Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.

More information about the dhcp-users mailing list