as you all know it's difficult to make use of all the features of the
ISC DHCP in OES with either iManager or the JavaConsole (no subclass, no
freeform text entry, etc). One problem is that it's hard to add dhcpd
statements for logging.

We are using a class named 'Any' that matching anything for logging. The
trick is to enter something like below into the 'Conditional Expression'
text entry field of the class editor. I recommend using iManager with a
recent Firefox, then you can resize the text entry field to something

The purpose of the checking of dhcp-message-type in the beginning is to
limit the logging to DHCPDISCOVER and DHCPREQUEST messages. DHCPINFORM
and other messages usually just clutter the log.

The dhcpd usually skips non-existing data by itself for the log()
statement, so you don't need complicated checks like 'if exists option

Please adjust the logging statements to your liking, the version below
should give you some hints on what can be done. The syntax is a bit
fragile, usually I stumble on missing parens around more complex 'if'
conditions. And sometimes iManager appends another ';' at the end. Both
can be diagnosed easily with the help of the error output and checking
the raw configuration as seen by dhcpd in /var/log/dhcp-ldap-startup.log.

There is one caveat though, since this 'Any' class matches anything and
the SLES10SP4 dhcpd is compiled with the default PACKET_MAX_CLASSES=5,
you have one class less that a single host can match at most. This can
easily be an issue if you already make some use of "negative" classes
like "Not_in_VLAN_42".

Have fun,

match if 1 = 1;
if ((option dhcp-message-type = 1) or (option dhcp-message-type = 3)) {
log(info, "#### matched class: Any (for logging)");
if known and static {
log(info, "client is known and static");
if known and not static {
log(info, "client is known");
if static and not known {
log(info, "client is static");
if not (known or static) {
log(info, "client is neither known nor static");
log(info, concat("dhcp-user-class = ", option user-class));
log(info, concat("hardware = ", binary-to-ascii(16, 8, ":", hardware)));
log(info, concat("dhcp-client-identifier = ", binary-to-ascii(16, 8,
":", option dhcp-client-identifier)));
log(info, concat("circuit-id:", " vlan = ",
binary-to-ascii(10,16,"",substring(option agent.circuit-id,2,2)), ",
slot/port = ", binary-to-ascii(10,16,"/",substring(option
agent.circuit-id,4,4)), ", mac=",
binary-to-ascii(16,8,":",substring(option agent.circuit-id,10,6)) ));
log(info, concat("remote-id = ", option agent.remote-id));
log(info, concat("vendor-class-identifier = ", option
log(info, concat("host-name = ", option host-name));
log(info, "#### Class Any Logging finished");