Monitoring http and https ports from the NATS server.
-n num_connections
Limit the connections requested to the server (default: 1024)
-d delay_in_secs
Screen refresh interval (default: 1 second).
-r max
Specify the maximum number of times nats-top should refresh nats-stats before exiting (default: 0 which stands for "no limit").
-o file
Saves the very first nats-top snapshot to the given file and exits. If ‘-‘ is passed then the snapshot is printed to the standard output.
-l delimiter
Specifies the delimiter to use for the output file when the ‘-o’ parameter is used. By default this option is unset which means that standard grid-like plain-text output will be used.
-sort by
Field to use for sorting the connections.
-cert, -key, -cacert
Client certificate, key and RootCA for monitoring via https.
-k
Configure to skip verification of certificate.
-b
Displays traffic in raw bytes.
-v|--version
Displays the version of nats-top.
-u|--display-subscriptions-column
Makes the subscriptions-column immediately visible upon launching nats-top.
Commands
While in top view, it is possible to use the following commands:
o [option]
Set primary sort key to [option]:
Keyname may be one of: {cid, subs, msgs_to, msgs_from, bytes_to, bytes_from, idle, last}
This can be set in the command line too, e.g. nats-top -sort bytes_to
n [limit]
Set sample size of connections to request from the server.
This can be set in the command line as well: nats-top -n 1
Note that if used in conjunction with sort, the server would respect
both options enabling queries like connection with largest number of subscriptions:
nats-top -n 1 -sort subs
nats-top
nats-topis atop-like tool for monitoring NATS servers.Install
Installation from the shell
The following script will install the latest version of the nats cli on Linux and macOS:
Installation via go install
nats-topcan be installed directly viago install. To install the latest version:RPM and Deb packages are also published to GitHub
Usage
-m http_port,-ms https_portMonitoring http and https ports from the NATS server.
-n num_connectionsLimit the connections requested to the server (default:
1024)-d delay_in_secsScreen refresh interval (default: 1 second).
-r maxSpecify the maximum number of times nats-top should refresh nats-stats before exiting (default:
0which stands for"no limit").-o fileSaves the very first nats-top snapshot to the given file and exits. If ‘-‘ is passed then the snapshot is printed to the standard output.
-l delimiterSpecifies the delimiter to use for the output file when the ‘-o’ parameter is used. By default this option is unset which means that standard grid-like plain-text output will be used.
-sort byField to use for sorting the connections.
-cert,-key,-cacertClient certificate, key and RootCA for monitoring via https.
-kConfigure to skip verification of certificate.
-bDisplays traffic in raw bytes.
-v|--versionDisplays the version of nats-top.
-u|--display-subscriptions-columnMakes the subscriptions-column immediately visible upon launching nats-top.
Commands
While in top view, it is possible to use the following commands:
o [option]
Set primary sort key to [option]:
Keyname may be one of: {cid, subs, msgs_to, msgs_from, bytes_to, bytes_from, idle, last}
This can be set in the command line too, e.g.
nats-top -sort bytes_ton [limit]
Set sample size of connections to request from the server.
This can be set in the command line as well:
nats-top -n 1Note that if used in conjunction with sort, the server would respect both options enabling queries like connection with largest number of subscriptions:nats-top -n 1 -sort subss
Toggle displaying connection subscriptions.
d
Toggle activating DNS address lookup for clients.
?
Show help message with options.
q
Quit nats-top.
Demo