how to know how many user's connected to ftp and http server | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

how to know how many user's connected to ftp and http server

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-27-2005
hariprasad hariprasad is offline
Registered User
 
Join Date: Apr 2005
Last Activity: 28 April 2005, 1:22 PM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Data how to know how many user's connected to ftp and http server

i need to write a program to know how many users are presently connected to my ftp server and http server .
i need to keep a count of this and this count should be available to other different software . how to make this GLOBAL so that other softwares can access this count value
Sponsored Links
    #2  
Old 04-27-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Registered User
 
Join Date: Apr 2002
Last Activity: 17 October 2014, 8:46 PM EDT
Location: On my motorcycle
Posts: 3,093
Thanks: 1
Thanked 31 Times in 9 Posts
If it's on a UNIX system, try ps -ef |grep ftp or http (options may be different on your OS - try ps -ef). That will give you the number of connections for ftp or http normally

% ps -ef|grep -c ftp

% ps -ef|grep -c http

And please read the Rules. You posted the same question twice.
Sponsored Links
    #3  
Old 04-28-2005
RiMKa RiMKa is offline
Registered User
 
Join Date: Apr 2005
Last Activity: 6 June 2005, 8:55 AM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by RTM
If it's on a UNIX system, try ps -ef |grep ftp or http (options may be different on your OS - try ps -ef). That will give you the number of connections for ftp or http normally

% ps -ef|grep -c ftp

% ps -ef|grep -c http

And please read the Rules. You posted the same question twice.
if we are talking about Apache when the amount of httpd processes doesn't correlate directly to the amount of users connected. For example, the idle apache server has some httpd processes launched already.

Slava R.
    #4  
Old 04-28-2005
hariprasad hariprasad is offline
Registered User
 
Join Date: Apr 2005
Last Activity: 28 April 2005, 1:22 PM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
thanks for the reply , I tried the solution ,but even though there are no users connected to the ftp server it gives a value 2 and on the http server it gives a value 1.
and also i wrote the program using the given solution , i used the system("ps -ef|grep -c ftp > somefile") inside my program ,when i saw the output in the filet it had a value 3 , when no users were connected and if i used the same command on the prompt i get the value 2 how is this possible, please help me

And in the case of HTTP server there is no change like the above if no users are connected it gives the value 1
Sponsored Links
    #5  
Old 04-28-2005
hariprasad hariprasad is offline
Registered User
 
Join Date: Apr 2005
Last Activity: 28 April 2005, 1:22 PM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
thanks for the reply , I tried the solution ,but even though there are no users connected to the ftp server it gives a value 2 and on the http server it gives a value 1.
and also i wrote the program using the given solution , i used the system("ps -ef|grep -c ftp > somefile") inside my program ,when i saw the output in the filet it had a value 3 , when no users were connected and if i used the same command on the prompt i get the value 2 how is this possible, please help me

And in the case of HTTP server there is no change like the above if no users are connected it gives the value 1
Sponsored Links
    #6  
Old 04-28-2005
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
 
Join Date: Mar 2005
Last Activity: 20 September 2013, 10:59 AM EDT
Location: Philadelphia metro
Posts: 958
Thanks: 3
Thanked 67 Times in 60 Posts
try this one to give you actual connections at the time the sample was taken ...

Code:
netstat -a | awk '/EST/ && (/ftp/ || /http/)'

Sponsored Links
    #7  
Old 05-20-2005
Lestat's Avatar
Lestat Lestat is offline
Registered User
 
Join Date: Feb 2005
Last Activity: 22 July 2005, 7:00 PM EDT
Location: Quito - Ecuador
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL Fast Solution

Just try:

nestat -A | grep ftp

and:

grep http

this way u will c only the established connections of each one or combine them with:

nestat -A | awk '/ftp/ || /http/'
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command see all devices connected to Sun server nskumar Solaris 3 05-16-2012 07:02 AM
How do I run HTTP server on port 80 using a non root user? kevintse Linux 14 11-12-2010 11:05 AM
Shell script to display user logged last week and time connected ahernandez Shell Programming and Scripting 4 10-29-2010 02:32 PM
ALOM wont work when KVM connected to Sun Fire V440 server jimmy54321 Solaris 0 10-14-2010 11:04 AM
SAN Connected RedHat Server sallender Red Hat 4 03-13-2008 06:43 AM



All times are GMT -4. The time now is 01:55 PM.