OMAPI Command Shell


SUBMITTED BY: Guest

DATE: June 2, 2014, 1:19 p.m.

FORMAT: Text only

SIZE: 3.8 kB

HITS: 5792

  1. NAME
  2. omshell - OMAPI Command Shell
  3. SYNOPSIS
  4. omshell
  5. DESCRIPTION
  6. The OMAPI Command Shell, omshell, provides an interactive way to connect to, query, and possibly change, the ISC DHCP Server's state via OMAPI, the Object Management API. By using OMAPI and omshell, you do not have to stop, make changes, and then restart the DHCP server, but can make the changes while the server is running. Omshell provides a way of accessing OMAPI.
  7. OMAPI is simply a communications mechanism that allows you to manipulate objects. In order to actually use omshell, you must understand what objects are available and how to use them. Documentation for OMAPI objects can be found in the documentation for the server that provides them - for example, in the dhcpd(1) manual page and the dhclient(1) manual page.
  8. CONTRIBUTIONS
  9. This software is free software. At various times its development has been underwritten by various organizations, including the ISC and Vixie Enterprises. The development of 3.0 has been funded almost entirely by Nominum, Inc.
  10. At this point development is being shepherded by Ted Lemon, and hosted by the ISC, but the future of this project depends on you. If you have features you want, please consider implementing them.
  11. LOCAL AND REMOTE OBJECTS
  12. Throughout this document, there are references to local and remote objects. Local objects are ones created in omshell with the new command. Remote objects are ones on the server: leases, hosts, and groups that the DHCP server knows about. Local and remote objects are associated together to enable viewing and modification of object attributes. Also, new remote objects can be created to match local objects.
  13. OPENING A CONNECTION
  14. omshell is started from the command line. Once omshell is started, there are several commands that can be issued:
  15. server address
  16. where address is the IP address of the DHCP server to connect to. If this is not specified, the default server is 127.0.0.1 (localhost).
  17. port number
  18. where number is the port that OMAPI listens on. By default, this is 7911.
  19. key name secret
  20. This specifies the TSIG key to use to authenticate the OMAPI transactions. name is the name of a key defined in dhcpd.conf with the omapi-key statement. The secret is the secret generated from dnssec-keygen or another key generation program.
  21. connect
  22. This starts the OMAPI connection to the server as specified by the server statement.
  23. CREATING LOCAL OBJECTS
  24. Any object defined in OMAPI can be created, queried, and/or modified. The object types available to OMAPI are defined in dhcpd(8) and dhclient. When using omshell, objects are first defined locally, manipulated as desired, and then associated with an object on the server. Only one object can be manipulated at a time. To create a local object, use
  25. new object-type
  26. object-type is one of group, host, or lease.
  27. At this point, you now have an object that you can set properties on. For example, if a new lease object was created with new lease, any of a lease's attributes can be set as follows:
  28. set attribute-name = value
  29. Attribute names are defined in dhcpd(8) and dhclient(8). Values should be quoted if they are strings. So, to set a lease's IP address, you would do the following: set ip-address = 192.168.4.50
  30. ASSOCIATING LOCAL AND REMOTE OBJECTS
  31. At this point, you can query the server for information about this lease, by
  32. open
  33. Now, the local lease object you created and set the IP address for is associated with the corresponding lease object on the DHCP server. All of the lease attributes from the DHCP server are now also the attributes on the local object, and will be shown in omshell.

comments powered by Disqus