LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-16-2009, 12:57 AM   #1
landysaccount
Member
 
Registered: Sep 2008
Location: Dominican Republic
Distribution: Debian
Posts: 188

Rep: Reputation: 18
How to get connected clients?


Hello.

I have a router with debian etch with dhcp server offering ips to the LAN. Also, I am doing transparent proxy with squid. I would like to know when a client is online or connected browsing the internet? I would like to generate a page with php that will list the users online along with names, ip, and mac (just like wireless routers).

I tried doing 'netstat -na | grep ESTABLISHED' but that only gives those users currently browsing doesn't show those idling.

Any ideas?

Thanks in advanced for your help.
 
Old 03-16-2009, 05:53 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Well once a page has loaded, the TCP connection will close, so there is no connection to inspect at that level. You could check out the cache logs using a tool like squidalzyer or sarg, that's probably a better angle, and I wouldn't pay any attention to mac stuff, far too low level to be relevant to web browsing.
 
Old 03-16-2009, 08:28 PM   #3
landysaccount
Member
 
Registered: Sep 2008
Location: Dominican Republic
Distribution: Debian
Posts: 188

Original Poster
Rep: Reputation: 18
Thank you Chris for replying.

I really wouldn't like to depend on squid to find out who's online but, if that's the easiest and convenient way I guess I should just go that route.

Does anyone have any other idea?
 
Old 03-17-2009, 05:02 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
if you are using a squid proxy to handle web requests how could that not be the ideal point to track usage? What does that not provide you?
 
Old 03-17-2009, 10:08 PM   #5
landysaccount
Member
 
Registered: Sep 2008
Location: Dominican Republic
Distribution: Debian
Posts: 188

Original Poster
Rep: Reputation: 18
Just thought I didn't want to rely on squid or any other third party software. Want to actually implement it myself but, don't know where to start.
 
Old 03-18-2009, 04:21 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Well there are products like ntop which collect statistical data from direct data flows which would probably show some of what you want, but you're never going to get data like users, which would only exist at a higher http level - your tcp connection doesn't have a user of course.
 
Old 03-18-2009, 07:50 AM   #7
landysaccount
Member
 
Registered: Sep 2008
Location: Dominican Republic
Distribution: Debian
Posts: 188

Original Poster
Rep: Reputation: 18
I was thinking of getting users' mac and ip addresses and compare them with a registered customers table using mysql. Another thing, do you think is easier to run a dhcp server and getting info from leased ips?
 
Old 03-18-2009, 08:38 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
May well depend what kind of business this is, but I'd generally recommend running as much as possible on DHCP. Even servers benefit from using reserved addresses over DHCP, just as long as you have a suitably resilient infrastructure to provide it.

Note that outside of your local network you'll never get the MAC.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Automatic backup for sporadically connected clients with Box Backup LXer Syndicated Linux News 0 08-29-2008 09:40 PM
Polling one client from several multicast clients connected through LAN dhara Linux - Networking 0 02-06-2007 01:35 PM
How to find out which clients are connected to a WLAN ozymandias Linux - Wireless Networking 2 12-09-2006 04:55 AM
Linux clients sharing a common printer connected to a windows box comox Linux - Networking 1 10-24-2005 07:50 PM
Apache: How to know how many clients are connected? Nerox Linux - Software 13 07-25-2004 10:07 AM


All times are GMT -5. The time now is 08:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration