Using the N|Solid CLI
The N|Solid Runtime ships with nsolid-cli, a command-line tool that talks to the N|Solid Console's API. Use it to script and automate tasks you would otherwise perform in the N|Solid Console, such as listing processes, collecting CPU profiles and heap snapshots, and exporting settings.
To use nsolid-cli with N|Solid SaaS, contact NodeSource support to enable this feature and get a secure access token for your Console's API endpoint.
Options
nsolid-cli mirrors the Console's API schema: when it starts, it downloads the schema from the Console and maps each command to an API endpoint. This page documents the most common commands. For commands not documented here, see your Console's API documentation at http://localhost:6753/api/v4/api-docs (replace localhost:6753 with your Console's address).
To see the built-in help, use the -h option:
nsolid-cli -h
Unless otherwise noted, nsolid-cli outputs line-delimited JSON (each object is followed by a newline, \n). The examples on this page are expanded for readability.
Global options
| Option | Description |
|---|---|
--remote=ADDRESS | Address of the N|Solid Console API. Defaults to http://localhost:6753/api/. If you leave them out, http:// and the /api/ path are added automatically. |
--auth=TOKEN | Access token for a Console with authentication enabled. Sent as an Authorization: Bearer header. See Authentication. |
--timeout=TIMEOUT | How long to wait for a response. The value is passed to the HTTP client as milliseconds. |
--id=ID | The agent ID (or, for asset commands, the asset ID) to run the command on. |
--threadId=THREADID | The worker thread to target. Defaults to the main thread (0). |
--delete | Use the HTTP DELETE method, for example to delete an asset. |
--body=BODY | Send BODY with a PUT or POST command. |
--attach=FILE | Like --body, but reads the content from a file. Used by import-settings. |
-s, --stdin | Send standard input as the body of a PUT or POST command. Overrides --body. |
-v, --version | Print the version of nsolid-cli. |
-h, --help | Print the help text. |
Each command also accepts the options listed in its section below.
Configuration file
You can store any option in a .nsolid-clirc file in INI format in your home directory (~/.nsolid-clirc, or %USERPROFILE%\.nsolid-clirc on Windows). Values in the file take precedence over the same options on the command line.
remote = https://console.example.com
auth = <your-admin-token>
Authentication
If your Console has authentication enabled, configure an administrative access token so nsolid-cli can access it. Set the token to a secure value with the NSOLID_CONSOLE_AUTH_ADMIN_TOKEN environment variable, or with adminToken in the [auth] section of the Console configuration file. Then pass the same value to nsolid-cli with the --auth option.
nsolid-cli --remote=https://<your-console-host> --auth="<your-admin-token>" summary
Date and time values
For commands that take --start and --end options, you can use these formats:
| Format | Description |
|---|---|
| milliseconds since epoch | The value returned by Date.now() |
| yyyy-mm-ddThh:mm:ss | ISO date |
| -Ns | N seconds ago |
| -Nm | N minutes ago |
| -Nh | N hours ago |
| -Nd | N days ago |
| 0 | Now, when used with --end |
Query filters
Some commands take a --q option followed by a query filter expression. Only results that match all filter terms are returned.
A filter term is a string with no spaces between its parts:
field+operator+value
The field can be any field from info or metrics, or vulns, vuln, or package. See the output of those commands for the available fields.
The operators for each field type are described below.
The value can be a single value or a list of values separated by ,. The term is true if the field and operator match any of the values. You can escape any character by preceding it with %. In practice, only %, space, and , need escaping.
A query filter expression is a list of filter terms separated by spaces.
This example passes the list command a query filter expression with two terms:
nsolid-cli list --q "vulns>=2 package=express"
String operators
| Operator | Description |
|---|---|
= | True if the field value is equal to any value in the expression |
!= | True if the field value is not equal to any value in the expression |
~ | True if the field value wildcard-matches any value in the expression |
!~ | True if the field value does not wildcard-match any value in the expression |
You can specify multiple string values in the expression, separated by commas.
Number operators
| Operator | Description |
|---|---|
< | True if the field value is less than the value in the expression |
<= | True if the field value is less than or equal to the value in the expression |
> | True if the field value is greater than the value in the expression |
>= | True if the field value is greater than or equal to the value in the expression |
Package operators
| Operator | Description |
|---|---|
= | True if the field value equals the value in the expression |
!= | True if the field value does not equal the value in the expression |
< | True if the field value is less than the value in the expression |
<= | True if the field value is less than or equal to the value in the expression |
> | True if the field value is greater than the value in the expression |
>= | True if the field value is greater than or equal to the value in the expression |
A value for package fields is either a package name or {package name}@{simple-semver-range}, where a simple semver range is one of:
Semver ranges
| Type | Examples |
|---|---|
| X-ranges | 1.2.3, 1.2, 1.2.x, 1.x, 1.2.*, etc. |
| Tilde ranges | ~1.2.3, ~1.2, etc. |
| Caret ranges | ^1.2.3, ^1.2, etc. |
The < and > operators do a semver range check comparing the versions.
asset
Downloads an asset.
| Option | Description |
|---|---|
--id | The asset ID (required) |
--delete | Delete the asset instead of downloading it. The asset is removed in the Console's next cleanup phase. |
Usage
nsolid-cli asset --id 217040c0-02d1-4956-8648-7fb84b78c65e > my.heapsnapshot
nsolid-cli asset --delete --id 217040c0-02d1-4956-8648-7fb84b78c65e
Asset IDs are available from the assets command. The asset file is written to stdout. nsolid-cli decompresses the asset automatically if it's compressed.
assets
Lists the assets (CPU profiles, heap profiles, heap samples, and heap snapshots) that are available for download.
| Option | Description |
|---|---|
--id | The agent ID or agent ID prefix |
--app | The NSOLID_APP value |
--hostname | The host the process is running on |
--tags | An NSOLID_TAGS value |
--type | One of profile, snapshot, snapshot-summary, heap-profile, or heap-sample, to limit the type of asset returned |
--start | Return assets created after the specified time |
--end | Return assets created before the specified time |
--starred | Return only assets that have been starred |
--visualization | Filter CPU profiles by default visualization type: flamegraph, sunburst, or treemap |
Usage
nsolid-cli assets --app my-app-name --type snapshot
Returns a JSON stream including the following properties:
| Property | Description |
|---|---|
threadId | The integer ID of the thread. 0 is the main thread. |
time | The timestamp of asset completion |
asset | An asset ID to use with the asset command |
type | profile, snapshot, snapshot-summary, heap-profile, or heap-sample |
id | The agent ID |
reason | How the asset was triggered, for example User for a manual collection |
app | The NSOLID_APP value |
hostname | The host the process is running on |
tags | The NSOLID_TAGS values |
duration | The duration of the profile contents, in milliseconds |
size | The size of the asset, in bytes |
compressed | Whether the asset is served gzip-compressed |
deleteSoon | Whether the asset is scheduled to be deleted soon by automated housekeeping |
pid | The operating system process ID |
title | The process title |
info | The process info |
metrics | The process metrics nearest the time of collection |
visualization | The type of visualization, for example flamegraph |
sourceMap | Whether there is a source map for this profile |
starred | Whether the asset is starred |
Example JSON result
{
"threadId": 0,
"time": "2024-05-29T16:37:19.378Z",
"asset": "abdbde9c-bcf8-4e62-98cb-b81a076bd5ec",
"type": "profile",
"id": "e722dbdab1744400e7acfeafba9e86001b9da5b6",
"reason": "User",
"app": "webserver",
"hostname": "my-host",
"tags": [],
"duration": 5029,
"size": 0,
"compressed": true,
"deleteSoon": 0,
"pid": 5296,
"title": "nsolid",
"info": { ... },
"metrics": { ... },
"visualization": "flamegraph",
"sourceMap": false,
"starred": false
}
assets-in-progress
Lists the assets that are still being generated.
Usage
nsolid-cli assets-in-progress
Example JSON result
{
"assetsInProgress": [ "abdbde9c-bcf8-4e62-98cb-b81a076bd5ec" ],
"snapdiffInProgress": []
}
When an asset ID no longer appears in assetsInProgress, the asset is ready to download with the asset command.
custom
Invokes a custom command. For more information on custom commands, see the how-to guide.
Custom commands only work with processes connected over ZeroMQ (NSOLID_COMMAND). They aren't available for processes connected with NSOLID_GRPC or NSOLID_SAAS.
| Option | Description |
|---|---|
--id | The agent ID or ID prefix (required) |
--name | The name of the custom command (required) |
--data | Data to send with the command |
Usage
# calls the nsolid.on('verbose', fn) handler in your application, if present
nsolid-cli custom --id=<agent-id> --name=verbose --data=off
Returns a JSON object with the following properties:
| Property | Description |
|---|---|
result | The result of the custom command: the value your handler passed to request.return() (or request.throw()) |
time | The timestamp recorded for the event |
id | The agent ID |
app | The NSOLID_APP value |
hostname | The host the process is running on |
tags | The NSOLID_TAGS values |
Example JSON result
{
"result": {
"ok": true
},
"id": "5bc4a84c62710b007f4ed6f96d00570079c60920",
"app": "example",
"hostname": "my-host",
"tags": [],
"time": 1717010944178
}
events
Subscribes to the event stream, which emits a wide range of event types and metadata.
Usage
nsolid-cli events
There are many types of events, and more are added over time. Some of the primary types are:
| Event type | Description |
|---|---|
license-updated | The license data was changed or verified with the license server |
field-range-changed | The range or option set for a field expanded or contracted |
agent-packages-added | An agent's package list was added or updated |
agent-found | A new agent connected to the Console |
agent-exit | An agent terminated |
Example JSON result
{"time":"2024-05-29T19:41:12.389Z","event":"field-range-changed","args":{"domain":"metrics","name":"cpuPercent","range":[0,110]}}
{"time":"2024-05-29T19:41:12.389Z","event":"field-range-changed","args":{"domain":"metrics","name":"heapTotal","range":[0,1300000000]}}
{"time":"2024-05-29T19:41:12.389Z","event":"field-range-changed","args":{"domain":"metrics","name":"loopEstimatedLag","range":[0,4000]}}
events-historic
Retrieves the events from a time range in the past.
| Option | Description |
|---|---|
--id | An agent ID |
--app | The NSOLID_APP value |
--hostname | The host the process is running on |
--type | An event type to include |
--start | Return events that occurred after the specified time |
--end | Return events that occurred before the specified time |
--page | A page number (events are paginated if you provide this option) |
--showLimit | The number of records per page |
--orderBy | A field to order the events by (such as agentId or hostname) |
--order | The sort order: asc or desc |
Usage
nsolid-cli events-historic --start="-2h" --end="-1h"
generate-keypair
Returns a randomly generated key pair for the N|Solid Console's ZeroMQ socket configuration. If your N|Solid Console runs on an untrusted network, generate and use new keys.
Usage
nsolid-cli generate-keypair
Returns a JSON object with the following properties:
| Property | Description |
|---|---|
public | Public key value. publicKey in the N|Solid Console configuration, and the NSOLID_PUBKEY environment variable for the N|Solid Runtime |
private | Private key value. privateKey in the N|Solid Console configuration |
Example JSON result
{
"public": "[t&m}{EZH7=HR(IW:+Ttk:=r.Y$:CP+-Q&5L?2N!",
"private": "4QZof={^Pman?I?mB0o!]%z/{Jlu6:mJfl[Ms@[^"
}
heap-sampling
Collects a sampling heap profile of the specified process.
| Option | Description |
|---|---|
--id | The agent ID (required) |
--duration | Duration of the sampling, in seconds. Default is 5 seconds. |
--sampleInterval | Sampling interval, in bytes. Default is 524288 (512 KB). |
--stackDepth | Maximum stack depth to record for each sampled allocation. Default is 16. |
--threadId | The worker thread to sample. Default is the main thread (0). |
Usage
nsolid-cli heap-sampling --id=<agent-id> --duration=30
When the sampling finishes, the command returns a JSON object whose asset property is the asset ID. Download the file with nsolid-cli asset --id=<asset-id> > my.heapprofile.
info
Returns objects with static information about processes and the hosts they run on.
| Option | Description |
|---|---|
--id | The full or partial agent ID |
--q | A query filter expression (see Query filters) |
Usage
nsolid-cli info
Returns a JSON stream including the following properties:
| Property | Description |
|---|---|
time | Time the message was sent (ISO 8601 timestamp) |
id | The agent ID |
app | The NSOLID_APP value or name property from package.json |
appVersion | The version property from package.json |
hostname | The host the process is running on |
tags | The NSOLID_TAGS values |
pid | Operating system process ID |
processStart | The time the process started |
execPath | Path of the executable running the application |
main | The main module used when the application started |
nodeEnv | The NODE_ENV value |
arch | The CPU architecture |
platform | The operating system platform |
kernelVersion | The Linux kernel version encoded as a number (0 on other platforms) |
totalMem | Total memory of the host, in bytes |
cpuCores | The number of CPU cores |
cpuModel | The CPU model |
versions | Object with the versions of the components used in the runtime |
See Metrics in detail for more about each field.
Example JSON result
{
"app": "webserver",
"appVersion": "1.4.0",
"arch": "x64",
"cpuCores": 4,
"cpuModel": "Intel(R) Xeon(R) Platinum 8488C",
"execPath": "/usr/bin/nsolid",
"hostname": "webserver-7d58498dc9-8z6km",
"id": "44c58a6b7c607c00d58fc184f6dab60080d16cd4",
"kernelVersion": 394240,
"main": "/usr/src/app/webserver",
"nodeEnv": "production",
"pid": 7,
"platform": "linux",
"processStart": 1716993070545,
"tags": [],
"totalMem": 16467304448,
"versions": { ... },
"time": "2024-05-29T14:31:10.545Z"
}
list
Returns all matching N|Solid processes, with their most recent info and metrics data. ls is an alias for this command.
| Option | Description |
|---|---|
--q | A query filter expression (see Query filters) |
Usage
nsolid-cli list --q id=5dd6
Returns newline-delimited JSON objects. Each row includes the following properties:
| Property | Description |
|---|---|
time | The timestamp of the last metrics payload |
info | The object returned by the info command |
metrics | The object returned by the metrics command |
Example JSON result
{
"time": "2024-05-29T19:46:46.103Z",
"info": {
"time": "2024-05-29T19:46:46.103Z",
"id": "44c58a6b7c607c00d58fc184f6dab60080d16cd4",
"app": "webserver",
"hostname": "webserver-7d58498dc9-8z6km",
"tags": [],
"appVersion": "1.4.0",
"arch": "x64",
"cpuCores": 4,
"cpuModel": "Intel(R) Xeon(R) Platinum 8488C",
"execPath": "/usr/bin/nsolid",
"main": "/usr/src/app/webserver",
"nodeEnv": "production",
"pid": 7,
"platform": "linux",
"processStart": 1716993070545,
"totalMem": 16467304448,
"versions": { ... }
},
"metrics": { ... }
}
metrics
Subscribes to the metrics of a set of agents.
| Option | Description |
|---|---|
--field | A field to include in the output. If not specified, all fields are returned. nsolid-cli sends only one --field value correctly; to select several fields, call the Console API directly with repeated field= query parameters. |
--interval | How often to return metrics data, in seconds by default. You can add a unit suffix: ms, s, m, h, d, or w. |
--q | A query filter expression (see Query filters) |
Usage
nsolid-cli metrics
See Metrics in detail for a description of every metric.
Example JSON result
{"time":"2024-05-29T19:48:37.249Z","id":"44c58a6b7c607c00d58fc184f6dab60080d16cd4","app":"webserver","hostname":"webserver-7d58498dc9-8z6km","tags":[],"activeHandles":8,"activeRequests":0,"blockInputOpCount":18344,"blockOutputOpCount":86448,"cpu":1.0176217699999999,"cpuPercent":101.762177,"cpuSystemPercent":2.803665,"cpuUserPercent":98.958512,"ctxSwitchInvoluntaryCount":390983,"ctxSwitchVoluntaryCount":4070346,"delay":8768639.573029,"dns99Ptile":0,"dnsCount":496,"dnsMedian":0,"eventsProcessed":7202045,"eventsWaiting":7184302,"externalMem":67914068,"freeMem":9133502464,"fsHandlesClosedCount":6,"fsHandlesOpenedCount":6,"gcCount":381851,"gcDurUs99Ptile":13605,"gcDurUsMedian":1485,"gcForcedCount":0,"gcFullCount":0,"gcMajorCount":3030,"heapSizeLimit":2197815296,"heapTotal":1149370368,"heapUsed":1102212104,"httpClient99Ptile":0,"httpClientAbortCount":0,"httpClientCount":3045,"httpClientMedian":0,"httpConnections":5,"httpServer99Ptile":0,"httpServerAbortCount":1,"httpServerCount":43,"httpServerMedian":0,"ipcReceivedCount":0,"ipcSentCount":0,"load15m":1.31,"load1m":0.83,"load5m":1.27,"loopAvgTasks":0,"loopEstimatedLag":6842.682142,"loopIdlePercent":0,"loopIdleTime":9693339671845,"loopIterWithEvents":7180420,"loopIterations":7254748,"loopTotalCount":7254748,"loopUtilization":1,"mallocedMemory":1081456,"numberOfDetachedContexts":0,"numberOfNativeContexts":1,"pageFaultHardCount":8,"pageFaultSoftCount":124529579,"peakMallocedMemory":37345928,"pipeServerCreatedCount":0,"pipeServerDestroyedCount":0,"pipeSocketCreatedCount":2,"pipeSocketDestroyedCount":0,"processingDelay":22285260577,"promiseCreatedCount":0,"promiseResolvedCount":0,"providerDelay":8746354312452,"res15m":0.712438,"res1m":0.746145,"res5m":0.720961,"res5s":1.022003,"rss":1424875520,"signalCount":0,"swapCount":0,"systemUptime":8234722,"tcpServerCreatedCount":1,"tcpServerDestroyedCount":0,"tcpSocketCreatedCount":499,"tcpSocketDestroyedCount":494,"threadId":0,"threadName":"","threads":[1,2,0],"threadsName":{"0":"","1":"","2":""},"timestamp":1717012116412,"title":"webserver","totalAvailableSize":1076845368,"totalHeapSizeExecutable":4612096,"totalPhysicalSize":1149161472,"udpSocketCreatedCount":0,"udpSocketDestroyedCount":0,"uptime":19045,"user":"ns","vulns":17}
metrics-historic
Retrieves metrics records over a past time range. Records match the metrics command output.
| Option | Description |
|---|---|
--field | A field to include in the output. If not specified, all fields are returned. nsolid-cli sends only one --field value correctly; to select several fields, call the Console API directly with repeated field= query parameters. |
--q | A query filter expression (see Query filters) |
--start | The start of the time range |
--end | The end of the time range |
--series | The aggregation level of the data: raw, 1m, or 1h. Defaults to raw. |
--threadsList | Comma-separated list of thread IDs to include. Defaults to the main thread (0). |
Usage
nsolid-cli metrics-historic --start="-2m" --end="-1m"
packages
Returns the packages and modules available in the specified process.
| Option | Description |
|---|---|
--id | The full agent ID or prefix (required) |
--mode | flat for a simple list of packages, or tree for the dependency hierarchy |
--filterTypes | Comma-separated dependency types to include: prod, dev, peer, or optional |
--moduleName | Show only the package with this name, for example express |
--page | A page number, to paginate the results |
--showLimit | The number of records per page |
Usage
nsolid-cli packages --id=<agent-id>
Returns a JSON object with the following properties:
| Property | Description |
|---|---|
id | The agent ID |
time | The timestamp of the message |
app | The NSOLID_APP value |
packages | An array of package objects with details about each package and its dependencies |
vulnerabilities | An object with vulnerability details |
profile
Generates a V8 CPU profile of the specified process and writes it to stdout when it's done.
| Option | Description |
|---|---|
--id | The agent ID (required) |
--duration | Duration of the profile, in seconds. Default is 5 seconds. |
--threadId | The worker thread to profile. Default is the main thread (0). |
Usage
nsolid-cli profile --id=<agent-id> --duration=10 > my.cpuprofile
After the profile file is created, you can open it in the Chrome DevTools Performance panel.
To load the file, Chrome requires the .cpuprofile file extension.
reconfigure
Reads or changes the dynamic configuration of running processes (N|Solid 4.7.0 and later).
To read a process's current configuration, pass its agent ID:
| Option | Description |
|---|---|
--id | The agent ID, or an application name (required) |
nsolid-cli reconfigure --id=<agent-id>
To change the configuration, pass a JSON object of settings with --body and select the processes with --q. Supported settings include interval, blockedLoopThreshold, pauseMetrics, promiseTracking, tracingEnabled, tracingModulesBlacklist, assetsEnabled, contCpuProfile, redactSnapshots, tags, statsd, statsdBucket, and statsdTags. contCpuProfile applies only to processes connected over gRPC (NSOLID_GRPC or NSOLID_SAAS). tracingModulesBlacklist takes the numeric bitmask (1 = dns, 12 = http), not module names.
nsolid-cli reconfigure --q "id=<agent-id>" --body '{"tracingEnabled": true}'
When you change the configuration, the --q expression selects the processes to reconfigure. Without --q, the change applies to every connected process.
snapshot
Generates a V8 heap snapshot of the specified process and writes it to stdout when it's done.
| Option | Description |
|---|---|
--id | The agent ID (required) |
--threadId | The worker thread to snapshot. Default is the main thread (0). |
Usage
nsolid-cli snapshot --id=<agent-id> > my.heapsnapshot
After the snapshot file is created, you can open it in the Memory panel of Chrome DevTools.
To load the file, Chrome requires the .heapsnapshot file extension.
startup-times
Lists the time the process took to reach each startup phase, from initial process execution.
| Option | Description |
|---|---|
--id | The full agent ID or prefix (required) |
Usage
nsolid-cli startup-times --id=<agent-id>
Returns a JSON object with the recorded startup times. See nsolid.startupTimes() in the JS API for the meaning of each phase and how to add your own.
Example JSON result
{
"bootstrap_complete": [0, 16133046],
"initialized_node": [0, 348150],
"initialized_v8": [0, 2948542],
"loaded_environment": [0, 7952192],
"loop_start": [0, 28983685],
"timeOrigin": [0, 0],
"id": "01476b6496aa530063f92c5e4c5da800cf5685ae",
"time": "2024-05-29T19:59:29.974Z",
"tags": [],
"app": "example",
"hostname": "my-host"
}
track-heap-objects
Collects a heap profile of the specified process, optionally with allocation stack traces.
| Option | Description |
|---|---|
--id | The agent ID (required) |
--duration | Duration of the profile, in seconds. Default is 5 seconds. |
--trackAllocations | true to include allocation stack traces. Default is false. |
--threadId | The worker thread to profile. Default is the main thread (0). |
Usage
nsolid-cli track-heap-objects --id=<agent-id> --duration=30 --trackAllocations=true
When the profile finishes, the command returns a JSON object whose asset property is the asset ID. Download the file with nsolid-cli asset --id=<asset-id> > my.heapprofile.
vulnerabilities
Returns known security vulnerabilities for all processes.
| Option | Description |
|---|---|
--id | An agent ID |
--app | The NSOLID_APP value |
--hostname | The host the process is running on |
--tags | An NSOLID_TAGS value |
--type | One or more vulnerability IDs to include, separated by | (for example GHSA-36jr-mh4h-2g58) |
--page | A page number, to paginate the results |
--showLimit | The number of records per page |
Usage
nsolid-cli vulnerabilities
Returns a JSON object with all currently known vulnerabilities.
| Property | Description |
|---|---|
time | Message timestamp |
lastUpdated | When the vulnerability data was last updated |
vulnerabilities | An array of vulnerability objects |
vulnerabilityCount | The number of unique vulnerabilities found in the matching processes, before filtering and pagination |
pagination | page, showLimit, totalCount, totalPages, hasNextPage, and hasPrevPage |
Example JSON result
{
"time": "2024-05-29T20:02:39.924Z",
"lastUpdated": "2024-05-29T19:35:21.257Z",
"vulnerabilities": [
{
"report": {
"package": "d3-color",
"title": "d3-color vulnerable to ReDoS",
"published": "2022-09-29T14:12:55Z",
"credit": [
"UNSPECIFIED"
],
"id": "GHSA-36jr-mh4h-2g58",
"ids": {...},
"vulnerable": "< 3.1.0",
"severity": "high",
"description": "The d3-color module provides ...",
"nsolidMetaData": {
"hidden": false
}
},
"processes": [
{
"id": "24472c3ed21920005805bbd0770890003655b818",
"app": "dashboard",
"tags": [],
"hostname": "dashboard-55964b5d4-855qv",
"topLevel": 1,
"depChains": [
[
"d3-color@2.0.0"
]
]
},
{ ... }
],
"processCount": 5
}
],
"vulnerabilityCount": 1
}
query
Subscribes to matching agent data on an interval.
| Option | Description |
|---|---|
--field | A field to request. If not specified, all fields are returned. nsolid-cli sends only one --field value correctly; to select several fields, call the Console API directly with repeated field= query parameters. |
--interval | How often to return the next object, in seconds by default (default: 1). You can add a unit suffix: ms, s, m, h, d, or w. |
--q | A query filter expression (see Query filters) |
Usage
nsolid-cli query --q id=5
Returns newline-delimited JSON objects with framing objects.
| Framing type | Description |
|---|---|
start | The query stream start frame |
interval-start | The start of the records for this interval |
agent-enter | An agent entry |
summary | Summary data about the entire (unfiltered) data set |
interval-end | The last record for this interval frame |
Example JSON result
{"time":"2024-05-29T20:08:19.064Z","type":"start"}
{"time":"2024-05-29T20:08:19.065Z","type":"interval-start"}
{"time":"2024-05-29T20:08:19.065Z","type":"agent-enter","id":"24472c3ed21920005805bbd0770890003655b818","info":{ ... },"metrics":{ ... }}
{"time":"2024-05-29T20:08:19.065Z","type":"summary","matchingAgents":1,"totalAgents":1}
{"time":"2024-05-29T20:08:19.065Z","type":"interval-end"}
{"time":"2024-05-29T20:08:20.066Z","type":"interval-start"}
{"time":"2024-05-29T20:08:20.066Z","type":"metrics","id":"24472c3ed21920005805bbd0770890003655b818","metrics":{ ... }}
{"time":"2024-05-29T20:08:20.066Z","type":"summary","matchingAgents":1,"totalAgents":1}
{"time":"2024-05-29T20:08:20.066Z","type":"interval-end"}
summary
Returns a summary of all connected N|Solid processes, with counts of matching properties and resources.
| Option | Description |
|---|---|
--q | A query filter expression (see Query filters) |
Usage
nsolid-cli summary
Example JSON result
{
"time": "2024-05-29T20:12:19.555Z",
"processes": 8,
"apps": {
"webserver": 5,
"portal": 2,
"demo": 1
},
"tags": {},
"rss": 2808512512,
"cpu": 196.852483,
"node": {
"24.21.0": 5,
"22.23.3": 3
},
"nsolid": {
"6.3.7": 8
},
"packages": 3945,
"vulnerabilities": {
"GHSA-36jr-mh4h-2g58": 1
},
"hiddenVulnerabilities": {}
}
export-settings
Returns a JSON object with one or more settings, to back up or import later. The settings you can export are integrations, savedViews, and notifications.
| Option | Description |
|---|---|
--item | One item, or a comma-separated list of items, to export (required) |
Usage
nsolid-cli export-settings --item integrations,savedViews,notifications > backup.nsconfig
Example JSON result
{
"_metadata": {
"_timestamp": ""
},
"integrations": {},
"notifications": {},
"savedViews": {}
}
import-settings
Applies previously exported settings. The settings you can import are integrations, savedViews, and notifications.
| Option | Description |
|---|---|
--item | One item, or a comma-separated list of items, to import (required) |
--action | clean to replace the existing settings. If omitted, the imported settings are appended to the existing ones. |
--attach | The file with the exported settings |
Usage
nsolid-cli import-settings --item integrations --action clean --attach backup.nsconfig