FreeBSD
This page describes the steps for installing and upgrading NXLog Agent on FreeBSD.
Installing NXLog Agent
NXLog Agent is available as a precompiled package for FreeBSD. Follow these steps to install NXLog Agent.
First, download the appropriate NXLog Agent install file from the NXLog website.
-
Log in to your account, then click My account at the top of the page.
-
Under the Downloads > NXLog Agent files tab, choose the
nxlog-6.4.9634_fbsd_x86_64.tgz
package. -
Use SFTP or a similar secure method to transfer the archive to the target server.
-
Log in to the target server as the root user.
-
Optional: To change the NXLog Agent user and group for the installation, set the
NXLOG_USER
andNXLOG_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 innxlog.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.# setenv NXLOG_USER nxlog2 # setenv NXLOG_GROUP nxlog2
-
Install NXLog Agent with the
pkg(7)
utility.# pkg add nxlog-6.4.9634_fbsd_x86_64.tgz Installing nxlog-6.4.9634-fbsd... Extracting nxlog-6.4.9634-fbsd: 100%
The installation path is
/opt/nxlog
. Configuration files are located in/opt/nxlog/etc
. Therc
init script is placed in/etc/rc.d/
on installation. Annxlog
user account is created, and NXLog Agent will run under this user by default. -
Edit the configuration file.
# vi /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 FreeBSD, see FreeBSD log sources. -
Verify the configuration file syntax.
# /opt/nxlog/bin/nxlog -v 2017-03-17 08:05:06 INFO configuration OK
-
To enable NXLog Agent, add the line
nxlog_enable="YES"
to/etc/rc.conf
. Then manage the NXLog Agent service with theservice(8)
utility.# service nxlog start # service nxlog status nxlog is running as pid 83708. # service nxlog stop process 83708 stopped
Upgrading NXLog Agent
To upgrade NXLog Agent, first remove the old version and then install the new version. Make a backup of the configuration files before starting this process so you can use them with the new installation.
-
Remove the installed version of NXLog Agent with the
pkg(7)
utility.# pkg delete nxlog Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 1 packages (of 0 packages in the universe): Installed packages to be REMOVED: nxlog-6.4.9634-fbsd Number of packages to be removed: 1 The operation will free 39 MiB. Proceed with deinstalling packages? [y/N]: y [1/1] Deinstalling nxlog-6.4.9634-fbsd... [1/1] Deleting files for nxlog-6.4.9634-fbsd: 100%
-
Install the new version as described in the installation instructions above.
# pkg add nxlog-6.4.9634_fbsd_x86_64.tgz Installing nxlog-6.4.9634-fbsd... Extracting nxlog-6.4.9634-fbsd: 100%
-
Restart the NXLog Agent service.
# service nxlog restart
Uninstalling NXLog Agent
-
Use the
pkg(7)
utility to uninstall the NXLog Agent package.# pkg delete nxlog Updating database digests format: 100% Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 1 packages (of 0 packages in the universe): Installed packages to be REMOVED: nxlog-6.4.9634-fbsd Number of packages to be removed: 1 The operation will free 92 MiB. Proceed with deinstalling packages? [y/N]: y [1/1] Deinstalling nxlog-6.4.9634-fbsd... [1/1] Deleting files for nxlog-6.4.9634-fbsd: 100%
The uninstall script will remove NXLog Agent along with the user, group, and files. The
pkg
utility will not remove new or modified files. -
Delete the base directory. This will remove any new or modified files left behind by the previous step.
# rm -rf /opt/nxlog