NoMachine Support

Your questions answered

Knowledge Base

Searching in: Documents
Filter the search results
Version:
Last update:
Searching in: Documents
ID: DT10O00162
Version: NoMachine 6
Added on: 2017-11-15
Last update: 2018-10-12
Collect server side logs automatically
Table of Contents
Introduction
Collect NoMachine Logs
1. Short Instructions
2. Detailed Instructions
Appendix
3. Collect Specific Logs


Introduction

NoMachine servers provide command line tools to enable debug log level, collect the necessary logs and create a compressed archive ready to be sent to the Support Team. These tools are run by the 'nxserver --debug' and relative options.

The 'nxserver --debug' commands used in the following instructions have to be executed from command line in a terminal on Linux and Mac or a CMD console on Windows.

Administrative privileges are requested to run it: launch it with sudo on Linux and Mac or without sudo and as root; on Windows open a CMD console executed as administrator.

The 'nxserver --debug' tools cannot be used to collect logs written to system log. In this case, extract them from the system log, you may look for the 'NX' key word (e.g. on Linux: grep NX /var/log/messages > syslog.extract)

About client side logs, when the connection terminates with an error, the client shows a short error message and asks to save logs of that problem into a directory. Otherwise, if requested by the Support Team, it's necessary to collect them manually as explained in the next paragraphs or in the document linked above.

In case of multi-host environments, the 'nxserver --debug' tools must be run on the main server and on the problematic host where the issue occurred. For example, in a multi-node environment made of a main server ETS and two nodes TSN1 and TSN2, if the session cannot be started on the second node it will be necessary to run the 'nxserver --debug' commands on ETS and also on TSN2 to gather logs from both machines.

TIP
Since NoMachine v. 6.3, the 'nxserver --debug' tools allow to gather also logs of the NoMachine display agent. Such logs are relevant to debug issues like visual artifacts, slowness, unclean termination of the session etc ...

Note that in case of sudden termination of nx* processes, it's still necessary to retrieve the related core file and debug it as explained in the chapter about How to Gather a Stacktrace here: https://www.nomachine.com/DT10O00163


Collect NoMachine Logs
1. Short Instructions

1) Enable debug level on the problematic machine:

nxserver --debug --enable all

2) Connect and reproduce the problem.

3) Create the log archive:

nxserver --debug --collect

4) Collect client side logs (if requested)

5) Send logs to Support Team as e-mail attachment (keep the ticket ID in the subject).

6) Restore Informational log level:

nxserver --debug disable all



2. Detailed Instructions

Command 'nxserver --debug --enable' allows to gather debug logs for all components: nxserver, nxnode, nxwebplayer/client and the display agent. Execute it on the machine where the problem occurs.

This command edits the server.cfg file and sets:
SessionLogLevel 7
WebSessionLogLevel 7

It also edits node.cfg and sets:
SessionLogLevel 7
SessionLogClean 0

NoMachine server and services are not restarted. Old sessions continue to run. The debug settings will apply only to new sessions.

First Step: Enable Debug Level on the Problematic Host
Linux and Mac
sudo /etc/NX/nxserver --debug --enable all

If you are the root user, run the command above without 'sudo'.

Windows

To enable debug on Windows, move to the 'bin' folder under the NoMachine installation and execute:

nxserver --debug --enable all


TIP
Depending on the problem, it could be useful to enable debug for a specific target only. Multiple targets can be specified in a comma-separated list:
nxserver --debug --enable server,node
nxserver --debug --enable webplayer
nxserver --debug --enable agent


Second Step: Connect and Reproduce the Problem

The debug level applies to new sessions only: create a new session and try to reproduce the problem.

TIP
If client side logs are also requested, be sure that the Don't delete log files on exit checkbox is selected in the client user's interface in the Settings -> Privacy panel on the end-user's computer.
In case of web sessions, if browser's side logs are also requested, please follow instructions here: https://www.nomachine.com/DT10O00163


Third Step: Create the Log Archive

Once the problem is reproduced, collect logs and generate the log archive to be sent to the Support Team.

Linux and Mac
sudo /etc/NX/nxserver --debug --collect

If you are the root user, run the command above without 'sudo'.

The log archive is named as: NoMachine-log-<timestamp>.zip (e.g. NoMachine-log-2018.09.27-11.44.01.zip) and stored in: /usr/NX/var/log/archives or /Library/Application Support/NoMachine/var/log/archives on Linux and Mac respectively.



Windows

If you are on Windows, move to the 'bin' folder under the NoMachine installation and execute:

nxserver --debug --collect

The log archive is is named as: NoMachine-log-<timestamp>.zip (e.g. NoMachine-log-2018.09.27-11.44.01.zip) and stored in: %PROGRAMDATA%/NoMachine/var/log/archives on Windows 10, 8.x, 7 and Vista or in Documents and Settings/All Users/NoMachine/var/log/archives Windows XP.





Fourth Step: Collect Client Side Logs (if requested)

On the user's computer, create a compressed archive of the .nx directory in the user's home.

Linux
sudo tar -cvp --exclude 'cache*' --exclude 'images' --exclude 'temp' -f - path_to_user_home/.nx | gzip -c nxdir.tar.gz

If you are the owner of the user's home, execute command above without 'sudo'.

TIPS
I If UserNXDirectoryPath is set in node.cfg, the .nx directory is created under a directory named as username in the path specified by such key.

Use this path in command above to create the log archive.

II When the users' home directories are NFS mounted and the squash_root option is set in NFS, add the "-u $user" to command:
sudo -u USERNAME tar -cvp --exclude 'cache*' --exclude 'images' --exclude 'temp' -f - path_to_user_home/.nx | gzip -c nxdir.tar.gz


Mac

On Mac, navigate with the Finder till the .nx directory. To reduce the size of the archive, remove cache, images and recording sub-directories under .nx before creating the compressed folder.

Compress this folder: control-click or right-click the folder and then choose 'Create Archive' from the pop-up menu.


Windows

On Windows the .nx folder is hidden. To find it, write the following in the address bar or the file browser:

%USERPROFILE%\.nx

Otherwise navigate through the computer folder till the user's home and digit .nx in the navigation toolbar to reach it. Path can be similar to: C:/Users/nomachine/.nx

To reduce the size of the archive, remove cache, images and recording sub-directories under .nx before creating the compressed folder.



Fifth Step: Send Logs to Support Team

Send via e-mail to the Support Team (as e-mail attachment):
a) the NoMachine-log archive from the server side
b) the compressed .nx directory from the user's home on his/her computer (if requested)

Please be sure to include ID of the enquiry in the subject of your e-mail to Support Team!



Sixth Step: Restore Informational Level (Disable Debug Level)

Once logs have been retrieved, it's advisable to restore the Informational Log level to reduce the size of logs that will be printed.

Linux and Mac
sudo /etc/NX/nxserver --debug --disable all


Windows

If you are on Windows, move to the 'bin' folder under the NoMachine installation and execute:

nxserver --debug --disable all


3. Collect Specific Logs

The 'nxserver --debug --collect' procedure allows also to run custom scripts for including the output of specific command (e.g. run nxserver --list, --history, --nodelist etc ...).

Place the custom debug script in the NoMachine installation dir/scripts/log/ directory and follow the same procedure described in the paragraph above.

The 'nxserver --debug --collect' procedure will set correct permissions to the custom script and execute it before collecting logs as usual.