Debian/Ubuntu

This page describes the steps for installing and upgrading NXLog Agent on Debian GNU/Linux and its derivatives.

Installing NXLog Agent

First, download the appropriate NXLog Agent installation file from the NXLog website.

  1. Log in to your account, hover your mouse over your account avatar icon at the top of the page, and click on Downloads.

  2. In the Downloads section:

    1. select your NXLog Agent version from the drop-down menu

    2. select your platform by clicking one of the icons

    3. select the files you want to download

  3. Click Download at the bottom.

    Table 1. Available Debian/Ubuntu NXLog Agent files
    Platform Archive

    Debian 10 (Buster)

    nxlog-6.5.9781_debian10_amd64.tar.bz2
    nxlog-6.5.9781_debian10_arm64.tar.bz2

    Debian 11 (Bullseye)

    nxlog-6.5.9781_debian11_amd64.tar.bz2
    nxlog-6.5.9781_debian11_arm64.tar.bz2

    Ubuntu 16.04 (Xenial Xerus)

    nxlog-6.5.9781_ubuntu16_amd64.tar.bz2

    Ubuntu 18.04 (Bionic Beaver)

    nxlog-6.5.9781_ubuntu18_amd64.tar.bz2

    Ubuntu 20.04 (Focal Fossa)

    nxlog-6.5.9781_ubuntu20_amd64.tar.bz2
    nxlog-6.5.9781_ubuntu20_armhf.tar.bz2
    nxlog-6.5.9781_ubuntu20_arm64.tar.bz2

    Ubuntu 22.04 (Focal Fossa)

    nxlog-6.5.9781_ubuntu22_amd64.tar.bz2
    nxlog-6.5.9781_ubuntu22_armhf.tar.bz2
    nxlog-6.5.9781_ubuntu22_arm64.tar.bz2

    Generic DEB

    nxlog-6.5.9781_generic_deb_amd64.deb

    The NXLog Agent installer packages are digitally signed. See Verify the signature of the DEB package for further details.

Connecting to NXLog Platform

You can configure NXLog Agent to connect to NXLog Platform automatically. The installation looks for the following environment variables to configure the Remote Management (xm_admin) instance in the managed.conf file.

NXP_ADDRESS

The NXLog Platform Agent Management URL and port. The installation sets the Host to this value.

NXP_AGENT_LABEL

Sets the agent_label label to this value. You can use this label to Set up automatic agent enrollment.

Set these variables from the terminal before executing the installation. For example:

$ export NXP_ADDRESS="agents.example.com:5515"
$ export NXP_AGENT_LABEL="new"

Installing interactively

  1. Transfer the file to the target server using SFTP or a similar secure method.

  2. Log in to the target server and extract the contents of the archive (unless you are using the generic package):

    The examples below use the amd64 installer. Replace the package name accordingly when executing the commands.

    # tar -xvf nxlog-6.5.9781_debian9_amd64.tar.bz2
    Table 2. NXLog Agent packages in a Debian/Ubuntu archive
    Package Description

    nxlog-6.5.9781_amd64.deb

    The main NXLog Agent package

    nxlog-checkpoint-6.5.9781_amd64.deb

    Provides the im_checkpoint module

    nxlog-dbi-6.5.9781_amd64.deb

    Provides the im_dbi and om_dbi modules

    nxlog-java-6.5.9781_amd64.deb

    Provides the xm_java, im_java, and om_java modules

    nxlog-kafka-6.5.9781_amd64.deb

    Provides the im_kafka and om_kafka modules

    nxlog-odbc-6.5.9781_amd64.deb

    Provides the im_odbc and om_odbc modules

    nxlog-pcap-6.5.9781_amd64.deb

    Provides the im_pcap module

    nxlog-perl-6.5.9781_amd64.deb

    Provides the xm_perl, im_perl, and om_perl modules

    nxlog-python-6.5.9781_amd64.deb

    Provides the xm_python, im_python, and om_python modules

    nxlog-ruby-6.5.9781_amd64.deb

    Provides the xm_ruby, im_ruby, and om_ruby modules

    nxlog-systemd-6.5.9781_amd64.deb

    Provides the im_systemd module

    nxlog-wseventing-6.5.9781_amd64.deb

    Provides the im_wseventing module

    nxlog-zmq-6.5.9781_amd64.deb

    Provides the im_zmq and om_zmq modules

  3. Install the NXLog Agent package(s) and their dependencies.

    1. Optional: To change the NXLog Agent user and group for the installation, set the NXLOG_USER and NXLOG_GROUP environment variables. During installation, a new user and group will be created from these environment variables. They will be used for the User and Group directives in nxlog.conf, and to set ownership of the /opt/nxlog directory. Specifying an already existing user or group is not supported. The created user and group will be deleted when you uninstall NXLog Agent.

      # export NXLOG_USER=nxlog2
      # export NXLOG_GROUP=nxlog2
    2. Use dpkg to install the required NXLog Agent packages (or the generic package, if you are using that).

      # dpkg -i nxlog-6.5.9781_amd64.deb
    3. If dpkg returned errors about uninstalled dependencies, use apt-get to install them and complete the NXLog Agent installation.

      # apt-get -f install
  4. Configure NXLog Agent by editing /opt/nxlog/etc/nxlog.conf.
    See Log collection in the NXLog Platform User Guide for more information and configuration examples.
    For more details about configuring NXLog Agent to collect logs on Linux, see Linux log sources.

  5. Verify the configuration file syntax.

    # /opt/nxlog/bin/nxlog -v
    2017-03-17 08:05:06 INFO configuration OK
  6. Start the service using the service command:

    # service nxlog start
  7. Check that the NXLog Agent service is running with the service command.

    # service nxlog status
    ● nxlog.service - LSB: logging daemon
       Loaded: loaded (/etc/init.d/nxlog)
       Active: active (running) since Wed 2016-10-19 22:21:36 BST; 3h 49min ago
      Process: 518 ExecStart=/etc/init.d/nxlog start (code=exited, status=0/SUCCESS)
       CGroup: /system.slice/nxlog.service
               └─6297 /opt/nxlog/bin/nxlog
    [...]

Upgrading NXLog Agent

To upgrade an NXLog Agent installation to the latest release use dpkg as described in the installation instructions above. The installation will not modify the existing configuration files unless you enable the FORCE environment variable. However, we recommend backing up the configuration files before starting this process.

# dpkg -i nxlog-6.5.9781_amd64.deb

When upgrading, you can configure new NXLog Platform settings by setting the relevant environment variables in addition to the FORCE environment variable. When forcing a configuration update, the installation backs up the nxlog.conf and managed.conf files before applying the changes.

# export NXP_ADDRESS="agents.example.com" NXP_AGENT_LABEL="ubuntu" FORCE="TRUE"
# dpkg -i nxlog-6.5.9781_amd64.deb

If upgrading from an NXLog Agent trial to a licensed copy and you have optional packages installed, such as nxlog-trial-python, use dpkg -i --auto-configure.

# dpkg -i --auto-configure nxlog-6.5.9781_amd64.deb \
  nxlog-python_6.5.9781_amd64.deb

Make sure to edit this example to include all nxlog-trial packages that are installed.

If dpkg returns errors about uninstalled dependencies, resolve them with apt-get.

# apt-get -f install
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 an upgrade is not supported.

Uninstalling NXLog Agent

To uninstall NXLog Agent, use apt-get. To remove any unused dependencies (system-wide), use the --auto-remove option. Verify the operation before going ahead!

# apt-get remove '^nxlog*'

You can also use apt-get purge instead to remove the configuration files.

This procedure may not remove all files that were created while configuring NXLog Agent. Likewise, any files created as a result of NXLog Agent’s operations will not be removed. To find these files, examine the NXLog Agent configuration files and check the NXLog Agent installation directory (/opt/nxlog).