NXLog Docs

Installing NXLog Agent Minder

The product is delivered as a generic Linux package in DEB and RPM package formats. The binary is currently statically linked.

Installing on Debian and Ubuntu systems

apt install ./nxlog-minder_VERSION_ARCH.deb

Installing on Redhat, SUSE, and other RPM based systems

zypper install ./nxlog-minder-VERSION-1.ARCH.rpm
yum install ./nxlog-minder-VERSION-1.ARCH.rpm
dnf install ./nxlog-minder-VERSION-1.ARCH.rpm

Installing on Docker

tar xf nxlog-minder_VERSION_amd64-docker.tgz
docker-compose up -d

Starting and stopping NXLog Agent Minder

systemctl start minder.service

Checking the NXLog Agent Minder logs

systemctl status minder.service
journalctl --unit minder.service

Initial Configuration

NXLog Agent Minder will generate a CA key and certificate and a server key and certificate for the agent connection port and the API port. These are stored in /opt/minder/conf/cert and /opt/minder/conf/PKI

Using your own keys and certificates

Overwrite the existing keys and certificates as needed and they will be loaded on next start.

/opt/minder/conf/cert holds the files used for external communication.

  • agent communication

    • minder-cert.pem

    • minder-key.pem

  • API port communication

    • api-cert.pem

    • api-key.pem

/opt/minder/conf/PKI holds the files of the PKI

  • ca-cert.pem

  • ca-key.pem

We currently do not persist the agent keys and certificates on the server side. This will be implemented at a later time.

Connecting an agent

Agents will need to be set up with a simple configuration file.

This configuration file must be placed in /opt/nxlog/etc/nxlog.d and named managed.conf

The file must be included from the main nxlog.conf file located in /opt/nxlog/etc.


LogLevel    INFO
LogFile     %MYLOGFILE%

<Extension agent_managment>
    Module          xm_admin
    Connect         %NXLOG_MANAGER_ADDRESS%
    Port            %NXLOG_MANAGER_PORT%
    SocketType      SSL
    AllowUntrusted  TRUE
    RequireCert     FALSE
    <ACL conf>
        Directory   %CONFDIR%
        AllowRead   TRUE
        AllowWrite  TRUE
    <ACL cert>
        Directory   %CERTDIR%
        AllowRead   TRUE
        AllowWrite  TRUE
nxlog.conf is set up with the required include when it is installed.
If you are running NXLog Enterprise Edition version 4.x the configuration file location is /opt/nxlog/var/lib/nxlog/log4ensics.conf

Configuring the new agent

First the agent needs to be enrolled. The IP address belongs to the NXLog Agent Minder server, and 4041 is the agent management port.

./cli.sh enroll agent-1

Specifying the wrong IP address here will take the agent offline. Make sure you use the address that will be visible for the agent. Network and port address translation techniques, load balancers may occlude the actual IPaddress of the agent-manager.

Then the configuration can be edited:

./cli.sh edit-agent agent-1

This will load the current agent configuration in an editor:

LogLevel    INFO
LogFile     %MYLOGFILE%

<Extension admin>
    Module      xm_admin
    SocketType  SSL
    CAFile      %CERTDIR%/agent-ca.pem
    CertFile    %CERTDIR%/agent-cert.pem
    CertKeyFile %CERTDIR%/agent-key.pem

    <ACL conf>
        Directory   %CONFDIR%
        AllowRead   TRUE
        AllowWrite  TRUE

    <ACL cert>
        Directory   %CERTDIR%
        AllowRead   TRUE
        AllowWrite  TRUE

im_mark can be applied to generate heartbeat messages:

<Input mark>
    Module          im_mark
    MarkInterval    1
    Mark            NXLog heartbeat

im_internal can collect the agent logs so they can also be sent to a central location:

<Input nxlog>
   Module im_internal

Then an output module and a route can be set up so the messages are sent to a destination:

<Output tcp_out>
   Module om_tcp
   Host   your-syslog-server:1514

<Route r_n>
   Path mark,nxlog => tcp_out

Please take care to create a valid configuration. There is no configuration validation implemented at this point. If the new configuration breaks the agent, manual intervention on the agent will be necessary to recover.

Running a simple query

curl -k -sS -X GET 'https://minder-server:8080/api/v0.5/agents/ids'

Prometheus quickstart

Prometheus can be deployed in a matter of minutes using docker and the following script.

Make sure you update the Prometheus configuration with the correct address of NXLog Agent Minder



# Create prometheus configuration
cat > prometheus.yml << EOF
  scrape_interval:     15s # By default, scrape targets every 15 seconds.
    monitor: 'codelab-monitor'
  - job_name: 'prometheus'
    scrape_interval: 5s
      - targets: ['localhost:9090']
  - job_name: 'nxlog'
    scrape_interval: 60s
    scheme: https
      - targets: ['$MINDER_SERVER']
      insecure_skip_verify: true

cat > Dockerfile << EOF
FROM quay.io/prometheus/prometheus
ADD prometheus.yml /etc/prometheus
docker build -t $PROM_IMG .
docker create --name $PROM_CONTAINER --hostname $PROM_CONTAINER -p 9090:9090 $PROM_IMG
docker start $PROM_CONTAINER

docker run -h $GRAF_CONTAINER --name $GRAF_CONTAINER -d -p 3000:3000 grafana/grafana

docker network create -d bridge $NET
docker network connect  $NET $PROM_CONTAINER
docker network connect  $NET $GRAF_CONTAINER