Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
2  
What do you mean by "connected through browser"? HTTP is a stateless protocol, so to know how many users are connected is server application thing? To list users logged in, use users or who. –  peterph Jan 7 '13 at 11:13
    
Ok We have oracle Application installed on our server. So is it possible to check how many sessions are running and will it be possible to check for http also? –  OmiPenguin Jan 7 '13 at 12:15
    
no unless the application reports the statistics somewhere you can access them (or you would have to analyze the packets belonging to the application and deduct from those). Check the application's documentation on how to get that information. –  peterph Jan 7 '13 at 13:27
add comment

2 Answers 2

up vote 1 down vote accepted

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
share|improve this answer
add comment

The command who tells you which users are logged in on which terminals. Read man who for more details about logged-in users.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.