Martin McCormick martin at dc.cis.okstate.edu
Sat Mar 10 21:54:25 UTC 2007

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

More information about the dhcp-users mailing list