I need to check how many users are connected to server for specific applications through a browser. I'm mainly interested in Oracle. My server runs RHEL.
So is it possible to check how many sessions are running and will it be possible to check for http also?
A web application needs to be configured or programmed to enumerate active sessions, but for a list of users and idle times for SSH sessions...
w | tr -s " " | cut -d " " -f 1,5 | tail -n +3
See the NOTES section in the man page for w. The line above produces something like this:
username1 0.00s username2 48.08s
Or, only idle times:
w | tr -s " " | cut -d " " -f 5 | tail -n +3
Or, just a count of SSH sessions:
w | tr -s " " | cut -d " " -f 5 | tail -n +3 | wc -l