Connection Monitoring with Nodejs

Connection Monitoring with Nodejs


I would like to monitor the active connections connected to my node.js server. I’ve seen NodeFly can do this, but I would like to have a tool locally installed on my server (ubuntu).

Is there any (maybe free) software/app to achieve this?


Problem courtesy of: Christian


I don’t know of anything doing that out of the box, but assuming you have an express app, you could start with:

var exec = require('child_process').exec;


app.get('/status', function (req, res) {
  exec('lsof +p `pgrep node` | grep TCP', function (err, stdout, stderr) {

Solution courtesy of: Laurent Perrin


Leave a Reply

Your email address will not be published. Required fields are marked *