NSA
NSA sees all, because NSA is the Networked Status Aggregator.
The idea is simple: NSA sends hartbeat messages over network sockets (currently only UDP) and the nsa-server displays running services on a web interface (and, in the future, does other stuff with them).
NSA is as simple as possible: Clients just send heartbeats and the NSA Server displays new clients on the go.
NSA Client
Install
npm install nsa
Usage
var nsa = ;var agency =server: "udp6://[::1]:30826" // nsa serverservice: "example" // service name; default: filename of main modulenode: "example" // name of the node; default: hostnameinterval: "10s" // interval between heartbeatssecret: "verysecurestring" // secret shared with nsa-server;/* send a single heartbeat */agency;/* start sending heartbeats every $interval */agencystart;// stop sending heartbeatsagency;// tell the nsa server to stop caring about this serviceagency;// send dataagencydatadata:"json";// send structured dataagencydataid: "1" // id for data set (required)value: 1 // value or values (required)label: "foo" // display label (optinal)vis: "bar" // visualisation (optional): text, bar, chart, ring, icon, badgecolor: "#f00" // color (depending on visualisation)unit: "%" // unit (depending on visualisation)range: 0100 // value range (depending on visualisation)collect: 100 // number of previous values to collect (depending on visualisation)...;// set alert levelagency;
Message Format
var message =0 // message format version0 // message type (0=heartbeat,1=retire,2=data,3=alert, ...)0 // sequence number of message"example.service" // name of the service"example.host" // name of the node10000 // number of microseconds till next messagedata // data (optional);
Message Types
0
- Heartbeat Ping1
- Retire2
- Unstructured Data (Data Object in Data Field)3
- Alert (Level 0-5 in Data Field)4
- Authenticate ([hash,salt]) in Data Field5
- Structured Data (Array of Data Objects in Data Field)6
- Authentication Requst (Sent by Server, Challenge in Data Field)