The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



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.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bauk HTTP Server 2.0.10 (Stable branch) iBot Software Releases - RSS News 0 06-06-2008 11:10 AM
SAN Connected RedHat Server sallender Red Hat 4 03-13-2008 06:43 AM
HTTP server jaibw Linux 4 11-21-2005 05:37 AM
List of HTTP/FTP-clients on a server indo1144 Security 2 09-28-2005 05:12 AM
VNC Server http listening port kxchen_home Linux 6 02-07-2004 12:23 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-27-2005
hariprasad hariprasad is offline
Registered User
  
 

Join Date: Apr 2005
Posts: 3
Unhappy 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
  #2 (permalink)  
Old 04-27-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
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.
  #3 (permalink)  
Old 04-28-2005
RiMKa RiMKa is offline
Registered User
  
 

Join Date: Apr 2005
Posts: 5
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 (permalink)  
Old 04-28-2005
hariprasad hariprasad is offline
Registered User
  
 

Join Date: Apr 2005
Posts: 3
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
  #5 (permalink)  
Old 04-28-2005
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
try this one to give you actual connections at the time the sample was taken ...
Code:
netstat -a | awk '/EST/ && (/ftp/ || /http/)'
  #6 (permalink)  
Old 05-20-2005
Lestat's Avatar
Lestat Lestat is offline
Registered User
  
 

Join Date: Feb 2005
Location: Quito - Ecuador
Posts: 67
Thumbs up 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/'
  #7 (permalink)  
Old 05-26-2005
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
Quote:
Originally Posted by Lestat
Just try:

nestat -A | grep ftp

nestat -A | awk '/ftp/ || /http/'
... you might want to verify the "-A" option as it seems to be OS-specific ... i don't see that option in solaris or in windows
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0