n-brother
v1.0.6
Published
N-Brother is watching your distributed system
Downloads
6
Maintainers
Readme
N-Brother
N-Brother is a tool for monitoring multiple machines from a single client shell. Currently the communication does not have authentication or authorization. The messages are exchanged in plain-text. Running the daemon exposes your file-system for unauthenticated read access and is a security risk.
Getting Started
- Install the N-Brother package from NPM (on all the remote machines and your local machine)
~$ sudo npm install -g n-brother
- Start the N-Brother Daemon on the remote machines that you want to monitor.
~$ nbrod -p 8000
The above command will bind the N-Brother daemon process to port 8000. It starts a WebSocket server that listens for incoming commands.
- Start the N-Brother Shell on your local machine.
~$ nbro
The above command will start the interactive shell. Type "help" in the shell to see the list of available commands.
3.a. From the Shell, you can add a remote machine like below:
$ add daemon1 ws://daemon1.example.com:8000
daemon1
can be any string; this is the name of the remote machine that you give.
daemon1.example.com
should be replaced with either a DNS resolved host name or the remote machine's IP.
3.b. Connect to the machines.
$ connect
The shell will display the list of the machines, indicating whether they are connected or not. You can type show
to see the list of machines.
3.c. Execute a command on the remote machines.
$ grep 123 ~/some-log-file.log
The shell will be 'pending' until all the remote machines return the grep output. Once all responses are received, the shell will display the output.
Commands
Shell commands
show
- Show the list of machines
add {machine_id} {daemon_url}
- Add a machine to the registry
remove {machine_id}
- Remove a machine from the registry
connect
- Connect to the machines
disconnect
- Disconnect from the machines
help
- Show the man page
exit
- Exit the shell
Remote commands
grep {pattern} {file_path}
- execute "grep" command on all the machines and retrieve the output