how to get the number of users logged in?

divvi_vamsi
Mega Expert

How to get the number of users logged in on each node through script? I know these stats are available in System Diagnostics page, but is there a way to pull that data to a script?

Thanks
Divya Yamani

1 ACCEPTED SOLUTION

Hello Divya,



Thanks for the update. The below blog has detailed info on what you are looking for.


https://servicenowgems.com/2016/04/28/finding-logged-in-users/


View solution in original post

6 REPLIES 6

The above link worked in logging users on different nodes, as the query runs on all the nodes each time and values are captured in log statements



As the above link mentions there is no possible way for different nodes in the same instance to communicate among themselves, so in that case how can we get the total logged in users on all nodes or on the instance as a whole?



I am also looking if these values can be sent to report section?



Thanks
Divya


best thing to do is to create a custom table to store the values using GlideRecord and have each node update the table with its values. This way it's then reportable.