NXLog Documentation

OpenBSD

This topic describes the steps to install and upgrade NXLog on OpenBSD.

Installing

NXLog is available as precompiled packages for OpenBSD upon request. Follow these steps to install NXLog.

  1. Contact us to request the OpenBSD packages.

  2. Use SFTP or a similar secure method to transfer the archive to the target server.

  3. Log in to the target server as the root user.

  4. Optional: To change the NXLog user and group for the installation, set the NXLOG_USER and NXLOG_GROUP environment variables. During installation a new user and and a new group will be created based on these environment variables. They will be used for User and Group directives in nxlog.conf, and for the ownership of some directories under /opt/nxlog. Specifying an already existing user or group is not supported. The created user and group will be deleted on NXLog removal.

    # export NXLOG_USER=nxlog2
    # export NXLOG_GROUP=nxlog2
  5. Install NXLog with the pkg_add(1) utility. The OpenBSD package is currently unsigned, use the -D unsigned flag to install.

    # pkg_add -D unsigned nxlog-5.5.7545-obsd6_2_x86_64.tgz
    nxlog-5.5.7545-obsd6_2: ok
    The following new rcscripts were installed: /etc/rc.d/nxlog
    See rcctl(8) for details.

    The installation prefix is /opt/nxlog. Configuration files are located in /opt/nxlog/etc. The rc init script is placed in /etc/rc.d on installation.

  6. Edit the configuration file.

    # vi /opt/nxlog/etc/nxlog.conf

    General information about configuring NXLog can be found in Configuration. For more details about configuring NXLog to collect logs on BSD, see the OpenBSD summary.

  7. Verify the configuration file syntax.

    # /opt/nxlog/bin/nxlog -v
    2017-03-17 08:05:06 INFO configuration OK
  8. Manage the service using the rcctl(8) utility.

    # rcctl enable nxlog
    # rcctl start nxlog
    nxlog(ok)
    # rcctl stop nxlog
    nxlog(ok)
    # rcctl disable nxlog

    You can also use rcctl(8) to check and set the configuration flags.

    # rcctl set nxlog flags -c /tmp/sample-nxlog.conf
    # rcctl get nxlog
    nxlog_class=daemon
    nxlog_flags=-c /tmp/sample-nxlog.conf
    nxlog_rtable=0
    nxlog_timeout=30
    nxlog_user=root
    # rcctl reload nxlog
  9. Check the NXLog service status using rcctl(8).

    # rcctl check nxlog
    nxlog(ok)

Upgrading

To upgrade from a previous NXLog version (whether a licensed copy or trial), use the pkg_add(1) utility. This example shows an upgrade from version 3.0.1865 to 5.5.7545. It is recommended to make a backup of the configuration files before starting this process.

# pkg_add -U nxlog-5.5.7545-obsd6_2_x86_64.tgz
nxlog-3.0.1865-obsd6_2->5.5.7545-obsd6_2: ok
Read shared items: ok

To replace a trial installation of NXLog Enterprise Edition with a licensed copy of the same version, use pkg_add with the replace flag (-r).

# pkg_add -r nxlog-5.5.7545-obsd6_2_x86_64.tgz
The same user and group will be used for the upgrade as was used for the original installation (see installation user and group above). Changing to a different user and group during upgrade is not supported.

Uninstalling

To uninstall NXLog, follow these steps.

  1. Use the pkg_delete(1) utility to remove the nxlog package.

    # pkg_delete nxlog
    nxlog-5.5.7545-obsd6_2: ok
    Read shared items: ok
    --- -nxlog-5.5.7545-obsd6_2 -------------------

    The uninstall script will remove NXLog along with the user, group, and files. The pkg_delete utility will not remove new files or modified configuration files.

  2. Manually remove the base directory. This will remove any new or modified files left behind by the previous step.

    # rm -rf /opt/nxlog