NetXMS icon

NetXMS

Interact with the NetXMS network monitoring and management system

Object → Execute Script

AI-generated

Summary

Executes an NXSL script on a NetXMS server in the context of a given object and returns the server's response.

Inputs

  • Object ID (required) — Numeric ID of the NetXMS object the script runs against; used in the request path /v1/objects/{id}/execute-script.
  • Script (required) — NXSL source code to execute.
  • Additional Fields > Parameters — Comma-separated list of values passed to the script. The node splits on commas, trims whitespace, drops empty entries and sends them as an array.
  • Additional Fields > Return Result as Map — If set (true or false), sent as resultAsMap. When true, the result is always presented as a JSON object map.

Output shape

The JSON response from the NetXMS REST API for the script execution, emitted as one or more n8n items per input item (arrays are split into separate items).

The exact response fields are defined by the NetXMS server and are not shown in the source. The node logs in with the credentials on each run to obtain a session token. With Continue On Fail enabled, errors are returned as an item with an error message.

Examples

Example 1: Run a script on a node to compute a value

Object ID = 123; Script = a return $node->name;-style NXSL snippet; no additional fields.

Example 2: Pass arguments and get a map result

Object ID = 45; Script using $1 and $2; Parameters = "eth0, 10"; Return Result as Map = true.

Links

Discussion