remote-proc-watch

command module
v0.0.1-alpha1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: Unlicense Imports: 10 Imported by: 0

README

remote-proc-watch

remote-proc-watch is a simple tool designed to monitor specific processes on one or more remote hosts using ssh and ps. It provides essential information such as PID, process name, CPU usage, and memory usage in both percentage and human-readable formatted bytes.

Installation

CGO_ENABLED=0 go build -o /usr/local/bin/rpw .

Usage

rpw [UPDATE_INTERVAL] [SSH_HOST] [PROCESS1] <PROCESS2> ...
# or
rpw [UPDATE_INTERVAL] [SSH_HOST_1,SSH_HOST_2,...,SSH_HOST_N] [PROCESS1] <PROCESS2> ...
  • The tool relies on your SSH configuration to connect with hosts. Ensure you can connect to the host without user interaction.
  • Processes are matched on word boundaries, allowing for exact matches regardless of their position in the command.

Example

rpw 2s host1,host2 spider ossh
Output (refreshed every 2s)
 17:37:09 [ every 2s ] spider, ossh

 HOST                             PID        CMD                                 CPU                                   MEM                                            
 host1                            802        /etc/ossh/ossh                      ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 0.90%            ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 2.30%           94.10 MiB
 host1                            1081       /usr/local/bin/spider               ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 0.20%            ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 0.30%           14.93 MiB
 host2                            288927     /etc/ossh/ossh                      ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 3.00%            ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 0.40%          147.62 MiB
 host2                            108758     /usr/local/bin/spider               ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 0.70%            ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 0.00%           23.21 MiB
                                             TOTAL                               ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 4.80%            ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫ 3.00%          279.86 MiB

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL