NXShell Reference
This page provides a reference for NXShell command-line options, Java properties, and API classes.
For installation, usage examples, and practical scripts, see NXShell.
Command-Line Options
| Option | Description |
|---|---|
|
NetXMS server address (can be in host:port form) |
|
Login username. Default: |
|
User password. Default: empty. |
|
TCP port for connection. Default: |
|
Additional Java class path. |
|
Show additional debug output. |
|
Do not synchronize objects on connect. |
|
Login using authentication token. |
|
File with additional Java properties. |
|
Display version information. |
|
Specify JRE location. |
|
Display help message. |
Java Properties
| Property | Default |
|---|---|
|
|
|
|
|
|
|
(empty) |
|
(none) — when set, token authentication is used and no login/password prompt appears |
|
|
|
|
|
(auto) — force interactive mode |
Additional properties can be loaded from a file named by the nxshell.properties system property.
Running NXShell
NXShell can be run as an installed binary or as a standalone JAR file.
Start an interactive session:
nxshell -H server_address -u admin -P password
Run a script file:
nxshell -H server_address -u admin -P password script.py
Using the JAR file directly:
java -jar nxshell-VERSION.jar
When started, NXShell reads server address, login, and password from Java properties. In interactive mode, the user is prompted for missing details.
java -Dnetxms.server=127.0.0.1 -Dnetxms.login=admin -jar nxshell-VERSION.jar
Passing passwords on the command line exposes them in shell history and process listings. For non-interactive use (scripts), prefer token authentication (-t option). For interactive use, omit -P to be prompted for the password securely.
|
Session API
NXShell provides access to the NetXMS session object, pre-initialized when the shell starts and bound as both session and the short alias s.
Commonly used org.netxms.base, org.netxms.client, and org.netxms.client.* subpackages (objects, datacollection, events, constants, users, topology, maps, and others) are wildcard-imported at startup, so class names like NXCObjectModificationData resolve without explicit imports.
NXShell embeds Jython 2.7 (Python 2 syntax), and __name__ is set to __nxshell__ — if __name__ == "__main__": guards will not fire in nxshell scripts.
Object Methods
| Method | Description |
|---|---|
|
Find object by name |
|
Find object by numeric ID |
|
Get all objects |
|
Create a new object |
|
Modify object properties |
|
Delete an object |
Data Collection Methods
| Method | Description |
|---|---|
|
Open the DCI configuration for a node |
|
Get last DCI values for a node |
|
Get historical DCI data as a |
Alarm Methods
| Method | Description |
|---|---|
|
Get all active alarms |
|
Acknowledge an alarm |
|
Resolve an alarm |
|
Terminate an alarm |