Technical Documentation

Tracing Extended DHCP Local Server Operations

The extended DHCP tracing operations track the extended DHCP local server operations and record them in a log file. By default, no extended DHCP local server processes are traced. If you include the traceoptions statement at the [edit system services dhcp-local-server] hierarchy level, the default tracing behavior is the following:

  • Important extended DHCP local server events are logged in a file called jdhcpd located in the /var/log directory.
  • When the file jdhcpd reaches 128 kilobytes (KB), it is renamed jdhcpd.0, then jdhcpd.1, and so on, until there are three trace files. Then the oldest trace file (jdhcpd.2) is overwritten. For more information about how log files are created, see the JUNOS System Log Messages Reference.
  • Log files can be accessed only by the user who configures the tracing operation.

To trace DHCP local server operations, include the traceoptions statement at the [edit system services dhcp-local-server] hierarchy level:

traceoptions {file filename <files number> <size size> <world-readable | no-world-readable> <match regex>;flag flag;}

The following topics describe the tracing operation configuration statements:

  1. Configuring the Filename of the Extended DHCP Local Server Processes Log
  2. Configuring the Number and Size of Extended DHCP Local Server Processes Log Files
  3. Configuring Access to the Log File
  4. Configuring a Regular Expression for Lines to Be Logged
  5. Configuring Trace Option Flags

Configuring the Filename of the Extended DHCP Local Server Processes Log

By default, the name of the file that records trace output is jdhcpd. You can specify a different name by including the file statement at the [edit system services dhcp-local-server traceoptions] hierarchy level:

[edit system services dhcp-local-server traceoptions]file filename;

Configuring the Number and Size of Extended DHCP Local Server Processes Log Files

By default, when the trace file reaches 128 kilobytes (KB) in size, it is renamed jdhcpd.0, then jdhcpd.1, and so on, until there are three trace files. Then the oldest trace file (jdhcpd.2) is overwritten.

You can configure the limits on the number and size of trace files by including the following statements at the [edit system services dhcp-local-server traceoptions] hierarchy level:

[edit system services dhcp-local-server traceoptions]file filename files number size size;

For example, set the maximum file size to 2 MB, and the maximum number of files to 20. When the file that receives the output of the tracking operation (jdhcpd) reaches 2 MB, jdhcpd is renamed jdhcpd.0, and a new file called jdhcpd is created. When the new jdhcpd reaches 2 MB, jdhcpd.0 is renamed jdhcpd.1 and filename is renamed jdhcpd.0. This process repeats until there are 20 trace files. Then the oldest file (jdhcpd.19) is overwritten by the newest file (jdhcpd.0).

The number of files can be from 2 through 1000 files. The file size of each file can be from 10KB through 1 gigabyte (GB).

Configuring Access to the Log File

By default, log files can be accessed only by the user who configures the tracing operation.

To specify that any user can read all log files, include the file world-readable statement at the [edit system services dhcp-local-server traceoptions] hierarchy level:

[edit system services dhcp-local-server traceoptions]file filename world-readable;

To set the default behavior explicitly, include the file no-world-readable statement at the [edit system services dhcp-local-server traceoptions] hierarchy level:

[edit system services dhcp-local-server traceoptions]file filename no-world readable;

Configuring a Regular Expression for Lines to Be Logged

By default, the trace operations output includes all lines relevant to the logged events.

You can refine the output by including the match statement at the [edit system services dhcp-local-server traceoptions] hierarchy level and specifying a regular expression (regex) to be matched:

[edit system services dhcp-local-server traceoptions]file filename match regex;

Configuring Trace Option Flags

By default, only important events are logged. You can configure the trace operations to be logged by including extended DHCP local server tracing flags at the [edit system services dhcp-local-server traceoptions] hierarchy level:

[edit system services dhcp-local-server traceoptions]flag flag;

You can configure the following tracing flags:

  • all—Trace all operations.
  • auth—Trace authentication operations.
  • database—Trace database events.
  • fwd—Trace firewall process events.
  • general—Trace miscellaneous events.
  • ha—Trace high availability-related events.
  • interface—Trace interface operations.
  • io—Trace I/O operations.
  • packet—Trace packet decoding operations.
  • packet-option—Trace DHCP option decoding operations.
  • rpd—Trace routing protocol process events.
  • rtsock—Trace routing socket operations.
  • session-db—Trace session database operations.
  • state—Trace changes in state.
  • ui—Trace user interface operations.

Published: 2010-04-26