|lookup|find <objecttype> <indexproperty=value> [property ...]||Look up a lease or host. For leases, specify the ip-address or hardware-address. For hosts, specify the name or hardware-address. If property names are specified after the lookup property, only those property values will be returned, one per line. if -v is given, they will be returned in property=value format.|
|create|add|new <objecttype> <property=value> ...||Create a new object, usually a host. For hosts, specify name, hardware-address, hardware-type (usually 1 for ethernet), and optionally ip-address.|
|remove|delete <objecttype> <indexproperty=value>||Delete an object, usually a host. For hosts, you must specify name or hardware-address. At the time this was written, you cannot delete a lease; you can, however, modify the lease and change its state to free, but this requires a patched version of dhcp (as of dhcp-3.0.1, see the README included with the source). See modify, below.|
|modify|change|update <objecttype> <indexproperty=value> <property=value> ...||Change an object. Mostly used to change the state of a lease.|
Currently omcmd only has support for host and lease object types.
The following properties are known to omcmd:
state - the lease state
hardware-type - normally 1 for ethernet
name - unique name for host object
Note: check the dhcp man pages listed in SEE ALSO, below, for more information on the properties and object types.
On success, omcmd returns 0. For an OMAPI error, it returns the isc_result_t value. (See include/isc-dhcp/result.h). Command syntax errors return -1.
Lookup a lease and print everything:
$ ./omcmd -K ~/keyfile -s myserver lookup lease ip-address=10.20.93.155
ends=Sat Jul 31 15:54:28 2004
tstp=Wed Dec 31 19:00:00 1969
tsfp=Wed Dec 31 19:00:00 1969
cltt=Wed Dec 31 19:00:00 1969
Lookup a lease and just give the hardware-address:
$ ./omcmd -K ~/keyfile -s myserver lookup lease ip-address=10.20.93.155 hardware-address
Change a lease state to free:
$ ./omcmd -K ~/keyfile -s myserver modify lease ip-address=10.20.162.42 state=free
Create a new host:
$ ./omcmd -K ~/keyfile -s myserver create host ip-address=10.20.162.242 name=ioreth hardware-type=1 hardware-address=00:e0:b8:50:0f:ab
Note: ip-address is optional.
Delete that host:
$ ./omcmd -K ~/keyfile -s myserver remove host name=ioreth
Report all bugs (and send all patches) to firstname.lastname@example.org.
omcmd was written by David L. Parsley (email@example.com) for use with a custom netreg system.
|Free Software||OMCMD (1)||2005 Oct 10|