N-Brother is watching your distributed system
npm install 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.
1. Install the N-Brother package from NPM (on all the remote machines and your local machine)
```
~$ sudo npm install -g n-brother
2. 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.
3. 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:8000daemon1 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.
``
$ connectshow
The shell will display the list of the machines, indicating whether they are connected or not. You can type 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.
1. showadd {machine_id} {daemon_url}
- Show the list of machines
2. remove {machine_id}
- Add a machine to the registry
3. connect
- Remove a machine from the registry
4. disconnect
- Connect to the machines
5. help
- Disconnect from the machines
6. exit
- Show the man page
7.
- Exit the shell
1. grep {pattern} {file_path}`
- execute "grep" command on all the machines and retrieve the output