NSA sees all, because NSA is the Networked Status Aggregator.
The idea is simple: The NSA server receives heartbeats over network sockets (currently only udp) and displays running services on a web interface (and, in the future, maybe does other stuff with them).
NSA is as simple as possible: Clients just send heartbeats and nsa displays new clients on the go. Other than deciding on where to listen, no further configuration is required. Maybe some sort of simple authentication will be implemented, but for now it's all just working out of the box.
This is the NSA server, the client is simply called nsa.
npm install -g nsa-server
run bin/nsa-server.js
with these options:
--config ./config.js
Load Config File from$CWD/config.js
--web http://localhost:30826/
HTTP Web Interface onlocalhost
port30826
--web unix:/tmp/nsa.sock?mode=0760
Web Interface socket/tmp/nsa.sock
with mode0760
--listen udp4://localhost:30826
Listen for Messages onlocalhost
port30826
with IPv4--listen udp6://localhost:30826
Listen for Messages onlocalhost
port30826
with IPv6--webhook https://hooks.slack.com/services/...
Send messages via this Webhook
You can use --listen
and --webhook
more than once.
30826
is the default port, because parseInt("nsa",36);
.
See also: config.js.dist;
You can use the nsa module to send packets or implement it yourself.
In case you want to expand it for your own purposes.
var message = [
0, // message format version
0, // message type (0=heartbeat,1=retire,2=data)
0, // sequence number of message
"example", // name of the service
"example.host", // name of the node
10000, // number of microseconds till next message
{data:"json"} // data (only when message type = 2)
];