Find Users Across All Nodes On Clustered Environment

Very quick one…
This only applies to anyone working on a clustered environment using multiple application servers.

Going to the ‘Logged in users’ module only shows users logged into the same node which you are logged into.

So I wrote a quick script which you can use to print out the total number of users logged in across all nodes:

var diag = new Diagnostics();
while (diag.nextNode()) {
  var diagNode = diag.getNode();
  var ss = diagNode.stats.sessionsummary;
  if (ss) {
    gs.print('Server: ' + diagNode.name + ' logged in users: ' + diagNode.stats.sessionsummary["@logged_in"]);
  }
}

2 Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s